1
0
mirror of https://src.fedoraproject.org/rpms/virt-manager.git synced 2025-07-16 09:04:55 +00:00
Files
virt-manager/virt-manager-0.8.0-createvol-alloc.patch
Cole Robinson 99e5ce6f6b More translations (bz 493795) Don't allow creating a volume without a name
(bz 526111) Don't allow volume allocation > capacity (bz 526077) Add
    tooltips for toolbar buttons (bz 524083)
2009-10-05 17:40:55 +00:00

74 lines
3.5 KiB
Diff

# HG changeset patch
# User Cole Robinson <crobinso@redhat.com>
# Date 1254757810 14400
# Node ID 97c40c4fb29f7b1b1aadcebd42781f0d471d4697
# Parent c0cffb13680c120ceff22386754104f66bb01d25
create-vol: Don't allow allocation to be higher than capacity.
Also tweak the spin button climb rates to be more useful.
diff -r c0cffb13680c -r 97c40c4fb29f src/virtManager/createvol.py
--- a/src/virtManager/createvol.py Mon Oct 05 11:34:39 2009 -0400
+++ b/src/virtManager/createvol.py Mon Oct 05 11:50:10 2009 -0400
@@ -63,6 +63,8 @@
"on_vol_cancel_clicked" : self.close,
"on_vol_create_clicked" : self.finish,
"on_vol_name_changed" : self.vol_name_changed,
+ "on_vol_allocation_value_changed" : self.vol_allocation_changed,
+ "on_vol_capacity_value_changed" : self.vol_capacity_changed,
})
format_list = self.window.get_widget("vol-format")
@@ -144,6 +146,24 @@
text = src.get_text()
self.window.get_widget("vol-create").set_sensitive(bool(text))
+ def vol_allocation_changed(self, src):
+ cap_widget = self.window.get_widget("vol-capacity")
+
+ alloc = src.get_value()
+ cap = cap_widget.get_value()
+
+ if alloc > cap:
+ cap_widget.set_value(alloc)
+
+ def vol_capacity_changed(self, src):
+ alloc_widget = self.window.get_widget("vol-allocation")
+
+ cap = src.get_value()
+ alloc = self.window.get_widget("vol-allocation").get_value()
+
+ if cap < alloc:
+ alloc_widget.set_value(cap)
+
def finish(self, src):
# validate input
try:
diff -rup old/src/vmm-create-vol.glade virt-manager-0.8.0/src/vmm-create-vol.glade
--- old/src/vmm-create-vol.glade 2009-10-05 13:18:10.212062000 -0400
+++ virt-manager-0.8.0/src/vmm-create-vol.glade 2009-10-05 13:19:57.343395000 -0400
@@ -237,8 +237,9 @@
<widget class="GtkSpinButton" id="vol-capacity">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="adjustment">1 0 100000 1 10 0</property>
- <property name="climb_rate">1</property>
+ <property name="adjustment">1 0 100000 1 1000 0</property>
+ <property name="climb_rate">10</property>
+ <signal name="value_changed" handler="on_vol_capacity_value_changed"/>
</widget>
<packing>
<property name="left_attach">1</property>
@@ -251,8 +252,9 @@
<widget class="GtkSpinButton" id="vol-allocation">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="adjustment">1 0 100000 1 10 0</property>
- <property name="climb_rate">1</property>
+ <property name="adjustment">1 0 100000 1 1000 0</property>
+ <property name="climb_rate">10</property>
+ <signal name="value_changed" handler="on_vol_allocation_value_changed"/>
</widget>
<packing>
<property name="left_attach">1</property>