[gnome-control-center/wip/gbsneto/new-goa-panel: 67/76] online-accounts: keep account editor dialog visible when adding account



commit a10325c88b33f7df1fd8dbde1bf42c951aba39c7
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Thu Nov 10 13:09:42 2016 -0200

    online-accounts: keep account editor dialog visible when adding account
    
    When adding a new account, the account editor dialog always gets hidden
    when any response is given. This breaks, e.g., the ownCloud process, and
    hides the dialog while it's still validating the account.
    
    Fix that by only hiding the dialog on cancel or close.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=774222

 panels/online-accounts/cc-online-accounts-panel.c |   12 ++++++++++++
 panels/online-accounts/online-accounts.ui         |    2 +-
 2 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/panels/online-accounts/cc-online-accounts-panel.c 
b/panels/online-accounts/cc-online-accounts-panel.c
index c7306c1..90088f3 100644
--- a/panels/online-accounts/cc-online-accounts-panel.c
+++ b/panels/online-accounts/cc-online-accounts-panel.c
@@ -205,6 +205,17 @@ on_provider_row_activated (GtkListBox    *listbox,
 
 /* ---------------------------------------------------------------------------------------------------- */
 
+static void
+on_dialog_response (GtkWidget  *dialog,
+                    guint       response_id,
+                    CcGoaPanel *self)
+{
+  if (response_id == GTK_RESPONSE_CANCEL || response_id == GTK_RESPONSE_DELETE_EVENT)
+    gtk_widget_hide (dialog);
+}
+
+/* ---------------------------------------------------------------------------------------------------- */
+
 static gint
 sort_func (GtkListBoxRow *a,
            GtkListBoxRow *b,
@@ -422,6 +433,7 @@ cc_goa_panel_class_init (CcGoaPanelClass *klass)
   gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, stack);
 
   gtk_widget_class_bind_template_callback (widget_class, on_edit_account_dialog_delete_event);
+  gtk_widget_class_bind_template_callback (widget_class, on_dialog_response);
   gtk_widget_class_bind_template_callback (widget_class, on_listbox_row_activated);
   gtk_widget_class_bind_template_callback (widget_class, on_notification_closed);
   gtk_widget_class_bind_template_callback (widget_class, on_provider_row_activated);
diff --git a/panels/online-accounts/online-accounts.ui b/panels/online-accounts/online-accounts.ui
index 746195d..f1c7061 100644
--- a/panels/online-accounts/online-accounts.ui
+++ b/panels/online-accounts/online-accounts.ui
@@ -144,7 +144,7 @@
     <property name="resizable">False</property>
     <property name="modal">True</property>
     <signal name="delete-event" handler="on_edit_account_dialog_delete_event" object="CcGoaPanel" 
swapped="yes" />
-    <signal name="response" handler="gtk_widget_hide" object="edit_account_dialog" swapped="no" />
+    <signal name="response" handler="on_dialog_response" object="CcGoaPanel" swapped="no" />
     <child type="titlebar">
       <object class="GtkHeaderBar" id="edit_account_headerbar">
         <property name="visible">True</property>


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