[gnome-boxes/wip/image-import: 8/10] collection-view: Don't let user launch under-import VMs



commit 66d72435ec2838a8d1002dc19b5dc3a83bb553e2
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Thu Jun 6 03:29:04 2013 +0300

    collection-view: Don't let user launch under-import VMs
    
    Launching of such VMs doesn't make any sense.

 src/collection-view.vala |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/collection-view.vala b/src/collection-view.vala
index 78f8835..e92cae1 100644
--- a/src/collection-view.vala
+++ b/src/collection-view.vala
@@ -312,6 +312,13 @@ private class Boxes.CollectionView: Boxes.UI {
         main_view.get_style_context ().add_class ("boxes-icon-view");
         main_view.item_activated.connect ((view, id, path) => {
             var item = get_item_for_path (path);
+            if (item is LibvirtMachine && (item as LibvirtMachine).importing) {
+                // FIXME: Better error message!
+                var msg = _("Launching of a box that is being imported, is not possible.");
+                App.app.notificationbar.display_error (msg);
+
+                return;
+            }
             App.app.select_item (item);
         });
         main_view.view_selection_changed.connect (() => {


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