Skip to content

Commit

Permalink
Fixed logs display in Qube Manager
Browse files Browse the repository at this point in the history
Logs menu was not updated correctly on all occassions.
  • Loading branch information
marmarta committed May 3, 2019
1 parent f5586e7 commit cb70b9b
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions qubesmanager/qube_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,8 @@ def table_selection_changed(self):
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
Expand Down Expand Up @@ -1233,8 +1235,7 @@ def createPopupMenu(self): # pylint: disable=invalid-name
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()

Expand All @@ -1260,15 +1261,21 @@ def open_context_menu(self, point):
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())
Expand Down

0 comments on commit cb70b9b

Please sign in to comment.