[shotwell] publishing: Fix criticals when switching to Facebook



commit eb9f7826392aa96306dfd102f0ee7d5e2dd40d02
Author: Jens Georg <mail jensge org>
Date:   Thu Nov 17 18:00:51 2016 +0100

    publishing: Fix criticals when switching to Facebook
    
    Signed-off-by: Jens Georg <mail jensge org>

 src/publishing/PublishingUI.vala |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/src/publishing/PublishingUI.vala b/src/publishing/PublishingUI.vala
index 30f93d2..1dd9895 100644
--- a/src/publishing/PublishingUI.vala
+++ b/src/publishing/PublishingUI.vala
@@ -285,22 +285,18 @@ public class PublishingDialog : Gtk.Dialog {
 
         get_content_area().pack_start(central_area_layouter, true, true, 0);
         
-        close_cancel_button = new Gtk.Button.with_mnemonic("_Cancel");
-        close_cancel_button.set_can_default(true);
-        close_cancel_button.clicked.connect(on_close_cancel_clicked);
         if (use_header) {
+            close_cancel_button = new Gtk.Button.with_mnemonic("_Cancel");
+            close_cancel_button.set_can_default(true);
+
             ((Gtk.HeaderBar) get_header_bar()).pack_start(close_cancel_button);
             ((Gtk.HeaderBar) get_header_bar()).pack_end(service_selector_box);
         }
         else {
-          add_button (_("_Cancel"), Gtk.ResponseType.CANCEL);
-          response.connect((id) => {
-              if (id == Gtk.ResponseType.CANCEL) {
-                  on_close_cancel_clicked();
-              }
-          });
-
+            add_button (_("_Cancel"), Gtk.ResponseType.CANCEL);
+            close_cancel_button = get_widget_for_response (Gtk.ResponseType.CANCEL) as Gtk.Button;
         }
+        close_cancel_button.clicked.connect(on_close_cancel_clicked);
 
         set_standard_window_mode();
         


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