diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2009-12-01 19:57:02 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2009-12-01 20:05:41 +0800 |
commit | 63824875083611f8503deaff302887dd6c47a603 (patch) | |
tree | cacd8afd933f7ccdcb24b6dc7b51aa245295ab69 /src/empathy-new-chatroom-dialog.c | |
parent | 832c7689e8060ec508f4dbae53d51f7200ddf2ad (diff) | |
download | gsoc2013-empathy-63824875083611f8503deaff302887dd6c47a603.tar gsoc2013-empathy-63824875083611f8503deaff302887dd6c47a603.tar.gz gsoc2013-empathy-63824875083611f8503deaff302887dd6c47a603.tar.bz2 gsoc2013-empathy-63824875083611f8503deaff302887dd6c47a603.tar.lz gsoc2013-empathy-63824875083611f8503deaff302887dd6c47a603.tar.xz gsoc2013-empathy-63824875083611f8503deaff302887dd6c47a603.tar.zst gsoc2013-empathy-63824875083611f8503deaff302887dd6c47a603.zip |
factor out update_join_button_sensitivy
Diffstat (limited to 'src/empathy-new-chatroom-dialog.c')
-rw-r--r-- | src/empathy-new-chatroom-dialog.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/empathy-new-chatroom-dialog.c b/src/empathy-new-chatroom-dialog.c index fcbfc6a4a..663bd026a 100644 --- a/src/empathy-new-chatroom-dialog.c +++ b/src/empathy-new-chatroom-dialog.c @@ -357,11 +357,19 @@ new_chatroom_dialog_model_add_columns (EmpathyNewChatroomDialog *dialog) } static void +update_join_button_sensitivy (EmpathyNewChatroomDialog *dialog) +{ + const gchar *room; + + room = gtk_entry_get_text (GTK_ENTRY (dialog->entry_room)); + gtk_widget_set_sensitive (dialog->button_join, !EMP_STR_EMPTY (room)); +} + +static void new_chatroom_dialog_update_widgets (EmpathyNewChatroomDialog *dialog) { EmpathyAccountChooser *account_chooser; const gchar *protocol; - const gchar *room; account_chooser = EMPATHY_ACCOUNT_CHOOSER (dialog->account_chooser); @@ -386,8 +394,7 @@ new_chatroom_dialog_update_widgets (EmpathyNewChatroomDialog *dialog) gtk_widget_set_sensitive (dialog->entry_server, TRUE); } - room = gtk_entry_get_text (GTK_ENTRY (dialog->entry_room)); - gtk_widget_set_sensitive (dialog->button_join, !EMP_STR_EMPTY (room)); + update_join_button_sensitivy (dialog); /* Final set up of the dialog */ gtk_widget_grab_focus (dialog->entry_room); @@ -632,10 +639,8 @@ new_chatroom_dialog_entry_changed_cb (GtkWidget *entry, EmpathyNewChatroomDialog *dialog) { if (entry == dialog->entry_room) { - const gchar *room; + update_join_button_sensitivy (dialog); - room = gtk_entry_get_text (GTK_ENTRY (dialog->entry_room)); - gtk_widget_set_sensitive (dialog->button_join, !EMP_STR_EMPTY (room)); /* FIXME: Select the room in the list */ } } |