From 4298de656446da37aa822dadbff5fa53d1eaf4bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marta=20Marczykowska-G=C3=B3recka?= Date: Wed, 11 Dec 2019 23:22:32 +0100 Subject: [PATCH] Moved debug mode checkbox to advanced settings It really had no place in Basic settings, and will free up space for future settings. --- qubesmanager/settings.py | 32 ++++++++++++++++---------------- ui/settingsdlg.ui | 29 ++++++++++++++--------------- 2 files changed, 30 insertions(+), 31 deletions(-) diff --git a/qubesmanager/settings.py b/qubesmanager/settings.py index 56a6fef..a1221f2 100644 --- a/qubesmanager/settings.py +++ b/qubesmanager/settings.py @@ -395,12 +395,6 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtWidgets.QDialog): self.include_in_backups.setChecked(self.vm.include_in_backups) - try: - self.run_in_debug_mode.setChecked(self.vm.debug) - self.run_in_debug_mode.setVisible(True) - except AttributeError: - self.run_in_debug_mode.setVisible(False) - try: self.autostart_vm.setChecked(self.vm.autostart) self.autostart_vm.setVisible(True) @@ -477,14 +471,6 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtWidgets.QDialog): except qubesadmin.exc.QubesException as ex: msg.append(str(ex)) - # run_in_debug_mode - try: - if self.run_in_debug_mode.isVisible(): - if self.vm.debug != self.run_in_debug_mode.isChecked(): - self.vm.debug = self.run_in_debug_mode.isChecked() - except qubesadmin.exc.QubesException as ex: - msg.append(str(ex)) - # autostart_vm try: if self.autostart_vm.isVisible(): @@ -732,6 +718,12 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtWidgets.QDialog): "NetVM by the following qubes:\n") + "\n".join(domains_using)) + try: + self.run_in_debug_mode.setChecked(self.vm.debug) + self.run_in_debug_mode.setVisible(True) + except AttributeError: + self.run_in_debug_mode.setVisible(False) + def enable_seamless(self): self.vm.run_service_for_stdio("qubes.SetGuiMode", input=b'SEAMLESS') @@ -810,6 +802,14 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtWidgets.QDialog): except Exception as ex: # pylint: disable=broad-except msg.append(str(ex)) + # run_in_debug_mode + try: + if self.run_in_debug_mode.isVisible(): + if self.vm.debug != self.run_in_debug_mode.isChecked(): + self.vm.debug = self.run_in_debug_mode.isChecked() + except qubesadmin.exc.QubesException as ex: + msg.append(str(ex)) + return msg def include_in_balancing_changed(self, state): @@ -1074,12 +1074,12 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtWidgets.QDialog): self.service_line_edit.addItem("") - supported_services = [] + supported_services = set() service_prefix = "supported-service." for feature in self.vm.features: if feature.startswith(service_prefix): - supported_services.append(feature[len(service_prefix):]) + supported_services.add(feature[len(service_prefix):]) if getattr(self.vm, "template", None): for feature in self.vm.template.features: if feature.startswith(service_prefix): diff --git a/ui/settingsdlg.ui b/ui/settingsdlg.ui index 96e51c6..3bb901a 100644 --- a/ui/settingsdlg.ui +++ b/ui/settingsdlg.ui @@ -29,7 +29,7 @@ - 5 + 1 @@ -373,13 +373,6 @@ - - - - Run in debug mode - - - @@ -813,14 +806,14 @@ border-width: 1px; 15 - + Provides network - + <html><head/><body><p>Allows using this qube as a template for DisposableVMs. The DisposableVMs will inherit the VM's state (configuration, installed programs etc.), but their state will not persist between restarts. </p><p>Setting this option will cause this qube to be listed as an option in the &quot;Default DisposableVM Template&quot; dropdown for all other qubes. </p></body></html> @@ -830,14 +823,14 @@ border-width: 1px; - + Boot qube from CDROM - + @@ -863,7 +856,7 @@ The qube must be running to disable seamless mode; this setting is not persisten - + @@ -893,6 +886,13 @@ The qube must be running to disable seamless mode; this setting is not persisten + + + + Run in debug mode + + + @@ -1322,7 +1322,7 @@ The qube must be running to disable seamless mode; this setting is not persisten This qube has direct network access and Qubes Firewall settings will not be used. Configure other qubes' network access in their network settings or in a dedicated firewall qube. - true + true @@ -1564,7 +1564,6 @@ The qube must be running to disable seamless mode; this setting is not persisten template_name netVM include_in_backups - run_in_debug_mode autostart_vm max_priv_storage root_resize