Skip to content

Commit 72df890

Browse files
committed
Clean up python console toolbars/menus:
- Consistent capitalization - Add missing ellipsis - Rename "settings" to "options" for consistency with main window - Remove some excessive use of separators
1 parent 8abeb8d commit 72df890

File tree

3 files changed

+19
-24
lines changed

3 files changed

+19
-24
lines changed

python/console/console.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def __init__(self, parent=None):
167167
##------------------Toolbar Editor-------------------------------------
168168

169169
## Action for Open File
170-
openFileBt = QCoreApplication.translate("PythonConsole", "Open file")
170+
openFileBt = QCoreApplication.translate("PythonConsole", "Open Script...")
171171
self.openFileButton = QAction(self)
172172
self.openFileButton.setCheckable(False)
173173
self.openFileButton.setEnabled(True)
@@ -177,7 +177,7 @@ def __init__(self, parent=None):
177177
self.openFileButton.setToolTip(openFileBt)
178178
self.openFileButton.setText(openFileBt)
179179

180-
openExtEditorBt = QCoreApplication.translate("PythonConsole", "Open in external editor")
180+
openExtEditorBt = QCoreApplication.translate("PythonConsole", "Open in External Editor")
181181
self.openInEditorButton = QAction(self)
182182
self.openInEditorButton.setCheckable(False)
183183
self.openInEditorButton.setEnabled(True)
@@ -267,7 +267,7 @@ def __init__(self, parent=None):
267267
self.uncommentEditorButton.setToolTip(uncommentEditorBt)
268268
self.uncommentEditorButton.setText(uncommentEditorBt)
269269
## Action for Object browser
270-
objList = QCoreApplication.translate("PythonConsole", "Object Inspector")
270+
objList = QCoreApplication.translate("PythonConsole", "Object Inspector...")
271271
self.objectListButton = QAction(self)
272272
self.objectListButton.setCheckable(True)
273273
self.objectListButton.setEnabled(self.settings.value("pythonConsole/enableObjectInsp",
@@ -291,7 +291,7 @@ def __init__(self, parent=None):
291291
##----------------Toolbar Console-------------------------------------
292292

293293
## Action Show Editor
294-
showEditor = QCoreApplication.translate("PythonConsole", "Show editor")
294+
showEditor = QCoreApplication.translate("PythonConsole", "Show Editor")
295295
self.showEditorButton = QAction(self)
296296
self.showEditorButton.setEnabled(True)
297297
self.showEditorButton.setCheckable(True)
@@ -301,7 +301,7 @@ def __init__(self, parent=None):
301301
self.showEditorButton.setToolTip(showEditor)
302302
self.showEditorButton.setText(showEditor)
303303
## Action for Clear button
304-
clearBt = QCoreApplication.translate("PythonConsole", "Clear console")
304+
clearBt = QCoreApplication.translate("PythonConsole", "Clear Console")
305305
self.clearButton = QAction(self)
306306
self.clearButton.setCheckable(False)
307307
self.clearButton.setEnabled(True)
@@ -311,7 +311,7 @@ def __init__(self, parent=None):
311311
self.clearButton.setToolTip(clearBt)
312312
self.clearButton.setText(clearBt)
313313
## Action for settings
314-
optionsBt = QCoreApplication.translate("PythonConsole", "Settings")
314+
optionsBt = QCoreApplication.translate("PythonConsole", "Options...")
315315
self.optionsButton = QAction(self)
316316
self.optionsButton.setCheckable(False)
317317
self.optionsButton.setEnabled(True)
@@ -331,7 +331,7 @@ def __init__(self, parent=None):
331331
self.actionClass.setToolTip(actionClassBt)
332332
self.actionClass.setText(actionClassBt)
333333
## Import Processing class
334-
loadProcessingBt = QCoreApplication.translate("PythonConsole", "Import Processing class")
334+
loadProcessingBt = QCoreApplication.translate("PythonConsole", "Import Processing Class")
335335
self.loadProcessingButton = QAction(self)
336336
self.loadProcessingButton.setCheckable(False)
337337
self.loadProcessingButton.setEnabled(True)
@@ -341,7 +341,7 @@ def __init__(self, parent=None):
341341
self.loadProcessingButton.setToolTip(loadProcessingBt)
342342
self.loadProcessingButton.setText(loadProcessingBt)
343343
## Import QtCore class
344-
loadQtCoreBt = QCoreApplication.translate("PythonConsole", "Import PyQt.QtCore class")
344+
loadQtCoreBt = QCoreApplication.translate("PythonConsole", "Import PyQt.QtCore Class")
345345
self.loadQtCoreButton = QAction(self)
346346
self.loadQtCoreButton.setCheckable(False)
347347
self.loadQtCoreButton.setEnabled(True)
@@ -351,7 +351,7 @@ def __init__(self, parent=None):
351351
self.loadQtCoreButton.setToolTip(loadQtCoreBt)
352352
self.loadQtCoreButton.setText(loadQtCoreBt)
353353
## Import QtGui class
354-
loadQtGuiBt = QCoreApplication.translate("PythonConsole", "Import PyQt.QtGui class")
354+
loadQtGuiBt = QCoreApplication.translate("PythonConsole", "Import PyQt.QtGui Class")
355355
self.loadQtGuiButton = QAction(self)
356356
self.loadQtGuiButton.setCheckable(False)
357357
self.loadQtGuiButton.setEnabled(True)
@@ -361,7 +361,7 @@ def __init__(self, parent=None):
361361
self.loadQtGuiButton.setToolTip(loadQtGuiBt)
362362
self.loadQtGuiButton.setText(loadQtGuiBt)
363363
## Action for Run script
364-
runBt = QCoreApplication.translate("PythonConsole", "Run command")
364+
runBt = QCoreApplication.translate("PythonConsole", "Run Command")
365365
self.runButton = QAction(self)
366366
self.runButton.setCheckable(False)
367367
self.runButton.setEnabled(True)
@@ -371,7 +371,7 @@ def __init__(self, parent=None):
371371
self.runButton.setToolTip(runBt)
372372
self.runButton.setText(runBt)
373373
## Help action
374-
helpBt = QCoreApplication.translate("PythonConsole", "Help")
374+
helpBt = QCoreApplication.translate("PythonConsole", "Help...")
375375
self.helpButton = QAction(self)
376376
self.helpButton.setCheckable(False)
377377
self.helpButton.setEnabled(True)

python/console/console_editor.py

+6-10
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,8 @@ def contextMenuEvent(self, e):
307307
syntaxCheck = menu.addAction(iconSyntaxCk,
308308
QCoreApplication.translate("PythonConsole", "Check Syntax"),
309309
self.syntaxCheck, 'Ctrl+4')
310-
menu.addSeparator()
311310
runSelected = menu.addAction(iconRun,
312-
QCoreApplication.translate("PythonConsole", "Run selected"),
311+
QCoreApplication.translate("PythonConsole", "Run Selected"),
313312
self.runSelectedCode, 'Ctrl+E')
314313
menu.addAction(iconRunScript,
315314
QCoreApplication.translate("PythonConsole", "Run Script"),
@@ -325,7 +324,6 @@ def contextMenuEvent(self, e):
325324
menu.addAction(iconFind,
326325
QCoreApplication.translate("PythonConsole", "Find Text"),
327326
self.showFindWidget)
328-
menu.addSeparator()
329327
cutAction = menu.addAction(iconCut,
330328
QCoreApplication.translate("PythonConsole", "Cut"),
331329
self.cut, QKeySequence.Cut)
@@ -335,6 +333,9 @@ def contextMenuEvent(self, e):
335333
pasteAction = menu.addAction(iconPaste,
336334
QCoreApplication.translate("PythonConsole", "Paste"),
337335
self.paste, QKeySequence.Paste)
336+
selectAllAction = menu.addAction(
337+
QCoreApplication.translate("PythonConsole", "Select All"),
338+
self.selectAll, QKeySequence.SelectAll)
338339
menu.addSeparator()
339340
menu.addAction(iconCommentEditor,
340341
QCoreApplication.translate("PythonConsole", "Comment"),
@@ -344,19 +345,14 @@ def contextMenuEvent(self, e):
344345
self.parent.pc.uncommentCode, 'Shift+Ctrl+3')
345346
menu.addSeparator()
346347
codePadAction = menu.addAction(iconCodePad,
347-
QCoreApplication.translate("PythonConsole", "Share on codepad"),
348+
QCoreApplication.translate("PythonConsole", "Share on Codepad"),
348349
self.codepad)
349-
menu.addSeparator()
350350
showCodeInspection = menu.addAction(iconObjInsp,
351351
QCoreApplication.translate("PythonConsole", "Hide/Show Object Inspector"),
352352
self.objectListEditor)
353353
menu.addSeparator()
354-
selectAllAction = menu.addAction(
355-
QCoreApplication.translate("PythonConsole", "Select All"),
356-
self.selectAll, QKeySequence.SelectAll)
357-
menu.addSeparator()
358354
menu.addAction(iconSettings,
359-
QCoreApplication.translate("PythonConsole", "Settings"),
355+
QCoreApplication.translate("PythonConsole", "Options..."),
360356
self.parent.pc.openSettings)
361357
syntaxCheck.setEnabled(False)
362358
pasteAction.setEnabled(False)

python/console/console_output.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -221,19 +221,18 @@ def contextMenuEvent(self, e):
221221
self.enteredSelected,
222222
QKeySequence(Qt.CTRL + Qt.Key_E))
223223
clearAction = menu.addAction(iconClear,
224-
QCoreApplication.translate("PythonConsole", "Clear console"),
224+
QCoreApplication.translate("PythonConsole", "Clear Console"),
225225
self.clearConsole)
226226
menu.addSeparator()
227227
copyAction = menu.addAction(
228228
QCoreApplication.translate("PythonConsole", "Copy"),
229229
self.copy, QKeySequence.Copy)
230-
menu.addSeparator()
231230
selectAllAction = menu.addAction(
232231
QCoreApplication.translate("PythonConsole", "Select All"),
233232
self.selectAll, QKeySequence.SelectAll)
234233
menu.addSeparator()
235234
menu.addAction(iconSettings,
236-
QCoreApplication.translate("PythonConsole", "Settings"),
235+
QCoreApplication.translate("PythonConsole", "Options..."),
237236
self.parent.openSettings)
238237
runAction.setEnabled(False)
239238
clearAction.setEnabled(False)

0 commit comments

Comments
 (0)