Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
  • Loading branch information
nyalldawson committed Feb 24, 2016
1 parent 8abeb8d commit 72df890
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 24 deletions.
22 changes: 11 additions & 11 deletions python/console/console.py
Expand Up @@ -167,7 +167,7 @@ def __init__(self, parent=None):
##------------------Toolbar Editor-------------------------------------

## Action for Open File
openFileBt = QCoreApplication.translate("PythonConsole", "Open file")
openFileBt = QCoreApplication.translate("PythonConsole", "Open Script...")
self.openFileButton = QAction(self)
self.openFileButton.setCheckable(False)
self.openFileButton.setEnabled(True)
Expand All @@ -177,7 +177,7 @@ def __init__(self, parent=None):
self.openFileButton.setToolTip(openFileBt)
self.openFileButton.setText(openFileBt)

openExtEditorBt = QCoreApplication.translate("PythonConsole", "Open in external editor")
openExtEditorBt = QCoreApplication.translate("PythonConsole", "Open in External Editor")
self.openInEditorButton = QAction(self)
self.openInEditorButton.setCheckable(False)
self.openInEditorButton.setEnabled(True)
Expand Down Expand Up @@ -267,7 +267,7 @@ def __init__(self, parent=None):
self.uncommentEditorButton.setToolTip(uncommentEditorBt)
self.uncommentEditorButton.setText(uncommentEditorBt)
## Action for Object browser
objList = QCoreApplication.translate("PythonConsole", "Object Inspector")
objList = QCoreApplication.translate("PythonConsole", "Object Inspector...")
self.objectListButton = QAction(self)
self.objectListButton.setCheckable(True)
self.objectListButton.setEnabled(self.settings.value("pythonConsole/enableObjectInsp",
Expand All @@ -291,7 +291,7 @@ def __init__(self, parent=None):
##----------------Toolbar Console-------------------------------------

## Action Show Editor
showEditor = QCoreApplication.translate("PythonConsole", "Show editor")
showEditor = QCoreApplication.translate("PythonConsole", "Show Editor")
self.showEditorButton = QAction(self)
self.showEditorButton.setEnabled(True)
self.showEditorButton.setCheckable(True)
Expand All @@ -301,7 +301,7 @@ def __init__(self, parent=None):
self.showEditorButton.setToolTip(showEditor)
self.showEditorButton.setText(showEditor)
## Action for Clear button
clearBt = QCoreApplication.translate("PythonConsole", "Clear console")
clearBt = QCoreApplication.translate("PythonConsole", "Clear Console")
self.clearButton = QAction(self)
self.clearButton.setCheckable(False)
self.clearButton.setEnabled(True)
Expand All @@ -311,7 +311,7 @@ def __init__(self, parent=None):
self.clearButton.setToolTip(clearBt)
self.clearButton.setText(clearBt)
## Action for settings
optionsBt = QCoreApplication.translate("PythonConsole", "Settings")
optionsBt = QCoreApplication.translate("PythonConsole", "Options...")
self.optionsButton = QAction(self)
self.optionsButton.setCheckable(False)
self.optionsButton.setEnabled(True)
Expand All @@ -331,7 +331,7 @@ def __init__(self, parent=None):
self.actionClass.setToolTip(actionClassBt)
self.actionClass.setText(actionClassBt)
## Import Processing class
loadProcessingBt = QCoreApplication.translate("PythonConsole", "Import Processing class")
loadProcessingBt = QCoreApplication.translate("PythonConsole", "Import Processing Class")
self.loadProcessingButton = QAction(self)
self.loadProcessingButton.setCheckable(False)
self.loadProcessingButton.setEnabled(True)
Expand All @@ -341,7 +341,7 @@ def __init__(self, parent=None):
self.loadProcessingButton.setToolTip(loadProcessingBt)
self.loadProcessingButton.setText(loadProcessingBt)
## Import QtCore class
loadQtCoreBt = QCoreApplication.translate("PythonConsole", "Import PyQt.QtCore class")
loadQtCoreBt = QCoreApplication.translate("PythonConsole", "Import PyQt.QtCore Class")
self.loadQtCoreButton = QAction(self)
self.loadQtCoreButton.setCheckable(False)
self.loadQtCoreButton.setEnabled(True)
Expand All @@ -351,7 +351,7 @@ def __init__(self, parent=None):
self.loadQtCoreButton.setToolTip(loadQtCoreBt)
self.loadQtCoreButton.setText(loadQtCoreBt)
## Import QtGui class
loadQtGuiBt = QCoreApplication.translate("PythonConsole", "Import PyQt.QtGui class")
loadQtGuiBt = QCoreApplication.translate("PythonConsole", "Import PyQt.QtGui Class")
self.loadQtGuiButton = QAction(self)
self.loadQtGuiButton.setCheckable(False)
self.loadQtGuiButton.setEnabled(True)
Expand All @@ -361,7 +361,7 @@ def __init__(self, parent=None):
self.loadQtGuiButton.setToolTip(loadQtGuiBt)
self.loadQtGuiButton.setText(loadQtGuiBt)
## Action for Run script
runBt = QCoreApplication.translate("PythonConsole", "Run command")
runBt = QCoreApplication.translate("PythonConsole", "Run Command")
self.runButton = QAction(self)
self.runButton.setCheckable(False)
self.runButton.setEnabled(True)
Expand All @@ -371,7 +371,7 @@ def __init__(self, parent=None):
self.runButton.setToolTip(runBt)
self.runButton.setText(runBt)
## Help action
helpBt = QCoreApplication.translate("PythonConsole", "Help")
helpBt = QCoreApplication.translate("PythonConsole", "Help...")
self.helpButton = QAction(self)
self.helpButton.setCheckable(False)
self.helpButton.setEnabled(True)
Expand Down
16 changes: 6 additions & 10 deletions python/console/console_editor.py
Expand Up @@ -307,9 +307,8 @@ def contextMenuEvent(self, e):
syntaxCheck = menu.addAction(iconSyntaxCk,
QCoreApplication.translate("PythonConsole", "Check Syntax"),
self.syntaxCheck, 'Ctrl+4')
menu.addSeparator()
runSelected = menu.addAction(iconRun,
QCoreApplication.translate("PythonConsole", "Run selected"),
QCoreApplication.translate("PythonConsole", "Run Selected"),
self.runSelectedCode, 'Ctrl+E')
menu.addAction(iconRunScript,
QCoreApplication.translate("PythonConsole", "Run Script"),
Expand All @@ -325,7 +324,6 @@ def contextMenuEvent(self, e):
menu.addAction(iconFind,
QCoreApplication.translate("PythonConsole", "Find Text"),
self.showFindWidget)
menu.addSeparator()
cutAction = menu.addAction(iconCut,
QCoreApplication.translate("PythonConsole", "Cut"),
self.cut, QKeySequence.Cut)
Expand All @@ -335,6 +333,9 @@ def contextMenuEvent(self, e):
pasteAction = menu.addAction(iconPaste,
QCoreApplication.translate("PythonConsole", "Paste"),
self.paste, QKeySequence.Paste)
selectAllAction = menu.addAction(
QCoreApplication.translate("PythonConsole", "Select All"),
self.selectAll, QKeySequence.SelectAll)
menu.addSeparator()
menu.addAction(iconCommentEditor,
QCoreApplication.translate("PythonConsole", "Comment"),
Expand All @@ -344,19 +345,14 @@ def contextMenuEvent(self, e):
self.parent.pc.uncommentCode, 'Shift+Ctrl+3')
menu.addSeparator()
codePadAction = menu.addAction(iconCodePad,
QCoreApplication.translate("PythonConsole", "Share on codepad"),
QCoreApplication.translate("PythonConsole", "Share on Codepad"),
self.codepad)
menu.addSeparator()
showCodeInspection = menu.addAction(iconObjInsp,
QCoreApplication.translate("PythonConsole", "Hide/Show Object Inspector"),
self.objectListEditor)
menu.addSeparator()
selectAllAction = menu.addAction(
QCoreApplication.translate("PythonConsole", "Select All"),
self.selectAll, QKeySequence.SelectAll)
menu.addSeparator()
menu.addAction(iconSettings,
QCoreApplication.translate("PythonConsole", "Settings"),
QCoreApplication.translate("PythonConsole", "Options..."),
self.parent.pc.openSettings)
syntaxCheck.setEnabled(False)
pasteAction.setEnabled(False)
Expand Down
5 changes: 2 additions & 3 deletions python/console/console_output.py
Expand Up @@ -221,19 +221,18 @@ def contextMenuEvent(self, e):
self.enteredSelected,
QKeySequence(Qt.CTRL + Qt.Key_E))
clearAction = menu.addAction(iconClear,
QCoreApplication.translate("PythonConsole", "Clear console"),
QCoreApplication.translate("PythonConsole", "Clear Console"),
self.clearConsole)
menu.addSeparator()
copyAction = menu.addAction(
QCoreApplication.translate("PythonConsole", "Copy"),
self.copy, QKeySequence.Copy)
menu.addSeparator()
selectAllAction = menu.addAction(
QCoreApplication.translate("PythonConsole", "Select All"),
self.selectAll, QKeySequence.SelectAll)
menu.addSeparator()
menu.addAction(iconSettings,
QCoreApplication.translate("PythonConsole", "Settings"),
QCoreApplication.translate("PythonConsole", "Options..."),
self.parent.openSettings)
runAction.setEnabled(False)
clearAction.setEnabled(False)
Expand Down

0 comments on commit 72df890

Please sign in to comment.