[gnome-control-center/wip/gbsneto/new-goa-panel: 9/23] online-accounts: remove unused widgets



commit 1f18093669de04d9673ad97be8bf1a4d663a037b
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Nov 9 17:11:47 2016 -0200

    online-accounts: remove unused widgets
    
    These widgets are not used anymore, and they're not present in
    the latest designs.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=774222

 panels/online-accounts/cc-online-accounts-panel.c |   59 -------
 panels/online-accounts/online-accounts.ui         |  187 +--------------------
 2 files changed, 7 insertions(+), 239 deletions(-)
---
diff --git a/panels/online-accounts/cc-online-accounts-panel.c 
b/panels/online-accounts/cc-online-accounts-panel.c
index f999c8c..16563c1 100644
--- a/panels/online-accounts/cc-online-accounts-panel.c
+++ b/panels/online-accounts/cc-online-accounts-panel.c
@@ -41,16 +41,9 @@ struct _CcGoaPanel
   GoaClient *client;
 
   GtkWidget *accounts_listbox;
-  GtkWidget *accounts_notebook;
-  GtkWidget *accounts_tree_box;
-  GtkWidget *accounts_tree_label;
-  GtkWidget *add_account_button;
   GtkWidget *edit_account_dialog;
   GtkWidget *edit_account_headerbar;
   GtkWidget *providers_listbox;
-  GtkWidget *toolbar;
-  GtkWidget *toolbar_add_button;
-  GtkWidget *toolbar_remove_button;
   GtkWidget *accounts_vbox;
 };
 
@@ -58,14 +51,6 @@ static void on_listbox_row_activated (GtkListBox    *listbox,
                                       GtkListBoxRow *activated_row,
                                       CcGoaPanel    *self);
 
-static void on_toolbar_add_button_clicked (GtkToolButton *button,
-                                           gpointer       user_data);
-static void on_toolbar_remove_button_clicked (GtkToolButton *button,
-                                              gpointer       user_data);
-
-static void on_add_button_clicked (GtkButton *button,
-                                   gpointer   user_data);
-
 static void fill_accounts_listbox (CcGoaPanel *self);
 
 static void on_account_added (GoaClient  *client,
@@ -303,13 +288,6 @@ cc_goa_panel_init (CcGoaPanel *panel)
                           panel->providers_listbox, "sensitive",
                           G_BINDING_SYNC_CREATE);
 
-  g_object_bind_property (monitor, "network-available",
-                          panel->toolbar_add_button, "sensitive",
-                          G_BINDING_SYNC_CREATE);
-  g_object_bind_property (monitor, "network-available",
-                          panel->add_account_button, "sensitive",
-                          G_BINDING_SYNC_CREATE);
-
   /* TODO: probably want to avoid _sync() ... */
   error = NULL;
   panel->client = goa_client_new_sync (NULL /* GCancellable */, &error);
@@ -375,34 +353,17 @@ cc_goa_panel_class_init (CcGoaPanelClass *klass)
   gtk_widget_class_set_template_from_resource (widget_class, 
"/org/gnome/control-center/online-accounts/online-accounts.ui");
 
   gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, accounts_listbox);
-  gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, accounts_notebook);
-  gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, accounts_tree_box);
-  gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, accounts_tree_label);
   gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, accounts_vbox);
-  gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, add_account_button);
   gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, edit_account_dialog);
   gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, edit_account_headerbar);
   gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, providers_listbox);
-  gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, toolbar);
-  gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, toolbar_add_button);
-  gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, toolbar_remove_button);
 
-  gtk_widget_class_bind_template_callback (widget_class, on_add_button_clicked);
   gtk_widget_class_bind_template_callback (widget_class, on_listbox_row_activated);
-  gtk_widget_class_bind_template_callback (widget_class, on_toolbar_add_button_clicked);
-  gtk_widget_class_bind_template_callback (widget_class, on_toolbar_remove_button_clicked);
 }
 
 /* ---------------------------------------------------------------------------------------------------- */
 
 static void
-show_page (CcGoaPanel *panel,
-           gint page_num)
-{
-  gtk_notebook_set_current_page (GTK_NOTEBOOK (panel->accounts_notebook), page_num);
-}
-
-static void
 show_page_account (CcGoaPanel  *panel,
                    GoaObject *object)
 {
@@ -414,10 +375,6 @@ show_page_account (CcGoaPanel  *panel,
 
   provider = NULL;
 
-  show_page (panel, 1);
-  gtk_widget_set_sensitive (panel->accounts_tree_box, TRUE);
-  gtk_widget_hide (panel->accounts_tree_label);
-
   /* Out with the old */
   children = gtk_container_get_children (GTK_CONTAINER (panel->accounts_vbox));
   for (l = children; l != NULL; l = l->next)
@@ -493,8 +450,6 @@ on_listbox_row_activated (GtkListBox    *listbox,
   is_locked = goa_account_get_is_locked (goa_object_peek_account (object));
 
   show_page_account (self, object);
-
-  gtk_widget_set_sensitive (self->toolbar_remove_button, !is_locked);
 }
 
 static void
@@ -647,12 +602,6 @@ get_all_providers_cb (GObject      *source,
 /* ---------------------------------------------------------------------------------------------------- */
 
 static void
-on_toolbar_add_button_clicked (GtkToolButton *button,
-                               gpointer       user_data)
-{
-}
-
-static void
 remove_account_cb (GoaAccount    *account,
                    GAsyncResult  *res,
                    gpointer       user_data)
@@ -713,11 +662,3 @@ on_toolbar_remove_button_clicked (GtkToolButton *button,
                                g_object_ref (panel));
     }
 }
-
-/* ---------------------------------------------------------------------------------------------------- */
-
-static void
-on_add_button_clicked (GtkButton *button,
-                       gpointer   user_data)
-{
-}
diff --git a/panels/online-accounts/online-accounts.ui b/panels/online-accounts/online-accounts.ui
index 6932d3c..04fb90d 100644
--- a/panels/online-accounts/online-accounts.ui
+++ b/panels/online-accounts/online-accounts.ui
@@ -28,87 +28,16 @@
               </object>
             </child>
             <child>
-              <object class="GtkBox" id="accounts_tree_box">
+              <object class="GtkFrame" id="accounts_frame">
                 <property name="visible">True</property>
-                <property name="orientation">vertical</property>
-                <property name="spacing">0</property>
-                <child>
-                  <object class="GtkOverlay" id="accounts-tree-overlay">
-                    <property name="visible">True</property>
-                    <child>
-                      <object class="GtkFrame" id="accounts_frame">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <child>
-                          <object class="GtkListBox" id="accounts_listbox">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="selection_mode">none</property>
-                            <signal name="row-activated" handler="on_listbox_row_activated" 
object="CcGoaPanel" swapped="no" />
-                          </object>
-                        </child>
-                      </object>
-                    </child>
-                    <child type="overlay">
-                      <object class="GtkLabel" id="accounts_tree_label">
-                        <property name="can_focus">False</property>
-                        <property name="no-show-all">True</property>
-                        <property name="justify">center</property>
-                        <property name="label" translatable="yes">No online accounts configured</property>
-                        <property name="max-width-chars">18</property>
-                        <property name="wrap">True</property>
-                      </object>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
+                <property name="can_focus">False</property>
                 <child>
-                  <object class="GtkToolbar" id="toolbar">
+                  <object class="GtkListBox" id="accounts_listbox">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="toolbar_style">icons</property>
-                    <property name="icon_size">1</property>
-                    <style>
-                      <class name="inline-toolbar"/>
-                    </style>
-                    <child>
-                      <object class="GtkToolButton" id="toolbar_add_button">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="use_action_appearance">False</property>
-                        <property name="icon_name">list-add-symbolic</property>
-                        <property name="label" translatable="yes">Add Account</property>
-                        <signal name="clicked" handler="on_toolbar_add_button_clicked" object="CcGoaPanel" 
swapped="no" />
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="homogeneous">True</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkToolButton" id="toolbar_remove_button">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="use_action_appearance">False</property>
-                        <property name="icon_name">list-remove-symbolic</property>
-                        <property name="label" translatable="yes">Remove Account</property>
-                        <signal name="clicked" handler="on_toolbar_remove_button_clicked" 
object="CcGoaPanel" swapped="no" />
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="homogeneous">True</property>
-                      </packing>
-                    </child>
+                    <property name="can_focus">True</property>
+                    <property name="selection_mode">none</property>
+                    <signal name="row-activated" handler="on_listbox_row_activated" object="CcGoaPanel" 
swapped="no" />
                   </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">2</property>
-                  </packing>
                 </child>
               </object>
             </child>
@@ -157,112 +86,10 @@
       </object>
     </child>
     <child internal-child="vbox">
-      <object class="GtkBox">
+      <object class="GtkBox" id="accounts_vbox">
         <property name="can_focus">False</property>
         <property name="orientation">vertical</property>
         <property name="margin">18</property>
-        <child>
-          <object class="GtkNotebook" id="accounts_notebook">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="show_tabs">False</property>
-            <property name="show_border">False</property>
-            <child>
-              <object class="GtkBox" id="box1">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="valign">center</property>
-                <property name="vexpand">True</property>
-                <property name="orientation">vertical</property>
-                <property name="spacing">6</property>
-                <child>
-                  <object class="GtkButton" id="add_account_button">
-                    <property name="label" translatable="yes">Add an online account</property>
-                    <property name="use_action_appearance">False</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">True</property>
-                    <property name="halign">center</property>
-                    <property name="use_action_appearance">False</property>
-                    <signal name="clicked" handler="on_add_button_clicked" object="CcGoaPanel" swapped="no" 
/>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="label3">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="label" translatable="yes">Adding an account allows your applications to 
access it for documents, mail, contacts, calendar, chat and more.</property>
-                    <property name="justify">center</property>
-                    <property name="wrap">True</property>
-                    <property name="max_width_chars">40</property>
-                    <style>
-                      <class name="dim-label"/>
-                    </style>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-              </object>
-            </child>
-            <child type="tab">
-              <object class="GtkLabel" id="label1">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label">page 1</property>
-              </object>
-              <packing>
-                <property name="tab_fill">False</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkBox" id="accounts_vbox">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="orientation">vertical</property>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-              </object>
-              <packing>
-                <property name="position">1</property>
-              </packing>
-            </child>
-            <child type="tab">
-              <object class="GtkLabel" id="label2">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label">page 2</property>
-              </object>
-              <packing>
-                <property name="position">1</property>
-                <property name="tab_fill">False</property>
-              </packing>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
-            <child type="tab">
-              <placeholder/>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">True</property>
-          </packing>
-        </child>
       </object>
     </child>
   </object>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]