[gnome-boxes] properties-toolbar: Drop use of AppWindow singleton



commit 6ac38db5354fbaf9190b819f4fef44255e50d98f
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Fri Jul 18 09:58:45 2014 +0200

    properties-toolbar: Drop use of AppWindow singleton
    
    Instead of using the AppWindow singleton, PropertiesToolbar now has its
    own reference to AppWindow that it receives through a parameter to
    setup_ui().
    
    This is needed to drop the use of AppWindow singleton and therefore to
    make multiple windows possible.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=732098

 src/properties-toolbar.vala |    8 +++++++-
 src/topbar.vala             |    3 ++-
 2 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/properties-toolbar.vala b/src/properties-toolbar.vala
index 5a6c86c..f8953a4 100644
--- a/src/properties-toolbar.vala
+++ b/src/properties-toolbar.vala
@@ -6,13 +6,19 @@ private class Boxes.PropertiesToolbar: HeaderBar {
     [GtkChild]
     private Image back_image;
 
+    private AppWindow window;
+
     construct {
         back_image.icon_name = (get_direction () == TextDirection.RTL)? "go-previous-rtl-symbolic" :
                                                                         "go-previous-symbolic";
     }
 
+    public void setup_ui (AppWindow window) {
+        this.window = window;
+    }
+
     [GtkCallback]
     private void on_back_clicked () {
-        App.window.set_state (App.window.previous_ui_state);
+        window.set_state (window.previous_ui_state);
     }
 }
diff --git a/src/topbar.vala b/src/topbar.vala
index a96dfcc..1875589 100644
--- a/src/topbar.vala
+++ b/src/topbar.vala
@@ -26,7 +26,7 @@ private class Boxes.Topbar: Gtk.Stack, Boxes.UI {
     public WizardToolbar wizard_toolbar;
 
     [GtkChild]
-    private Gtk.HeaderBar props_toolbar;
+    private PropertiesToolbar props_toolbar;
 
     private GLib.Binding props_name_bind;
 
@@ -112,6 +112,7 @@ private class Boxes.Topbar: Gtk.Stack, Boxes.UI {
         collection_toolbar.setup_ui (window);
         selection_toolbar.setup_ui (window);
         display_toolbar.setup_ui (window);
+        props_toolbar.setup_ui (window);
     }
 
     private void ui_state_changed () {


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