[gnome-boxes/wip/clone: 3/16] actions-popover: Don't open under-import VMs



commit faf04be8d65cd51deb086dcb75bdafffa9d16642
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Tue May 3 18:02:58 2016 +0100

    actions-popover: Don't open under-import VMs
    
    If the VM is being imported, do not allow it to be launched from
    actions popover. We already don't allow it to be launched via mouse
    click.

 src/actions-popover.vala |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/actions-popover.vala b/src/actions-popover.vala
index c8d8f37..815d1fa 100644
--- a/src/actions-popover.vala
+++ b/src/actions-popover.vala
@@ -34,9 +34,14 @@ private class Boxes.ActionsPopover: Gtk.Popover {
         var menu = new GLib.Menu ();
         var section = new GLib.Menu ();
 
+        var importing = (machine is LibvirtMachine && (machine as LibvirtMachine).importing);
+
         // Open in new Window
-        if (window.ui_state != UIState.DISPLAY)
+        if (window.ui_state != UIState.DISPLAY) {
             section.append (_("Open in New Window"), "box.open-in-new-win");
+            var action = action_group.lookup_action ("open-in-new-win") as GLib.SimpleAction;
+            action.set_enabled (!importing);
+        }
 
         // Favorite
         if (("favorite" in machine.config.categories))


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