changing key shortcuts for tab navigation
This commit is contained in:
parent
c0a37c4b45
commit
4c3265242d
21
frontend.py
21
frontend.py
@ -64,7 +64,6 @@ class AnimeDialog(QDialog):
|
|||||||
self.name_edit.setText(html.unescape(entry[1]))
|
self.name_edit.setText(html.unescape(entry[1]))
|
||||||
self.year_spin.setValue(entry[2])
|
self.year_spin.setValue(entry[2])
|
||||||
self.season_combo.setCurrentText((entry[3] or "Other").capitalize())
|
self.season_combo.setCurrentText((entry[3] or "Other").capitalize())
|
||||||
print("entry[3] = " + entry[3])
|
|
||||||
self.status_combo.setCurrentText(entry[4])
|
self.status_combo.setCurrentText(entry[4])
|
||||||
self.type_combo.setCurrentText(entry[5] or '')
|
self.type_combo.setCurrentText(entry[5] or '')
|
||||||
self.comment_edit.setPlainText(html.unescape(entry[6] or ''))
|
self.comment_edit.setPlainText(html.unescape(entry[6] or ''))
|
||||||
@ -111,8 +110,8 @@ class ShortcutsDialog(QDialog):
|
|||||||
shortcuts_text.setPlainText("""
|
shortcuts_text.setPlainText("""
|
||||||
Global Shortcuts:
|
Global Shortcuts:
|
||||||
- A: Add an anime
|
- A: Add an anime
|
||||||
- Page Down: Next tab
|
- Ctrl + Page Down: Next tab
|
||||||
- Page Up: Previous tab
|
- Ctrl + Page Up: Previous tab
|
||||||
- Ctrl + Q: Quit the program
|
- Ctrl + Q: Quit the program
|
||||||
- R: Pick random anime
|
- R: Pick random anime
|
||||||
- Ctrl + + : Increase table scale
|
- Ctrl + + : Increase table scale
|
||||||
@ -820,14 +819,6 @@ class AnimeTracker(QMainWindow):
|
|||||||
if modifiers == Qt.NoModifier:
|
if modifiers == Qt.NoModifier:
|
||||||
if key == Qt.Key_A:
|
if key == Qt.Key_A:
|
||||||
self.add_anime()
|
self.add_anime()
|
||||||
elif key == Qt.Key_PageDown:
|
|
||||||
current = self.tab_widget.currentIndex()
|
|
||||||
if current < self.tab_widget.count() - 1:
|
|
||||||
self.tab_widget.setCurrentIndex(current + 1)
|
|
||||||
elif key == Qt.Key_PageUp:
|
|
||||||
current = self.tab_widget.currentIndex()
|
|
||||||
if current > 0:
|
|
||||||
self.tab_widget.setCurrentIndex(current - 1)
|
|
||||||
elif key == Qt.Key_R:
|
elif key == Qt.Key_R:
|
||||||
self.random_pick()
|
self.random_pick()
|
||||||
elif key == Qt.Key_Q:
|
elif key == Qt.Key_Q:
|
||||||
@ -846,6 +837,14 @@ class AnimeTracker(QMainWindow):
|
|||||||
self.set_current_tab_by_identifier(current_id)
|
self.set_current_tab_by_identifier(current_id)
|
||||||
elif key == Qt.Key_Q:
|
elif key == Qt.Key_Q:
|
||||||
self.close()
|
self.close()
|
||||||
|
elif key == Qt.Key_PageDown:
|
||||||
|
current = self.tab_widget.currentIndex()
|
||||||
|
if current < self.tab_widget.count() - 1:
|
||||||
|
self.tab_widget.setCurrentIndex(current + 1)
|
||||||
|
elif key == Qt.Key_PageUp:
|
||||||
|
current = self.tab_widget.currentIndex()
|
||||||
|
if current > 0:
|
||||||
|
self.tab_widget.setCurrentIndex(current - 1)
|
||||||
|
|
||||||
super().keyPressEvent(event)
|
super().keyPressEvent(event)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user