]> git.0d.be Git - empathy.git/commitdiff
Fixed some of the EmpathyAccountWidget's control button behaviour.
authorJonathan Tellier <jonathan.tellier@gmail.com>
Fri, 28 Aug 2009 17:26:15 +0000 (13:26 -0400)
committerCosimo Cecchi <cosimoc@gnome.org>
Mon, 31 Aug 2009 14:19:31 +0000 (16:19 +0200)
- When creating an IRC account, we are now making sure that the control
  buttons have the correct state.
- When creating an account, the "Cancel" button is always sensitive.
- Fixed a style error in EmpathyAccountsDialog.

libempathy-gtk/empathy-account-widget.c

index df0dc967ba5c6109b824b1b25f8cc63016356c9b..c831bc8c4aeb656569af320f371e5f491ad5b55f 100644 (file)
@@ -99,7 +99,9 @@ account_widget_set_control_buttons_sensitivity (EmpathyAccountWidget *self,
   if (!priv->simple)
     {
       gtk_widget_set_sensitive (priv->apply_button, sensitive);
-      gtk_widget_set_sensitive (priv->cancel_button, sensitive);
+      gtk_widget_set_sensitive (
+          priv->cancel_button, sensitive || priv->creating_account);
+
       priv->contains_pending_changes = sensitive;
     }
 }
@@ -1207,7 +1209,19 @@ do_constructed (GObject *obj)
           G_CALLBACK (account_widget_apply_clicked_cb),
           self);
       gtk_widget_show_all (hbox);
-      account_widget_set_control_buttons_sensitivity (self, FALSE);
+
+      if (!tp_strdiff (protocol, "irc") && priv->creating_account)
+        {
+          /* For the IRC protocol, when creating an account, the user might
+           * have nothing to enter. That means that no control interaction
+           * might occur, so the control buttons sensitivity might never get
+           * updated. That's why we have to explicitly call this function. */
+          account_widget_handle_control_buttons_sensitivity (self);
+        }
+      else
+        {
+          account_widget_set_control_buttons_sensitivity (self, FALSE);
+        }
     }
 
   account = empathy_account_settings_get_account (priv->settings);