Fix incorrect Settings invocation in Qube Manager

fixes QubesOS/qubes-issues#5963
This commit is contained in:
Marta Marczykowska-Górecka 2020-06-30 14:44:20 +02:00
parent 37271db3d8
commit 29ce349be0
No known key found for this signature in database
GPG Key ID: 9A752C30B26FD04B
2 changed files with 9 additions and 5 deletions

View File

@ -1046,7 +1046,8 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QtWidgets.QMainWindow):
try:
with common_threads.busy_cursor():
settings_window = settings.VMSettingsWindow(
vm, self.qt_app, tab)
vm, init_page=tab, qapp=self.qt_app,
qubesapp=self.qubes_app)
settings_window.exec_()
except exc.QubesException as ex:
QtWidgets.QMessageBox.warning(

View File

@ -274,7 +274,7 @@ class QubeManagerTest(unittest.TestCase):
QtTest.QTest.mouseClick(widget,
QtCore.Qt.LeftButton)
mock_window.assert_called_once_with(
selected_vm, self.qtapp, "basic")
selected_vm, qapp=self.qtapp, init_page="basic", qubesapp=self.qapp)
def test_201_vm_open_settings_admin(self):
self._select_admin_vm()
@ -295,7 +295,8 @@ class QubeManagerTest(unittest.TestCase):
QtTest.QTest.mouseClick(widget,
QtCore.Qt.LeftButton)
mock_window.assert_called_once_with(
selected_vm, self.qtapp, "firewall")
selected_vm, qapp=self.qtapp, init_page="firewall",
qubesapp=self.qapp)
@unittest.mock.patch('qubesmanager.settings.VMSettingsWindow')
def test_203_vm_open_apps(self, mock_window):
@ -306,7 +307,8 @@ class QubeManagerTest(unittest.TestCase):
QtTest.QTest.mouseClick(widget,
QtCore.Qt.LeftButton)
mock_window.assert_called_once_with(
selected_vm, self.qtapp, "applications")
selected_vm, qapp=self.qtapp, init_page="applications",
qubesapp=self.qapp)
def test_204_vm_keyboard(self):
selected_vm = self._select_non_admin_vm(running=True)
@ -799,7 +801,8 @@ class QubeManagerTest(unittest.TestCase):
as mock_settings:
self.dialog.action_settings.trigger()
mock_settings.assert_called_once_with(
self.qapp.domains["test-vm"], self.qtapp, "basic")
self.qapp.domains["test-vm"], qapp = self.qtapp,
init_page = "basic", qubesapp = self.qapp)
def test_401_event_domain_removed(self):
initial_vms = self._create_set_of_current_vms()