Added warning when setting NetVM
When NetVM is set to something else than default_dispvm has set, a warning icon appears.
This commit is contained in:
parent
52188318b8
commit
faae2d0026
@ -414,6 +414,8 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtGui.QDialog):
|
||||
(lambda vm: vm.provides_network),
|
||||
allow_default=True, allow_none=True)
|
||||
|
||||
self.netVM.currentIndexChanged.connect(self.check_warn_dispvmnetvm)
|
||||
|
||||
self.include_in_backups.setChecked(self.vm.include_in_backups)
|
||||
|
||||
try:
|
||||
@ -547,6 +549,27 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtGui.QDialog):
|
||||
"allowed value."))
|
||||
self.init_mem.setValue(self.max_mem_size.value() / 10)
|
||||
|
||||
def check_warn_dispvmnetvm(self):
|
||||
if not hasattr(self.vm, 'default_dispvm'):
|
||||
self.warn_netvm_dispvm.setVisible(False)
|
||||
return
|
||||
dispvm = self.default_dispvm_list[
|
||||
self.default_dispvm.currentIndex()]
|
||||
own_netvm = self.netvm_list[self.netVM.currentIndex()]
|
||||
|
||||
if dispvm == qubesadmin.DEFAULT:
|
||||
dispvm = self.vm.property_get_default('default_dispvm')
|
||||
dispvm_netvm = getattr(dispvm, 'netvm', None)
|
||||
|
||||
if own_netvm == qubesadmin.DEFAULT:
|
||||
own_netvm = self.vm.property_get_default('netvm')
|
||||
|
||||
if dispvm_netvm and dispvm_netvm != own_netvm:
|
||||
self.warn_netvm_dispvm.setVisible(True)
|
||||
else:
|
||||
self.warn_netvm_dispvm.setVisible(False)
|
||||
|
||||
|
||||
def rename_vm(self):
|
||||
|
||||
dependencies = admin_utils.vm_dependencies(self.vm.app, self.vm)
|
||||
@ -691,7 +714,10 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtGui.QDialog):
|
||||
None,
|
||||
(lambda vm: getattr(vm, 'template_for_dispvms', False)),
|
||||
allow_default=True, allow_none=True)
|
||||
self.default_dispvm.currentIndexChanged.connect(
|
||||
self.check_warn_dispvmnetvm)
|
||||
|
||||
self.check_warn_dispvmnetvm()
|
||||
self.update_virt_mode_list()
|
||||
|
||||
windows_running = \
|
||||
|
@ -29,7 +29,7 @@
|
||||
<locale language="English" country="UnitedStates"/>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="basic_tab">
|
||||
<property name="locale">
|
||||
@ -379,6 +379,19 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QLabel" name="warn_netvm_dispvm">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Caution: default DispVM template has a different Networking setting than this qube. Unexpected network access may occur!</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../resources.qrc">:/warning.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
Reference in New Issue
Block a user