]> git.0d.be Git - empathy.git/commitdiff
Update the Enable/Disable button even if there is no account selected. Set
authorXavier Claessens <xclaesse@gmail.com>
Sat, 28 Jul 2007 20:30:01 +0000 (20:30 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Sat, 28 Jul 2007 20:30:01 +0000 (20:30 +0000)
2007-07-28 Xavier Claessens  <xclaesse@gmail.com>

* libempathy-gtk/empathy-accounts-dialog.glade:
* libempathy-gtk/empathy-accounts-dialog.c: Update the Enable/Disable
button even if there is no account selected. Set it insensitive if no
account is selected. Fixes bug #459012.

svn path=/trunk/; revision=207

ChangeLog
libempathy-gtk/empathy-accounts-dialog.c
libempathy-gtk/empathy-accounts-dialog.glade

index a7a112da5f9c1085ea9f6c5d2e7e9e836594b507..ad8fa8dc182962a16db8a56eecc4bedbe1bc9a90 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-07-28 Xavier Claessens  <xclaesse@gmail.com>
+
+       * libempathy-gtk/empathy-accounts-dialog.glade:
+       * libempathy-gtk/empathy-accounts-dialog.c: Update the Enable/Disable
+       button even if there is no account selected. Set it insensitive if no
+       account is selected. Fixes bug #459012.
+
 2007-07-27 Xavier Claessens  <xclaesse@gmail.com>
 
        * libempathy-gtk/empathy-profile-chooser.c: Sort profiles to have
index 888b14c4dde1c91432e329c71ac5916384043efa..2c1225eb415430b67e6f44140139bd2edee2dd49 100644 (file)
@@ -159,15 +159,13 @@ static void       accounts_dialog_destroy_cb                (GtkWidget
 static void
 accounts_dialog_setup (EmpathyAccountsDialog *dialog)
 {
-       GtkTreeView      *view;
-       GtkListStore     *store;
-       GtkTreeSelection *selection;
-       GtkTreeIter       iter;
-       GList            *accounts, *l;
+       GtkTreeView  *view;
+       GtkListStore *store;
+       GtkTreeIter   iter;
+       GList        *accounts, *l;
 
        view = GTK_TREE_VIEW (dialog->treeview);
        store = GTK_LIST_STORE (gtk_tree_view_get_model (view));
-       selection = gtk_tree_view_get_selection (view);
 
        accounts = mc_accounts_list ();
 
@@ -215,12 +213,9 @@ accounts_dialog_update_connect_button (EmpathyAccountsDialog *dialog)
 
        account = accounts_dialog_model_get_selected (dialog);
        
-       if (!account) {
-               gtk_widget_set_sensitive (dialog->button_connect, FALSE);
-               return;
-       }
+       gtk_widget_set_sensitive (dialog->button_connect, account != NULL);
 
-       if (mc_account_is_enabled (account)) {
+       if (account && mc_account_is_enabled (account)) {
                label = _("Disable");
                stock_id = GTK_STOCK_DISCONNECT;
        } else {
index 05ba64f8056601007a2704d57e66aca42118e34f..f0f1b567e9f22ec0cc8f6aa5535ab73c0b49e13e 100644 (file)
                    <widget class="GtkButton" id="button_connect">
                      <property name="visible">True</property>
                      <property name="can_focus">True</property>
-                     <property name="label">gtk-connect</property>
-                     <property name="use_stock">False</property>
                      <property name="relief">GTK_RELIEF_NORMAL</property>
                      <property name="focus_on_click">True</property>
+
+                     <child>
+                       <widget class="GtkAlignment" id="alignment30">
+                         <property name="visible">True</property>
+                         <property name="xalign">0.5</property>
+                         <property name="yalign">0.5</property>
+                         <property name="xscale">0</property>
+                         <property name="yscale">0</property>
+                         <property name="top_padding">0</property>
+                         <property name="bottom_padding">0</property>
+                         <property name="left_padding">0</property>
+                         <property name="right_padding">0</property>
+
+                         <child>
+                           <widget class="GtkHBox" id="hbox182">
+                             <property name="visible">True</property>
+                             <property name="homogeneous">False</property>
+                             <property name="spacing">2</property>
+
+                             <child>
+                               <widget class="GtkImage" id="image2">
+                                 <property name="visible">True</property>
+                                 <property name="stock">gtk-connect</property>
+                                 <property name="icon_size">4</property>
+                                 <property name="xalign">0.5</property>
+                                 <property name="yalign">0.5</property>
+                                 <property name="xpad">0</property>
+                                 <property name="ypad">0</property>
+                               </widget>
+                               <packing>
+                                 <property name="padding">0</property>
+                                 <property name="expand">False</property>
+                                 <property name="fill">False</property>
+                               </packing>
+                             </child>
+
+                             <child>
+                               <widget class="GtkLabel" id="label644">
+                                 <property name="visible">True</property>
+                                 <property name="label">Enable</property>
+                                 <property name="use_underline">True</property>
+                                 <property name="use_markup">False</property>
+                                 <property name="justify">GTK_JUSTIFY_LEFT</property>
+                                 <property name="wrap">False</property>
+                                 <property name="selectable">False</property>
+                                 <property name="xalign">0.5</property>
+                                 <property name="yalign">0.5</property>
+                                 <property name="xpad">0</property>
+                                 <property name="ypad">0</property>
+                                 <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                                 <property name="width_chars">-1</property>
+                                 <property name="single_line_mode">False</property>
+                                 <property name="angle">0</property>
+                               </widget>
+                               <packing>
+                                 <property name="padding">0</property>
+                                 <property name="expand">False</property>
+                                 <property name="fill">False</property>
+                               </packing>
+                             </child>
+                           </widget>
+                         </child>
+                       </widget>
+                     </child>
                    </widget>
                    <packing>
                      <property name="padding">0</property>