Skip to content

Commit

Permalink
Merge pull request #328 from slarosa/master
Browse files Browse the repository at this point in the history
Add action: Hide/Show toolbar for PyQGIS Console
  • Loading branch information
jef-n committed Nov 16, 2012
2 parents 5053818 + 1237546 commit 5bc0a8a
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 3 deletions.
Binary file added images/console/iconHideToolConsole.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/console/imgHelpMenu.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions images/images.qrc
Expand Up @@ -491,6 +491,7 @@
<file>console/iconCodepadConsole.png</file>
<file>console/imgHelpConsole.png</file>
<file>console/imgHelpMenu.png</file>
<file>console/iconHideToolConsole.png</file>
<file>flags/sr_Cyrl.png</file>
<file>flags/sr_Latn.png</file>
<file>flags/sw.png</file>
Expand Down
2 changes: 1 addition & 1 deletion python/console/console.py
Expand Up @@ -355,7 +355,7 @@ def saveScriptFile(self):
sF.close()

def openHelp(self):
dlg = HelpDialog(self)
dlg = HelpDialog()
dlg.exec_()

def openSettings(self):
Expand Down
5 changes: 3 additions & 2 deletions python/console/console_help.py
Expand Up @@ -30,10 +30,11 @@
import os

class HelpDialog(QDialog, Ui_Help):
def __init__(self, parent):
def __init__(self, parent=None):
QDialog.__init__(self, parent)
self.setupUi(self)


self.setWindowModality(Qt.WindowModal)
self.setWindowTitle(QCoreApplication.translate("PythonConsole","Help Python Console"))
self.setMaximumSize(530, 300)

Expand Down
10 changes: 10 additions & 0 deletions python/console/console_output.py
Expand Up @@ -165,6 +165,11 @@ def contextMenuEvent(self, e):
iconRun = QIcon(":/images/console/iconRunConsole.png")
iconPastebin = QIcon(":/images/console/iconCodepadConsole.png")
iconClear = QIcon(":/images/console/iconClearConsole.png")
iconHideTool = QIcon(":/images/console/iconHideToolConsole.png")
hideToolBar = menu.addAction(iconHideTool,
"Hide/Show Toolbar",
self.hideToolBar)
menu.addSeparator()
runAction = menu.addAction(iconRun,
"Enter Selected",
self.enteredSelected,
Expand Down Expand Up @@ -196,6 +201,11 @@ def contextMenuEvent(self, e):
selectAllAction.setEnabled(True)
clearAction.setEnabled(True)
action = menu.exec_(self.mapToGlobal(e.pos()))

def hideToolBar(self):
tB = self.parent.toolBar
tB.hide() if tB.isVisible() else tB.show()
self.edit.setFocus()

def copy(self):
"""Copy text to clipboard... or keyboard interrupt"""
Expand Down

0 comments on commit 5bc0a8a

Please sign in to comment.