[gnome-boxes] libvirt-machine-props: Don't save capacity on timeout



commit fa03223041758611e3081157ec5fc796bfd788ae
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Thu Mar 13 17:54:58 2014 +0000

    libvirt-machine-props: Don't save capacity on timeout
    
    Disable 'save on timeout' all together for storage volume size change
    since that could lead us to very bad user experience: You accidently
    increase the capacity to too high value and if you are not quick enough
    to change it again, you'll not be able to correct this ever as we don't
    support shrinking of volumes.

 src/i-properties-provider.vala      |    3 +++
 src/libvirt-machine-properties.vala |    4 ++++
 2 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/i-properties-provider.vala b/src/i-properties-provider.vala
index a6519c8..7a5020c 100644
--- a/src/i-properties-provider.vala
+++ b/src/i-properties-provider.vala
@@ -35,6 +35,9 @@ private class Boxes.Property: GLib.Object {
             if (_deferred_change == null)
                 return;
 
+            if (defer_interval == 0)
+                return;
+
             deferred_change_id = Timeout.add_seconds (defer_interval, () => {
                 flush ();
 
diff --git a/src/libvirt-machine-properties.vala b/src/libvirt-machine-properties.vala
index ab3f9cd..4f534ea 100644
--- a/src/libvirt-machine-properties.vala
+++ b/src/libvirt-machine-properties.vala
@@ -469,6 +469,10 @@ private class Boxes.LibvirtMachineProperties: GLib.Object, Boxes.IPropertiesProv
                                               volume_info.capacity,
                                               pool_info.available,
                                               256 * MEGABYTES);
+            // Disable 'save on timeout' all together since that could lead us to very bad user experience:
+            // You accidently increase the capacity to too high value and if you are not quick enough to 
change
+            // it again, you'll not be able to correct this ever as we don't support shrinking of volumes.
+            property.defer_interval = 0;
             if ((VMConfigurator.is_install_config (machine.domain_config) ||
                  VMConfigurator.is_live_config (machine.domain_config)) &&
                 App.app.previous_ui_state != Boxes.UIState.WIZARD)


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