[gnome-boxes] machine: Display "Saving..." status



commit eb4c632a4c5b1894b62e09c37da4c8d24c399dc7
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Sat Nov 24 18:30:40 2012 +0200

    machine: Display "Saving..." status
    
    When a machine(s) is being saved, it can easily take several seconds so
    it would be nice to provide some visual indication about whats going on.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=688980

 src/libvirt-machine.vala |    7 +++++--
 src/machine.vala         |   12 +++++++++++-
 2 files changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/src/libvirt-machine.vala b/src/libvirt-machine.vala
index e35a2f2..e7552e8 100644
--- a/src/libvirt-machine.vala
+++ b/src/libvirt-machine.vala
@@ -683,12 +683,15 @@ private class Boxes.LibvirtMachine: Boxes.Machine {
         }
     }
 
-    public async override void save () throws GLib.Error {
+    public async override void save_real () throws GLib.Error {
         yield domain.save_async (0, null);
     }
 
     public async void suspend () throws GLib.Error {
-        (save_on_quit) ? yield domain.save_async (0, null) : domain.suspend ();
+        if (save_on_quit)
+            yield save ();
+        else
+            domain.suspend ();
     }
 
     public void force_shutdown (bool confirm = true) {
diff --git a/src/machine.vala b/src/machine.vala
index 97842a4..ecde3b1 100644
--- a/src/machine.vala
+++ b/src/machine.vala
@@ -218,7 +218,17 @@ private abstract class Boxes.Machine: Boxes.CollectionItem, Boxes.IPropertiesPro
         return Boxes.get_screenshot_filename (config.uuid);
     }
 
-    public virtual async void save () throws GLib.Error {
+    public async void save () throws GLib.Error {
+        var info = this.info;
+        this.info = (info != null)? info + "\n" : "";
+        this.info += _("Saving...");
+
+        yield save_real ();
+
+        this.info = info;
+    }
+
+    protected virtual async void save_real () throws GLib.Error {
     }
 
     public virtual async Gdk.Pixbuf? take_screenshot () throws GLib.Error {



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