Skip to content

Commit f37747a

Browse files
committed
Keyboard shortcuts update
1 parent 3785f0a commit f37747a

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

gui/mainwindow.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,10 +1849,9 @@ def setupShortcuts(self):
18491849
settings_shortcut.activated.connect(self.showSettingsDialog)
18501850
self.shortcuts_list.append(settings_shortcut)
18511851

1852-
# Standard shortcut for opening a file
1853-
open_file_shortcut = QShortcut(QKeySequence(QKeySequence.StandardKey.Open), self)
1854-
open_file_shortcut.activated.connect(self.openFile)
1855-
self.shortcuts_list.append(open_file_shortcut)
1852+
save_file_shortcut = QShortcut(QKeySequence(QKeySequence.StandardKey.Save), self)
1853+
save_file_shortcut.activated.connect(self.saveFile)
1854+
self.shortcuts_list.append(save_file_shortcut)
18561855

18571856
export_shortcut_str = self.config_manager.get_export_shortcut()
18581857
if export_shortcut_str:

gui/welcome.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from PySide6.QtWidgets import QDialog, QVBoxLayout, QLabel, QPushButton, QWidget, QGraphicsOpacityEffect, QMessageBox
22
from PySide6.QtGui import QIcon, QPixmap, QFont
33
from PySide6.QtCore import Qt, QSize, QPropertyAnimation, QSequentialAnimationGroup, QEasingCurve, QParallelAnimationGroup
4+
from PySide6.QtGui import QShortcut, QKeySequence
45
from .config_manager import ConfigManager
56
import os, sys, shutil
67

@@ -70,6 +71,13 @@ def __init__(self, parent=None):
7071
self.btn_open.clicked.connect(self.on_open)
7172
self.result = None
7273

74+
# keyboard shortcuts only on welcome screen
75+
new_shortcut = QShortcut(QKeySequence(QKeySequence.StandardKey.New), self)
76+
new_shortcut.activated.connect(self.on_new)
77+
78+
open_shortcut = QShortcut(QKeySequence(QKeySequence.StandardKey.Open), self)
79+
open_shortcut.activated.connect(self.on_open)
80+
7381
self.setup_animations()
7482

7583
def logo_clicked(self, event):

0 commit comments

Comments
 (0)