Merge remote-tracking branch 'origin/pr/241'

* origin/pr/241:
  Fixed max volume size in VM settings
This commit is contained in:
Marek Marczykowski-Górecki 2020-06-28 05:23:40 +02:00
commit a6a7560bab
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -449,10 +449,18 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtWidgets.QDialog):
self.priv_img_size = self.vm.volumes['private'].size // 1024**2
self.max_priv_storage.setMinimum(self.priv_img_size)
self.max_priv_storage.setValue(self.priv_img_size)
self.max_priv_storage.setMaximum(
max(self.priv_img_size,
self.qubesapp.pools[self.vm.volumes['private'].pool].size
// 1024**2))
self.root_img_size = self.vm.volumes['root'].size // 1024**2
self.root_resize.setValue(self.root_img_size)
self.root_resize.setMinimum(self.root_img_size)
self.root_resize.setMaximum(
max(self.root_img_size,
self.qubesapp.pools[self.vm.volumes['root'].pool].size
// 1024**2))
self.root_resize.setEnabled(self.vm.volumes['root'].save_on_stop)
if not self.root_resize.isEnabled():
self.root_resize.setToolTip(