From ecfc88d4c193e8a1ada38c826a3fd2813a78823b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marta=20Marczykowska-G=C3=B3recka?= Date: Tue, 19 Feb 2019 22:15:03 +0100 Subject: [PATCH 1/2] Added warning when setting NetVM When NetVM is set to something else than default_dispvm has set, a warning icon appears. (cherry picked from commit faae2d00264bba156e5dad5c23fa4da23577060f) --- qubesmanager/settings.py | 26 ++++++++++++++++++++++++++ ui/settingsdlg.ui | 15 ++++++++++++++- 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/qubesmanager/settings.py b/qubesmanager/settings.py index 405fb7a..197a690 100755 --- a/qubesmanager/settings.py +++ b/qubesmanager/settings.py @@ -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 = self.vm.features.get('os', None) == 'Windows' and \ diff --git a/ui/settingsdlg.ui b/ui/settingsdlg.ui index 833d31e..e0c0c48 100644 --- a/ui/settingsdlg.ui +++ b/ui/settingsdlg.ui @@ -29,7 +29,7 @@ - 1 + 0 @@ -379,6 +379,19 @@ + + + + <html><head/><body><p>Caution: default DispVM template has a different Networking setting than this qube. Unexpected network access may occur!</p></body></html> + + + + + + :/warning.png + + + From cd46ea5bdf6da6b3ee703f5df83d19c72f984ae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Tue, 19 Feb 2019 22:33:14 +0100 Subject: [PATCH 2/2] version 4.0.28 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index f5cd8d2..07ff330 100644 --- a/version +++ b/version @@ -1 +1 @@ -4.0.27 +4.0.28