[gnome-boxes/wip/feborges/pause-vms: 27/28] actions-popover: Drop "Pause" option



commit 58526825676bcd1448b8cc5cc871abec1403b365
Author: Felipe Borges <felipeborges gnome org>
Date:   Thu Jan 11 17:16:49 2018 +0100

    actions-popover: Drop "Pause" option
    
    The "Pause" option refers to the libvirt action of "saving a guest",
    which consists of taking a running guest and save its memory state
    to a file, enabling it to be later restored causing the guest to
    recover its original running state. See [0].
    
    Boxes will, by default, Pause/Save a guest whenever its display is
    closed/destroyed, unless when the box is marked to "Run in Background".
    
    This way, there's no need to expose the "Pause" shortcut in the actions
    popover.
    
    Besides, we already expose the "Pause" action in the action bar,
    whenever the selection mode is active. This can be very convenient for
    users that want to Pause multiple guests simultaneously.
    
    [0] https://libvirt.org/guide/html/Application_Development_Guide-Lifecycle-Save.html
    
    Resolves #139

 src/actions-popover.vala | 22 ++--------------------
 1 file changed, 2 insertions(+), 20 deletions(-)
---
diff --git a/src/actions-popover.vala b/src/actions-popover.vala
index c3d04b40..3c5c16f3 100644
--- a/src/actions-popover.vala
+++ b/src/actions-popover.vala
@@ -5,7 +5,6 @@
         {"open-in-new-win", open_in_new_win_activated},
         {"favorite",        favorite_activated},
         {"take_screenshot", take_screenshot_activated},
-        {"pause",           pause_activated},
         {"force_shutdown",  force_shutdown_activated},
         {"delete",          delete_activated},
         {"clone",           clone_activated},
@@ -55,7 +54,7 @@ public void update_for_item (CollectionItem item) {
             section.append (_("Add to Favorites"), "box.favorite");
         menu.append_section (null, section);
 
-        // New section for force shutdown, pause and delete
+        // New section for force shutdown and delete
         section = new GLib.Menu ();
 
         if (machine is LibvirtMachine) {
@@ -65,14 +64,9 @@ public void update_for_item (CollectionItem item) {
         }
 
         if (window.ui_state != UIState.DISPLAY) {
-            // Pause
-            section.append (_("Pause"), "box.pause");
-            var action = action_group.lookup_action ("pause") as GLib.SimpleAction;
-            action.set_enabled (machine.can_save);
-
             // Clone
             section.append (_("Clone"), "box.clone");
-            action = action_group.lookup_action ("clone") as GLib.SimpleAction;
+            var action = action_group.lookup_action ("clone") as GLib.SimpleAction;
             action.set_enabled (machine.can_clone);
 
             // Delete
@@ -137,18 +131,6 @@ private void take_screenshot_activated () {
         });
     }
 
-    private void pause_activated () {
-        var machine = window.current_item as Machine;
-
-        machine.save.begin ((obj, result) => {
-            try {
-                machine.save.end (result);
-            } catch (GLib.Error e) {
-                window.notificationbar.display_error (_("Pausing ā€œ%sā€ failed").printf (machine.name));
-            }
-        });
-    }
-
     private void force_shutdown_activated () {
         var machine = window.current_item as LibvirtMachine;
 


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