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



commit 9979005d02fde14b26a8f83cc258a1e0f61d7d2c
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 c0c3dc1..8f8e765 100644
--- a/panels/online-accounts/cc-online-accounts-panel.c
+++ b/panels/online-accounts/cc-online-accounts-panel.c
@@ -215,6 +215,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,
@@ -430,6 +441,7 @@ cc_goa_panel_class_init (CcGoaPanelClass *klass)
   gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, providers_listbox);
   gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, stack);
 
+  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 6cffc6b..81b25bc 100644
--- a/panels/online-accounts/online-accounts.ui
+++ b/panels/online-accounts/online-accounts.ui
@@ -142,7 +142,7 @@
     <property name="use_header_bar">1</property>
     <property name="resizable">False</property>
     <property name="modal">True</property>
-    <signal name="response" handler="gtk_widget_hide" object="edit_account_dialog" swapped="no" />
+    <signal name="response" handler="on_dialog_response" object="CcGoaPanel" swapped="no" />
     <signal name="delete-event" handler="gtk_widget_hide_on_delete" swapped="no" />
     <child type="titlebar">
       <object class="GtkHeaderBar" id="edit_account_headerbar">


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