[gnome-documents] application: cosmetic changes



commit a38a040869d382ff2fca257f64c24a4be2c392ac
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Jul 18 21:18:17 2012 -0400

    application: cosmetic changes
    
    Move the creation of the app menu to its own function

 src/application.js |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index 1d789f0..b76f7b8 100644
--- a/src/application.js
+++ b/src/application.js
@@ -108,9 +108,8 @@ const Application = new Lang.Class({
             }));
         this.application.add_action(fsAction);
 
-        /* We can't use GSettings.create_action(), since we want to be able
-         * to control the enabled state of the action ourselves
-         */
+        // We can't use GSettings.create_action(), since we want to be able
+        // to control the enabled state of the action ourselves
         let viewAsAction = Gio.SimpleAction.new_stateful('view-as',
                                                          GLib.VariantType.new('s'),
                                                          Global.settings.get_value('view-as'));
@@ -129,12 +128,6 @@ const Application = new Lang.Class({
             }));
         this.application.add_action(viewAsAction);
 
-        let builder = new Gtk.Builder();
-        builder.add_from_resource('/org/gnome/documents/app-menu.ui');
-
-        let menu = builder.get_object('app-menu');
-        this.application.set_app_menu(menu);
-
         this.application.add_accelerator('<Primary>q', 'app.quit', null);
         this.application.add_accelerator('F11', 'app.fullscreen', null);
 
@@ -155,6 +148,14 @@ const Application = new Lang.Class({
 
     },
 
+    _initAppMenu: function() {
+        let builder = new Gtk.Builder();
+        builder.add_from_resource('/org/gnome/documents/app-menu.ui');
+
+        let menu = builder.get_object('app-menu');
+        this.application.set_app_menu(menu);
+    },
+
     _refreshMinerNow: function(miner) {
         let env = GLib.getenv('DOCUMENTS_DISABLE_MINERS');
         if (env)
@@ -221,6 +222,7 @@ const Application = new Lang.Class({
         this._refreshMinerNow(zpjMiner);
 
         this._initActions();
+        this._initAppMenu();
         this._mainWindow = new MainWindow.MainWindow(this.application);
     },
 



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