Skip to content

Commit

Permalink
Restored context menu
Browse files Browse the repository at this point in the history
  • Loading branch information
donob4n committed Mar 22, 2020
1 parent f43394a commit 19be1da
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions qubesmanager/qube_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,14 +611,6 @@ def __init__(self, qt_app, qubes_app, dispatcher, parent=None):
self.tools_context_menu.addAction(self.action_toolbar)
self.tools_context_menu.addAction(self.action_menubar)

self.dom0_context_menu = QtWidgets.QMenu(self)
self.dom0_context_menu.addAction(self.action_global_settings)
self.dom0_context_menu.addAction(self.action_updatevm)
self.dom0_context_menu.addSeparator()

self.dom0_context_menu.addMenu(self.logs_menu)
self.dom0_context_menu.addSeparator()

#self.connect(
# self.table.horizontalHeader(),
# QtCore.SIGNAL("sortIndicatorChanged(int, Qt::SortOrder)"),
Expand Down Expand Up @@ -672,6 +664,8 @@ def __init__(self, qt_app, qubes_app, dispatcher, parent=None):
self.table.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
self.table.selectionModel().selectionChanged.connect(self.table_selection_changed)

self.table.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
self.table.customContextMenuRequested.connect(self.open_context_menu)

# Connect events
self.dispatcher = dispatcher
Expand Down Expand Up @@ -1456,17 +1450,8 @@ def update_logs_menu(self):

@QtCore.pyqtSlot('const QPoint&')
def open_context_menu(self, point):
for index in self.table.selectionModel().selectedIndexes():
if index.column() != 0:
continue
vm = self.qubes_model.info_list[index.row()].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)))
self.context_menu.exec_(self.table.mapToGlobal(
point + QtCore.QPoint(10, 0)))

@QtCore.pyqtSlot('QAction *')
def show_log(self, action):
Expand Down

0 comments on commit 19be1da

Please sign in to comment.