Skip to content
Permalink
Browse files

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 72df8901f5c2a11e41ee252d61a5252832d30ec2
Showing with 19 additions and 24 deletions.
  1. +11 −11 python/console/console.py
  2. +6 −10 python/console/console_editor.py
  3. +2 −3 python/console/console_output.py
@@ -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)
@@ -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)
@@ -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",
@@ -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)
@@ -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)
@@ -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)
@@ -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)
@@ -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)
@@ -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)
@@ -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)
@@ -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)
@@ -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"),
@@ -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)
@@ -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"),
@@ -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)
@@ -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)

0 comments on commit 72df890

Please sign in to comment.
You can’t perform that action at this time.