Skip to content

feat: add select all hotkey #217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions tagstudio/src/qt/ts_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,19 @@ def start(self) -> None:

edit_menu.addSeparator()

select_all_action = QAction("Select All", menu_bar)
select_all_action.triggered.connect(self.select_all_action_callback)
select_all_action.setShortcut(
QtCore.QKeyCombination(
QtCore.Qt.KeyboardModifier(QtCore.Qt.KeyboardModifier.ControlModifier),
QtCore.Qt.Key.Key_A,
)
)
select_all_action.setToolTip("Ctrl+A")
edit_menu.addAction(select_all_action)

edit_menu.addSeparator()

manage_file_extensions_action = QAction("Ignored File Extensions", menu_bar)
manage_file_extensions_action.triggered.connect(
lambda: self.show_file_extension_modal()
Expand Down Expand Up @@ -692,6 +705,15 @@ def add_tag_action_callback(self):
# panel.tag_updated.connect(lambda tag: self.lib.update_tag(tag))
self.modal.show()

def select_all_action_callback(self):
for item in self.item_thumbs:
if item.mode and (item.mode, item.item_id) not in self.selected:
self.selected.append((item.mode, item.item_id))
item.thumb_button.set_selected(True)

self.set_macro_menu_viability()
self.preview_panel.update_widgets()

def show_tag_database(self):
self.modal = PanelModal(
TagDatabasePanel(self.lib), "Library Tags", "Library Tags", has_save=False
Expand Down