[gnome-boxes] fix opening the wizard from the command line



commit efa7142313c139c4f91fa6f75835d0b841a938a2
Author: Marc-Andrà Lureau <marcandre lureau gmail com>
Date:   Sat Jan 7 21:12:02 2012 +0100

    fix opening the wizard from the command line
    
    Regression from the previous GApplication patches.

 src/app.vala  |    2 ++
 src/main.vala |   12 +++++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/src/app.vala b/src/app.vala
index e5274a5..7724915 100644
--- a/src/app.vala
+++ b/src/app.vala
@@ -41,6 +41,7 @@ private class Boxes.App: Boxes.UI {
     public GLib.SimpleAction action_properties;
     public GLib.SimpleAction action_fullscreen;
 
+    public signal void activate ();
     private Gtk.Application application;
     private Clutter.TableLayout box_table;
     private CollectionView view;
@@ -122,6 +123,7 @@ private class Boxes.App: Boxes.UI {
         });
 
         application.activate.connect_after ((app) => {
+            activate ();
             window.present ();
         });
     }
diff --git a/src/main.vala b/src/main.vala
index 48a5b12..b43ca74 100644
--- a/src/main.vala
+++ b/src/main.vala
@@ -67,11 +67,13 @@ public int main (string[] args) {
 
     var app = new Boxes.App ();
 
-    if (uris != null) {
-        // FIXME: We only handle a single URI from commandline
-        var file = File.new_for_commandline_arg (uris[0]);
-        app.wizard.open_with_uri (file.get_uri ());
-    }
+    app.activate.connect (() => {
+        if (uris != null) {
+            // FIXME: We only handle a single URI from commandline
+            var file = File.new_for_commandline_arg (uris[0]);
+            app.wizard.open_with_uri (file.get_uri ());
+        }
+    });
 
     return app.run ();
 }



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