[gnome-control-center/wip/gbsneto/new-goa-panel: 22/25] online-accounts: add an offline message label



commit 8dde8d754046838aa3d69b43efd400cfc951f93a
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Thu Nov 10 14:56:27 2016 -0200

    online-accounts: add an offline message label
    
    When offline, we currently block the new accounts listbox
    so that users can't add new accounts. There is, however,
    no visual indication that we're offline, besides the listbox.
    
    Fix that by adding a descriptive label that's only visible
    when offline.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=774222

 panels/online-accounts/cc-online-accounts-panel.c |    6 ++++++
 panels/online-accounts/online-accounts.ui         |    8 ++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/panels/online-accounts/cc-online-accounts-panel.c 
b/panels/online-accounts/cc-online-accounts-panel.c
index 53ca412..07d6cea 100644
--- a/panels/online-accounts/cc-online-accounts-panel.c
+++ b/panels/online-accounts/cc-online-accounts-panel.c
@@ -50,6 +50,7 @@ struct _CcGoaPanel
   GtkWidget *new_account_vbox;
   GtkWidget *notification_label;
   GtkWidget *notification_revealer;
+  GtkWidget *offline_label;
   GtkWidget *providers_listbox;
   GtkWidget *remove_account_button;
   GtkWidget *stack;
@@ -415,6 +416,10 @@ cc_goa_panel_init (CcGoaPanel *panel)
   monitor = g_network_monitor_get_default();
 
   g_object_bind_property (monitor, "network-available",
+                          panel->offline_label, "visible",
+                          G_BINDING_SYNC_CREATE | G_BINDING_INVERT_BOOLEAN);
+
+  g_object_bind_property (monitor, "network-available",
                           panel->providers_listbox, "sensitive",
                           G_BINDING_SYNC_CREATE);
 
@@ -490,6 +495,7 @@ cc_goa_panel_class_init (CcGoaPanelClass *klass)
   gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, new_account_vbox);
   gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, notification_label);
   gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, notification_revealer);
+  gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, offline_label);
   gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, providers_listbox);
   gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, remove_account_button);
   gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, stack);
diff --git a/panels/online-accounts/online-accounts.ui b/panels/online-accounts/online-accounts.ui
index 26e367c..89018b4 100644
--- a/panels/online-accounts/online-accounts.ui
+++ b/panels/online-accounts/online-accounts.ui
@@ -94,6 +94,14 @@
                   </object>
                 </child>
                 <child>
+                  <object class="GtkLabel" id="offline_label">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="wrap">True</property>
+                    <property name="label" translatable="yes">No internet connection - connect to setup new 
online accounts</property>
+                  </object>
+                </child>
+                <child>
                   <object class="GtkFrame" id="accounts_frame">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>


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