-
-
Notifications
You must be signed in to change notification settings - Fork 400
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
PICARD-1220: Add keyboard shortcut to delete scripts. #875
Conversation
previous discussion can be found on #874 |
picard/ui/options/scripting.py
Outdated
@@ -232,6 +232,14 @@ def __init__(self, parent=None): | |||
self.last_selected_script_pos = 0 | |||
self.ui.splitter.setStretchFactor(0, 1) | |||
self.ui.splitter.setStretchFactor(1, 2) | |||
self.shortcut = QtWidgets.QShortcut(self.ui.script_list) | |||
self.shortcut.setKey(QtGui.QKeySequence.Delete) | |||
self.shortcut.activated.connect(self.script_remove_processor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename this to self.delete_selected_script
picard/ui/options/scripting.py
Outdated
@@ -232,6 +232,14 @@ def __init__(self, parent=None): | |||
self.last_selected_script_pos = 0 | |||
self.ui.splitter.setStretchFactor(0, 1) | |||
self.ui.splitter.setStretchFactor(1, 2) | |||
self.delete_selected_script = QtWidgets.QShortcut(self.ui.script_list) | |||
self.delete_selected_script.setKey(QtGui.QKeySequence.Delete) | |||
self.delete_selected_script.activated.connect(self.script_remove_processor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vishichoudhary I meant the connected function. The shortcut variable itself could be self.delete_shortcut
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't say this but. naming the variables to seem most difficult task for me. :-( 😅
Add keyboard shortcut to delete scripts Add keyboard shortcut to delete scripts
Summary
Problem
Solution
In options > Scripting. On pressing delete key, the script will be removed.
Action