settings: add an option to resize root.img (#699)
This commit is contained in:
parent
9cc18228a0
commit
4f77108c5f
@ -306,6 +306,12 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
|
||||
self.max_priv_storage.setMinimum(self.priv_img_size)
|
||||
self.max_priv_storage.setValue(self.priv_img_size)
|
||||
|
||||
self.root_img_size = self.vm.get_root_img_sz()/1024/1024
|
||||
self.root_resize.setValue(self.root_img_size)
|
||||
self.root_resize.setMinimum(self.root_img_size)
|
||||
self.root_resize.setEnabled(hasattr(self.vm, 'resize_root_img') and
|
||||
not self.vm.template)
|
||||
self.root_resize_label.setEnabled(self.root_resize.isEnabled())
|
||||
|
||||
def __apply_basic_tab__(self):
|
||||
msg = []
|
||||
@ -398,6 +404,14 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
|
||||
except Exception as ex:
|
||||
msg.append(str(ex))
|
||||
|
||||
#max sys storage
|
||||
sys_size = self.root_resize.value()
|
||||
if self.root_img_size != sys_size:
|
||||
try:
|
||||
self.vm.resize_root_img(sys_size*1024*1024)
|
||||
self.anything_changed = True
|
||||
except Exception as ex:
|
||||
msg.append(str(ex))
|
||||
|
||||
return msg
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>694</width>
|
||||
<width>704</width>
|
||||
<height>483</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -183,13 +183,22 @@
|
||||
<string>Disk storage</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Private storage max. size:</string>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="root_resize">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>max_priv_storage</cstring>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string>MB</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>1048576</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>1024</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -201,6 +210,9 @@
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string>MB</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
@ -215,10 +227,23 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>MB</string>
|
||||
<string>Private storage max. size:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>max_priv_storage</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="root_resize_label">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>System storage max. size:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
Reference in New Issue
Block a user