Replaced single check vm updates checkbox
Now there is a checkbox for the default for new VMs, and two buttons to either disable checking for updates in all VMs or enable it in all VMs.
This commit is contained in:
parent
02117b1870
commit
b08ce9524f
@ -212,12 +212,35 @@ class GlobalSettingsWindow(ui_globalsettingsdlg.Ui_GlobalSettings,
|
|||||||
|
|
||||||
self.updates_dom0.setChecked(self.updates_dom0_val)
|
self.updates_dom0.setChecked(self.updates_dom0_val)
|
||||||
|
|
||||||
self.updates_val = False
|
self.updates_vm.setChecked(self.qvm_collection.check_updates_vm)
|
||||||
updates_vms = updates_vms_status(self.qvm_collection)
|
self.enable_updates_all.clicked.connect(self.__enable_updates_all)
|
||||||
if updates_vms is None:
|
self.disable_updates_all.clicked.connect(self.__disable_updates_all)
|
||||||
self.updates_vm.setCheckState(QtCore.Qt.PartiallyChecked)
|
|
||||||
else:
|
def __enable_updates_all(self):
|
||||||
self.updates_vm.setCheckState(updates_vms)
|
reply = QtGui.QMessageBox.question(
|
||||||
|
self, self.tr("Change state of all qubes"),
|
||||||
|
self.tr("Are you sure you want to set all qubes to check "
|
||||||
|
"for updates?"),
|
||||||
|
QtGui.QMessageBox.Yes | QtGui.QMessageBox.Cancel)
|
||||||
|
if reply == QtGui.QMessageBox.Cancel:
|
||||||
|
return
|
||||||
|
|
||||||
|
self.__set_updates_all(True)
|
||||||
|
|
||||||
|
def __disable_updates_all(self):
|
||||||
|
reply = QtGui.QMessageBox.question(
|
||||||
|
self, self.tr("Change state of all qubes"),
|
||||||
|
self.tr("Are you sure you want to set all qubes to not check "
|
||||||
|
"for updates?"),
|
||||||
|
QtGui.QMessageBox.Yes | QtGui.QMessageBox.Cancel)
|
||||||
|
if reply == QtGui.QMessageBox.Cancel:
|
||||||
|
return
|
||||||
|
|
||||||
|
self.__set_updates_all(False)
|
||||||
|
|
||||||
|
def __set_updates_all(self, state):
|
||||||
|
for vm in self.qvm_collection.domains:
|
||||||
|
vm.features['check-updates'] = state
|
||||||
|
|
||||||
def __apply_updates__(self):
|
def __apply_updates__(self):
|
||||||
if self.updates_dom0.isChecked() != self.updates_dom0_val:
|
if self.updates_dom0.isChecked() != self.updates_dom0_val:
|
||||||
@ -231,10 +254,7 @@ class GlobalSettingsWindow(ui_globalsettingsdlg.Ui_GlobalSettings,
|
|||||||
else:
|
else:
|
||||||
open(self.dom0_updates_file_path, 'a').close()
|
open(self.dom0_updates_file_path, 'a').close()
|
||||||
|
|
||||||
if self.updates_vm.checkState() != QtCore.Qt.PartiallyChecked:
|
self.qvm_collection.check_updates_vm = self.updates_vm.isChecked()
|
||||||
for vm in self.qvm_collection.domains:
|
|
||||||
vm.features['check-updates'] = \
|
|
||||||
bool(self.updates_vm.checkState())
|
|
||||||
|
|
||||||
def reject(self):
|
def reject(self):
|
||||||
self.done(0)
|
self.done(0)
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>678</width>
|
<width>651</width>
|
||||||
<height>331</height>
|
<height>386</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -195,6 +195,13 @@
|
|||||||
<string>Updates</string>
|
<string>Updates</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_3">
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QPushButton" name="disable_updates_all">
|
||||||
|
<property name="text">
|
||||||
|
<string>Disable checking for updates for all VMs</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QCheckBox" name="updates_dom0">
|
<widget class="QCheckBox" name="updates_dom0">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -215,6 +222,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QPushButton" name="enable_updates_all">
|
||||||
|
<property name="text">
|
||||||
|
<string>Enable checking for updates for all VMs</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
Reference in New Issue
Block a user