Skip to content
Permalink
Browse files

Improved the console toolbar

- added menu for class import
- added menu for open/save script
- update help and Italian translate
  • Loading branch information
slarosa committed Sep 27, 2012
1 parent 29aeac7 commit 630a02153f04da84cee9dc55075c4a4f6b76903b
@@ -6253,6 +6253,14 @@ Cambiare questa situazione prima, perché il plugin OSM non quale layer è la de
<source>Python Console</source>
<translation>Console python</translation>
</message>
<message>
<source>Import Class</source>
<translation>Importa Modulo</translation>
</message>
<message>
<source>Manage Script</source>
<translation>Gestione Script</translation>
</message>
<message>
<source>Clear console</source>
<translation>Pulisci console</translation>
@@ -113,6 +113,26 @@ def __init__(self, parent=None):
# self.currentLayerButton.setIcon(QIcon("icon/iconTempConsole.png"))
# self.currentLayerButton.setMenuRole(QAction.PreferencesRole)
# self.currentLayerButton.setIconVisibleInMenu(True)
## Action menu for class
actionClassBt = QCoreApplication.translate("PythonConsole", "Import Class")
self.actionClass = QAction(parent)
self.actionClass.setCheckable(False)
self.actionClass.setEnabled(True)
self.actionClass.setIcon(QIcon(os.path.dirname(__file__) + "/iconConsole/iconClassConsole.png"))
self.actionClass.setMenuRole(QAction.PreferencesRole)
self.actionClass.setIconVisibleInMenu(True)
self.actionClass.setToolTip(actionClassBt)
self.actionClass.setText(actionClassBt)
## Action menu Open/Save script
actionScriptBt = QCoreApplication.translate("PythonConsole", "Manage Script")
self.actionScript = QAction(parent)
self.actionScript.setCheckable(False)
self.actionScript.setEnabled(True)
self.actionScript.setIcon(QIcon(os.path.dirname(__file__) + "/iconConsole/iconTempConsole.png"))
self.actionScript.setMenuRole(QAction.PreferencesRole)
self.actionScript.setIconVisibleInMenu(True)
self.actionScript.setToolTip(actionScriptBt)
self.actionScript.setText(actionScriptBt)
## Import Sextante class
loadSextanteBt = QCoreApplication.translate("PythonConsole", "Import sextante class")
self.loadSextanteButton = QAction(parent)
@@ -128,7 +148,7 @@ def __init__(self, parent=None):
self.loadIfaceButton = QAction(parent)
self.loadIfaceButton.setCheckable(False)
self.loadIfaceButton.setEnabled(True)
self.loadIfaceButton.setIcon(QIcon(os.path.dirname(__file__) + "/iconConsole/iconTempConsole.png"))
self.loadIfaceButton.setIcon(QIcon(os.path.dirname(__file__) + "/iconConsole/iconIfaceConsole.png"))
self.loadIfaceButton.setMenuRole(QAction.PreferencesRole)
self.loadIfaceButton.setIconVisibleInMenu(True)
self.loadIfaceButton.setToolTip(loadIfaceBt)
@@ -175,13 +195,24 @@ def __init__(self, parent=None):
self.helpButton.setText(helpBt)

self.toolBar.addAction(self.clearButton)
#self.toolBar.addAction(self.currentLayerButton)
self.toolBar.addAction(self.loadIfaceButton)
self.toolBar.addAction(self.loadSextanteButton)
self.toolBar.addAction(self.openFileButton)
self.toolBar.addAction(self.saveFileButton)
self.toolBar.addAction(self.actionClass)
self.toolBar.addAction(self.actionScript)
self.toolBar.addAction(self.helpButton)
self.toolBar.addAction(self.runButton)
## Menu Import Class
self.classMenu = QMenu(self)
self.classMenu.addAction(self.loadIfaceButton)
self.classMenu.addAction(self.loadSextanteButton)
cM = self.toolBar.widgetForAction(self.actionClass)
cM.setMenu(self.classMenu)
cM.setPopupMode(QToolButton.InstantPopup)
## Menu Manage Script
self.scriptMenu = QMenu(self)
self.scriptMenu.addAction(self.openFileButton)
self.scriptMenu.addAction(self.saveFileButton)
sM = self.toolBar.widgetForAction(self.actionScript)
sM.setMenu(self.scriptMenu)
sM.setPopupMode(QToolButton.InstantPopup)

self.b.addWidget(self.toolBar)
self.edit = PythonEdit()
@@ -192,7 +223,7 @@ def __init__(self, parent=None):
self.e.addWidget(self.edit)

self.edit.setFocus()

self.setWindowTitle(QCoreApplication.translate("PythonConsole", "Python Console"))
self.clearButton.triggered.connect(self.edit.clearConsole)
#self.currentLayerButton.triggered.connect(self.cLayer)
@@ -97,6 +97,7 @@ def __init__(self, parent=None):

# not too small
#self.setMinimumSize(500, 300)
self.setMinimumHeight(125)

self.SendScintilla(QsciScintilla.SCI_SETWRAPMODE, 1)
self.SendScintilla(QsciScintilla.SCI_EMPTYUNDOBUFFER)
@@ -83,7 +83,7 @@ <h4>Toolbar</h4>
<td>Tool to clear python console</td>
</tr>
<tr>
<td><img src="../iconConsole/iconTempConsole.png" /></td>
<td><img src="../iconConsole/iconIfaceConsole.png" /></td>
<td>Tool to import iface class</td>
</tr>
<tr>
@@ -7,6 +7,8 @@ iconSextanteConsole.png
iconSaveConsole.png
iconHelpConsole.png
imgHelpDialog.png
iconIfaceConsole.png
iconClassConsole.png
)

FILE(GLOB ICON_FILES *.png)
Binary file not shown.
Binary file not shown.

0 comments on commit 630a021

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