From: Michael Dominic Kostrzewa Date: Fri, 16 Feb 2007 14:11:04 +0000 (+0000) Subject: Adding the hildon_code_dialog_set_input_sensitive function requested by Santtu Lakkal... X-Git-Tag: 2.1.66-1~941 X-Git-Url: http://git.maemo.org/git/?a=commitdiff_plain;h=9d65da2bbe0c64e6a17f6ceb2d995edc5f0adbc4;p=hildon Adding the hildon_code_dialog_set_input_sensitive function requested by Santtu Lakkala to enable/disable the input on the code dialog. --- diff --git a/ChangeLog.2 b/ChangeLog.2 index acae844..ebe05dc 100644 --- a/ChangeLog.2 +++ b/ChangeLog.2 @@ -1,5 +1,13 @@ 2007-02-16 Michael Dominic Kostrzewa + * debian/changelog: + * src/hildon-code-dialog.c: + * src/hildon-code-dialog.h: Adding the + hildon_code_dialog_set_input_sensitive function requested by Santtu + Lakkala to enable/disable the input on the code dialog. + +2007-02-16 Michael Dominic Kostrzewa + * doc/Makefile.am: * doc/hildon-docs.sgml: * doc/visual_index.xml: Documentation fixes. diff --git a/debian/changelog b/debian/changelog index c1c5e4e..6f521f3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ -libhildon (0.9.9-5) unstable; urgency=low +libhildon (0.9.9-6) unstable; urgency=low * Unreleased. -- Michael Dominic Kostrzewa Fri, 02 Feb 2007 12:00:00 +0300 + diff --git a/src/hildon-code-dialog.c b/src/hildon-code-dialog.c index f48ccb1..8cbd5fd 100644 --- a/src/hildon-code-dialog.c +++ b/src/hildon-code-dialog.c @@ -541,3 +541,32 @@ hildon_code_dialog_input (HildonCodeDialog *dialog) /* Emit the signal */ g_signal_emit (dialog, input_signal, 0); } + +/** + * hildon_code_dialog_set_input_sensitive + * @dialog: The #HildonCodeDialog whose state is to be changed + * @sensitive: The new state + * + * This function will block or enable the input on the code dialog by + * making the input button sensitive (or not). + **/ +void +hildon_code_dialog_set_input_sensitive (HildonCodeDialog *dialog, + gboolean sensitive) +{ + int i; + int k; + + g_return_if_fail (HILDON_IS_CODE_DIALOG (dialog)); + + HildonCodeDialogPrivate *priv = HILDON_CODE_DIALOG_GET_PRIVATE (dialog); + g_assert (priv); + + for (i = 0; i < 5; i++) + for (k = 0; k < 3; k++) + if (i != 4 && (k != 0 || k != 2)) + gtk_widget_set_sensitive (priv->buttons [i][k], sensitive); + + gtk_widget_set_sensitive (priv->help_text, sensitive); + gtk_widget_set_sensitive (priv->entry, sensitive); +} diff --git a/src/hildon-code-dialog.h b/src/hildon-code-dialog.h index bbc1b3b..0e2ca7a 100644 --- a/src/hildon-code-dialog.h +++ b/src/hildon-code-dialog.h @@ -79,6 +79,10 @@ void hildon_code_dialog_set_help_text (HildonCodeDialog *dialog, const gchar *text); +void +hildon_code_dialog_set_input_sensitive (HildonCodeDialog *dialog, + gboolean sensitive); + G_END_DECLS #endif /* __HILDON_CODE_DIALOG_H__ */