[gnome-boxes] Move set_app_menu to app.startup.connect_after



commit 357cd600aa9184dd7d9d31aff2a0317c53221519
Author: Sebastian Keller <sebastien-keller gmx de>
Date:   Tue Jan 24 17:00:11 2012 +0100

    Move set_app_menu to app.startup.connect_after
    
    Boxes fails to start with a current git snapshot of gtk/glib because
    set_app_menu is not called from the app startup function.
    This used to work when the menu stuff was still using dbus but broke when it
    switched to x properties.
    
    Here is some non-committed documentation about this:
    https://bugzilla.gnome.org/show_bug.cgi?id=668203
    
    I'm attaching a patch that moves the menu to app startup. I've decided to put
    it into the startup directly as it was not part of setup_ui() before, but it
    might make sense to move it there (before creating the window).
    
    This fixes https://bugzilla.gnome.org/show_bug.cgi?id=668584

 src/app.vala |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)
---
diff --git a/src/app.vala b/src/app.vala
index d67cefa..7cc9032 100644
--- a/src/app.vala
+++ b/src/app.vala
@@ -97,22 +97,25 @@ private class Boxes.App: Boxes.UI {
         });
         application.add_action (action);
 
-        var menu = new GLib.Menu ();
-        menu.append (_("New"), "app.new");
 
-        var display_section = new GLib.Menu ();
-        display_section.append (_("Properties"), "app.display.properties");
-        display_section.append (_("Fullscreen"), "app.display.fullscreen");
-        menu.append_section (null, display_section);
 
-        menu.append (_("About Boxes"), "app.about");
-        menu.append (_("Quit"), "app.quit");
+        application.startup.connect_after ((app) => {
+            var menu = new GLib.Menu ();
+            menu.append (_("New"), "app.new");
 
-        application.set_app_menu (menu);
+            var display_section = new GLib.Menu ();
+            display_section.append (_("Properties"), "app.display.properties");
+            display_section.append (_("Fullscreen"), "app.display.fullscreen");
+            menu.append_section (null, display_section);
+
+            menu.append (_("About Boxes"), "app.about");
+            menu.append (_("Quit"), "app.quit");
+
+            application.set_app_menu (menu);
 
-        application.startup.connect_after ((app) => {
             duration = settings.get_int ("animation-duration");
             setup_ui ();
+
             collection = new Collection (this);
             connections = new HashTable<string, GVir.Connection> (str_hash, str_equal);
             collection.item_added.connect ((item) => {



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