[shotwell/wip/dedeprecate: 32/64] common, piwigo: Add "default" widget to BuilderPane



commit 004bb26e6037d7e47b918819975961a10cf4f3ab
Author: Jens Georg <mail jensge org>
Date:   Sat Oct 29 03:16:27 2016 +0200

    common,piwigo: Add "default" widget to BuilderPane
    
    Signed-off-by: Jens Georg <mail jensge org>

 plugins/common/BuilderPane.vala                   |    7 +++++++
 plugins/shotwell-publishing/PiwigoPublishing.vala |    9 +--------
 2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/plugins/common/BuilderPane.vala b/plugins/common/BuilderPane.vala
index 28f4907..72b4b6f 100644
--- a/plugins/common/BuilderPane.vala
+++ b/plugins/common/BuilderPane.vala
@@ -12,6 +12,9 @@ namespace Shotwell.Plugins.Common {
         }
         public string resource_path { owned get; construct; }
         public bool connect_signals { get; construct; default = false; }
+        public string default_id {
+            owned get; construct; default = "default";
+        }
 
         private Gtk.Builder builder;
         private Gtk.Widget content;
@@ -46,6 +49,10 @@ namespace Shotwell.Plugins.Common {
             return this.builder;
         }
 
+        public virtual Gtk.Widget get_default_widget () {
+            return this.get_builder ().get_object (this.default_id) as Gtk.Widget;
+        }
+
         public virtual void on_pane_installed () {}
 
         public virtual void on_pane_uninstalled () {}
diff --git a/plugins/shotwell-publishing/PiwigoPublishing.vala 
b/plugins/shotwell-publishing/PiwigoPublishing.vala
index a7afe25..99a143f 100644
--- a/plugins/shotwell-publishing/PiwigoPublishing.vala
+++ b/plugins/shotwell-publishing/PiwigoPublishing.vala
@@ -1055,10 +1055,6 @@ internal class SSLErrorPane : Shotwell.Plugins.Common.BuilderPane {
         var proceed = this.get_builder ().get_object ("proceed_button") as Gtk.Button;
         proceed.clicked.connect (() => { this.proceed (); });
     }
-
-    public Gtk.Widget get_default_widget () {
-        return this.get_builder ().get_object ("default") as Gtk.Widget;
-    }
 }
 
 /**
@@ -1091,6 +1087,7 @@ internal class AuthenticationPane : Shotwell.Plugins.Common.BuilderPane {
         Object (resource_path : Resources.RESOURCE_PATH +
                                 "/piwigo_authentication_pane.ui",
                 connect_signals : true,
+                default_id : "login_button",
                 mode : mode,
                 publisher : publisher);
     }
@@ -1145,10 +1142,6 @@ internal class AuthenticationPane : Shotwell.Plugins.Common.BuilderPane {
         publisher.get_host().set_dialog_default_widget(login_button);
     }
 
-    public Gtk.Widget get_default_widget() {
-        return login_button;
-    }
-
     private void on_login_button_clicked() {
         login(url_entry.get_text(), username_entry.get_text(),
             password_entry.get_text(), remember_password_checkbutton.get_active());


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