Skip to content
Permalink
Browse files

[pyqgis-console] fix translation string

  • Loading branch information
slarosa committed May 20, 2013
1 parent 942d6bf commit 51d73a94e504fa53a5e3780b54b9cfe234305508
Showing with 69 additions and 31 deletions.
  1. +3 −3 python/console/console.py
  2. +45 −18 python/console/console_editor.py
  3. +15 −8 python/console/console_output.py
  4. +6 −2 python/console/console_sci.py
@@ -221,7 +221,7 @@ def __init__(self, parent=None):
self.runScriptEditorButton.setToolTip(runScriptEditorBt)
self.runScriptEditorButton.setText(runScriptEditorBt)
## Action Run Script (subprocess)
commentEditorBt = QCoreApplication.translate("PythonConsole", "Comment code")
commentEditorBt = QCoreApplication.translate("PythonConsole", "Comment")
self.commentEditorButton = QAction(self)
self.commentEditorButton.setCheckable(False)
self.commentEditorButton.setEnabled(True)
@@ -231,7 +231,7 @@ def __init__(self, parent=None):
self.commentEditorButton.setToolTip(commentEditorBt)
self.commentEditorButton.setText(commentEditorBt)
## Action Run Script (subprocess)
uncommentEditorBt = QCoreApplication.translate("PythonConsole", "Uncomment code")
uncommentEditorBt = QCoreApplication.translate("PythonConsole", "Uncomment")
self.uncommentEditorButton = QAction(self)
self.uncommentEditorButton.setCheckable(False)
self.uncommentEditorButton.setEnabled(True)
@@ -252,7 +252,7 @@ def __init__(self, parent=None):
self.objectListButton.setToolTip(objList)
self.objectListButton.setText(objList)
## Action for Find text
findText = QCoreApplication.translate("PythonConsole", "Find text")
findText = QCoreApplication.translate("PythonConsole", "Find Text")
self.findTextButton = QAction(self)
self.findTextButton.setCheckable(True)
self.findTextButton.setEnabled(True)
@@ -271,53 +271,76 @@ def contextMenuEvent(self, e):
iconSettings = QgsApplication.getThemeIcon("console/iconSettingsConsole.png")
iconFind = QgsApplication.getThemeIcon("console/iconSearchEditorConsole.png")
iconSyntaxCk = QgsApplication.getThemeIcon("console/iconSyntaxErrorConsole.png")
hideEditorAction = menu.addAction("Hide Editor",
self.hideEditor)
iconObjInsp = QgsApplication.getThemeIcon("console/iconClassBrowserConsole.png")
hideEditorAction = menu.addAction(QCoreApplication.translate("PythonConsole", "Hide Editor"),
self.hideEditor)
menu.addSeparator()
syntaxCheck = menu.addAction(iconSyntaxCk, "Check Syntax",
syntaxCheck = menu.addAction(iconSyntaxCk,
QCoreApplication.translate("PythonConsole",
"Check Syntax"),
self.syntaxCheck, 'Ctrl+4')
menu.addSeparator()
runSelected = menu.addAction(iconRun,
"Enter selected",
QCoreApplication.translate("PythonConsole",
"Enter selected"),
self.runSelectedCode, 'Ctrl+E')
runScript = menu.addAction(iconRunScript,
"Run Script",
QCoreApplication.translate("PythonConsole",
"Run Script"),
self.runScriptCode, 'Shift+Ctrl+E')
menu.addSeparator()
undoAction = menu.addAction("Undo", self.undo, QKeySequence.Undo)
redoAction = menu.addAction("Redo", self.redo, 'Ctrl+Shift+Z')
undoAction = menu.addAction(QCoreApplication.translate("PythonConsole",
"Undo"),
self.undo, QKeySequence.Undo)
redoAction = menu.addAction(QCoreApplication.translate("PythonConsole",
"Redo"),
self.redo, 'Ctrl+Shift+Z')
menu.addSeparator()
findAction = menu.addAction(iconFind,
"Find Text",
QCoreApplication.translate("PythonConsole",
"Find Text"),
self.showFindWidget)
menu.addSeparator()
cutAction = menu.addAction("Cut",
cutAction = menu.addAction(QCoreApplication.translate("PythonConsole",
"Cut"),
self.cut,
QKeySequence.Cut)
copyAction = menu.addAction("Copy",
copyAction = menu.addAction(QCoreApplication.translate("PythonConsole",
"Copy"),
self.copy,
QKeySequence.Copy)
pasteAction = menu.addAction("Paste", self.paste, QKeySequence.Paste)
pasteAction = menu.addAction(QCoreApplication.translate("PythonConsole",
"Paste"),
self.paste, QKeySequence.Paste)
menu.addSeparator()
commentCodeAction = menu.addAction(iconCommentEditor, "Comment",
commentCodeAction = menu.addAction(iconCommentEditor,
QCoreApplication.translate("PythonConsole",
"Comment"),
self.parent.pc.commentCode, 'Ctrl+3')
uncommentCodeAction = menu.addAction(iconUncommentEditor, "Uncomment",
uncommentCodeAction = menu.addAction(iconUncommentEditor,
QCoreApplication.translate("PythonConsole",
"Uncomment"),
self.parent.pc.uncommentCode,
'Shift+Ctrl+3')
menu.addSeparator()
codePadAction = menu.addAction(iconCodePad,
"Share on codepad",
self.codepad)
QCoreApplication.translate("PythonConsole",
"Share on codepad"),
self.codepad)
menu.addSeparator()
showCodeInspection = menu.addAction("Hide/Show Object list",
showCodeInspection = menu.addAction(iconObjInsp,
QCoreApplication.translate("PythonConsole",
"Hide/Show Object Inspector"),
self.objectListEditor)
menu.addSeparator()
selectAllAction = menu.addAction("Select All",
selectAllAction = menu.addAction(QCoreApplication.translate("PythonConsole",
"Select All"),
self.selectAll,
QKeySequence.SelectAll)
menu.addSeparator()
settingsDialog = menu.addAction(iconSettings,
"Settings",
QCoreApplication.translate("PythonConsole",
"Settings"),
self.parent.pc.openSettings)
syntaxCheck.setEnabled(False)
pasteAction.setEnabled(False)
@@ -328,6 +351,7 @@ def contextMenuEvent(self, e):
selectAllAction.setEnabled(False)
undoAction.setEnabled(False)
redoAction.setEnabled(False)
showCodeInspection.setEnabled(False)
if self.hasSelectedText():
runSelected.setEnabled(True)
copyAction.setEnabled(True)
@@ -342,6 +366,9 @@ def contextMenuEvent(self, e):
redoAction.setEnabled(True)
if QApplication.clipboard().text():
pasteAction.setEnabled(True)
if self.settings.value("pythonConsole/enableObjectInsp",
False).toBool():
showCodeInspection.setEnabled(True)
action = menu.exec_(self.mapToGlobal(e.pos()))

def findText(self, forward):
@@ -176,30 +176,37 @@ def contextMenuEvent(self, e):
iconHideTool = QgsApplication.getThemeIcon("console/iconHideToolConsole.png")
iconSettings = QgsApplication.getThemeIcon("console/iconSettingsConsole.png")
hideToolBar = menu.addAction(iconHideTool,
"Hide/Show Toolbar",
QCoreApplication.translate("PythonConsole",
"Hide/Show Toolbar"),
self.hideToolBar)
menu.addSeparator()
showEditorAction = menu.addAction("Show Editor",
self.showEditor)
showEditorAction = menu.addAction(QCoreApplication.translate("PythonConsole",
"Show Editor"),
self.showEditor)
menu.addSeparator()
runAction = menu.addAction(iconRun,
"Enter Selected",
QCoreApplication.translate("PythonConsole",
"Enter Selected"),
self.enteredSelected,
QKeySequence(Qt.CTRL + Qt.Key_E))
clearAction = menu.addAction(iconClear,
"Clear console",
QCoreApplication.translate("PythonConsole",
"Clear console"),
self.clearConsole)
menu.addSeparator()
copyAction = menu.addAction("Copy",
copyAction = menu.addAction(QCoreApplication.translate("PythonConsole",
"Copy"),
self.copy,
QKeySequence.Copy)
menu.addSeparator()
selectAllAction = menu.addAction("Select All",
selectAllAction = menu.addAction(QCoreApplication.translate("PythonConsole",
"Select All"),
self.selectAll,
QKeySequence.SelectAll)
menu.addSeparator()
settingsDialog = menu.addAction(iconSettings,
"Settings",
QCoreApplication.translate("PythonConsole",
"Settings"),
self.parent.openSettings)
runAction.setEnabled(False)
clearAction.setEnabled(False)
@@ -402,8 +402,12 @@ def keyPressEvent(self, e):

def contextMenuEvent(self, e):
menu = QMenu(self)
copyAction = menu.addAction("Copy", self.copy, QKeySequence.Copy)
pasteAction = menu.addAction("Paste", self.paste, QKeySequence.Paste)
copyAction = menu.addAction(QCoreApplication.translate("PythonConsole",
"Copy"),
self.copy, QKeySequence.Copy)
pasteAction = menu.addAction(QCoreApplication.translate("PythonConsole",
"Paste"),
self.paste, QKeySequence.Paste)
copyAction.setEnabled(False)
pasteAction.setEnabled(False)
if self.hasSelectedText():

0 comments on commit 51d73a9

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