From cb70b9bd65be53bc242fec1924976f2e9a882b76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marta=20Marczykowska-G=C3=B3recka?= Date: Tue, 30 Apr 2019 16:35:54 +0200 Subject: [PATCH] Fixed logs display in Qube Manager Logs menu was not updated correctly on all occassions. --- qubesmanager/qube_manager.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/qubesmanager/qube_manager.py b/qubesmanager/qube_manager.py index 2d15838..015bac8 100644 --- a/qubesmanager/qube_manager.py +++ b/qubesmanager/qube_manager.py @@ -767,6 +767,8 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QtGui.QMainWindow): self.action_run_command_in_vm.setEnabled(False) self.action_set_keyboard_layout.setEnabled(False) + self.update_logs_menu() + # noinspection PyArgumentList @QtCore.pyqtSlot(name='on_action_createvm_triggered') def action_createvm_triggered(self): # pylint: disable=no-self-use @@ -1233,8 +1235,7 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QtGui.QMainWindow): def open_tools_context_menu(self, widget, point): self.tools_context_menu.exec_(widget.mapToGlobal(point)) - @QtCore.pyqtSlot('const QPoint&') - def open_context_menu(self, point): + def update_logs_menu(self): try: vm = self.get_selected_vm() @@ -1260,15 +1261,21 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QtGui.QMainWindow): menu_empty = False self.logs_menu.setEnabled(not menu_empty) - if vm.qid == 0: - self.dom0_context_menu.exec_(self.table.mapToGlobal( - point + QtCore.QPoint(10, 0))) - else: - self.context_menu.exec_(self.table.mapToGlobal( - point + QtCore.QPoint(10, 0))) + except exc.QubesPropertyAccessError: pass + @QtCore.pyqtSlot('const QPoint&') + def open_context_menu(self, point): + vm = self.get_selected_vm() + + if vm.qid == 0: + self.dom0_context_menu.exec_(self.table.mapToGlobal( + point + QtCore.QPoint(10, 0))) + else: + self.context_menu.exec_(self.table.mapToGlobal( + point + QtCore.QPoint(10, 0))) + @QtCore.pyqtSlot('QAction *') def show_log(self, action): log = str(action.data())