mirror of
https://github.com/fergalmoran/picard.git
synced 2026-02-28 18:43:58 +00:00
Add an context menu entry to select all items in a treeview.
Some people don't know about the CTRL-A shortcut or shift click action to select all items in one of the treeview panes. This commit adds a discoverable context menu entry for those people. Typical use cases are selecting all items to then remove or save all items at once. Fixes PICARD-476.
This commit is contained in:
@@ -232,6 +232,9 @@ class BaseTreeView(QtGui.QTreeWidget):
|
||||
self.expand_all_action.triggered.connect(self.expandAll)
|
||||
self.collapse_all_action = QtGui.QAction(_("&Collapse all"), self)
|
||||
self.collapse_all_action.triggered.connect(self.collapseAll)
|
||||
self.select_all_action = QtGui.QAction(_("Select &all"), self)
|
||||
self.select_all_action.triggered.connect(self.selectAll)
|
||||
self.select_all_action.setShortcut(QtGui.QKeySequence(_(u"Ctrl+A")))
|
||||
self.doubleClicked.connect(self.activate_item)
|
||||
|
||||
def contextMenuEvent(self, event):
|
||||
@@ -383,6 +386,7 @@ class BaseTreeView(QtGui.QTreeWidget):
|
||||
menu.addAction(self.expand_all_action)
|
||||
menu.addAction(self.collapse_all_action)
|
||||
|
||||
menu.addAction(self.select_all_action)
|
||||
menu.exec_(event.globalPos())
|
||||
event.accept()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user