Skip to content

Commit 1a1895e

Browse files
authored
Merge pull request #25023 from CAM-Gerlach/prefs-ui-text-shortcuts
PR: Clarify and polish UI text for keyboard shortcuts pref pane
2 parents 6fe635e + 0830ece commit 1a1895e

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

spyder/plugins/shortcuts/confpage.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,10 @@ def setup_page(self):
3030
reset_btn = self.create_button(
3131
icon=ima.icon("restart"),
3232
callback=self.reset_to_default,
33-
tooltip=_("Reset to default values"),
33+
tooltip=_("Reset all shortcuts to default values"),
3434
)
3535
top_label = QLabel(
36-
_(
37-
"Here you can browse the list of all available shortcuts in "
38-
"Spyder. You can also customize them by double-clicking on "
39-
"any entry in this table."
40-
)
36+
_("Customize a shortcut by double-clicking on its entry below.")
4137
)
4238

4339
# Widget setup
@@ -71,11 +67,11 @@ def check_settings(self):
7167
self.table.check_shortcuts()
7268

7369
def reset_to_default(self, force=False):
74-
"""Reset to default values of the shortcuts making a confirmation."""
70+
"""Reset all shortcuts to default values after confirmation."""
7571
if not force:
7672
reset = QMessageBox.warning(
7773
self,
78-
_("Shortcuts reset"),
74+
_("Reset all shortcuts"),
7975
_(
8076
"Do you want to reset all shortcuts to their default "
8177
"values?"

spyder/plugins/shortcuts/widgets/table.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,12 @@ def setup(self):
180180
# Widgets
181181
self.label_info = QLabel()
182182
self.label_info.setText(
183-
_("Press the new shortcut and select <b>Ok</b> to confirm, "
184-
"click <b>Cancel</b> to revert to the previous state, "
185-
"or use <b>Clear</b> to unbind the command from a shortcut.")
183+
_(
184+
"Press the new shortcut and select <b>Ok</b> to confirm, "
185+
"click <b>Cancel</b> to revert to the previous state, "
186+
"use <b>Clear</b> to unbind the command from a shortcut "
187+
"or press <b>Default</b> to restore the default shortcut."
188+
)
186189
)
187190
self.label_info.setAlignment(Qt.AlignTop | Qt.AlignLeft)
188191
self.label_info.setWordWrap(True)
@@ -205,15 +208,15 @@ def setup(self):
205208
self.label_warning.setAlignment(Qt.AlignTop | Qt.AlignLeft)
206209

207210
self.button_default = QPushButton(_('Default'))
211+
self.button_clear = QPushButton(_('Clear'))
208212
self.button_ok = QPushButton(_('Ok'))
209213
self.button_ok.setEnabled(False)
210-
self.button_clear = QPushButton(_('Clear'))
211214
self.button_cancel = QPushButton(_('Cancel'))
212215
button_box = QHBoxLayout()
213216
button_box.addWidget(self.button_default)
217+
button_box.addWidget(self.button_clear)
214218
button_box.addStretch(100)
215219
button_box.addWidget(self.button_ok)
216-
button_box.addWidget(self.button_clear)
217220
button_box.addWidget(self.button_cancel)
218221

219222
# New Sequence button box
@@ -399,9 +402,13 @@ def update_warning(self):
399402
tip_body += ' - {0}: <b>{1}</b><br>'.format(s.context, s.name)
400403
tip_body += '<br>'
401404
if len(conflicts) == 1:
402-
tip_override = _("Press 'Ok' to unbind it and assign it to")
405+
tip_override = _(
406+
"Press 'Ok' to unbind it and assign the shortcut to"
407+
)
403408
else:
404-
tip_override = _("Press 'Ok' to unbind them and assign it to")
409+
tip_override = _(
410+
"Press 'Ok' to unbind them and assign the shortcut to"
411+
)
405412
tip_override += ' <b>{}</b>.'.format(self.name)
406413
tip = template.format(tip_title, tip_body, tip_override)
407414
icon = ima.icon('warning')

0 commit comments

Comments
 (0)