Skip to content

Commit

Permalink
Open activity now opens all selected rows, fixes #338 (#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgdekoning authored Dec 6, 2019
1 parent d0162df commit 104656e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions activity_browser/app/ui/tables/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,7 @@ def contextMenuEvent(self, event) -> None:
""" Construct and present a menu.
"""
menu = QtWidgets.QMenu()
menu.addAction(
qicons.right, "Open activity",
lambda: self.open_activity_tab(self.currentIndex())
)
menu.addAction(qicons.right, "Open activity", self.open_activity_tabs)
menu.addAction(
qicons.graph_explorer, "Open in Graph Explorer",
lambda: signals.open_activity_graph_tab.emit(self.get_key(self.currentIndex()))
Expand Down Expand Up @@ -205,12 +202,18 @@ def get_key(self, proxy: QtCore.QModelIndex) -> tuple:
key = self.model.index(index.row(), self.fields.index("key")).data()
return literal_eval(key)

@Slot(QtCore.QModelIndex)
@Slot(QtCore.QModelIndex, name="openActivityTab")
def open_activity_tab(self, proxy: QtCore.QModelIndex) -> None:
key = self.get_key(proxy)
signals.open_activity_tab.emit(key)
signals.add_activity_to_history.emit(key)

@Slot(name="openActivityTabs")
def open_activity_tabs(self) -> None:
for key in (self.get_key(p) for p in self.selectedIndexes()):
signals.open_activity_tab.emit(key)
signals.add_activity_to_history.emit(key)

@Slot(str)
def check_database_changed(self, db_name: str) -> None:
""" Determine if we need to re-sync (did 'our' db change?).
Expand Down

0 comments on commit 104656e

Please sign in to comment.