Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
updating help and minor changes for console
  • Loading branch information
slarosa committed Nov 11, 2012
1 parent c4b74c9 commit b2eb1c1
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 51 deletions.
Binary file added images/console/imgHelpConsole.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 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.
2 changes: 2 additions & 0 deletions images/images.qrc
Expand Up @@ -489,6 +489,8 @@
<file>console/iconRunConsole.png</file>
<file>console/iconAboutConsole.png</file>
<file>console/iconCodepadConsole.png</file>
<file>console/imgHelpConsole.png</file>
<file>console/imgHelpMenu.png</file>
<file>flags/sr_Cyrl.png</file>
<file>flags/sr_Latn.png</file>
<file>flags/sw.png</file>
Expand Down
4 changes: 1 addition & 3 deletions python/console/console_help.py
Expand Up @@ -23,7 +23,6 @@
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'

from PyQt4.QtWebKit import *
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from ui_console_help import Ui_Help
Expand All @@ -33,11 +32,10 @@
class HelpDialog(QDialog, Ui_Help):
def __init__(self, parent):
QDialog.__init__(self, parent)
self.setModal(True)
self.setupUi(self)

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

qgisDataDir = QgsApplication.pkgDataPath()
listFile = os.listdir(qgisDataDir + "/python/console/console_help/i18n")
Expand Down
28 changes: 6 additions & 22 deletions python/console/console_help.ui
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>519</width>
<height>328</height>
<width>555</width>
<height>363</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -62,35 +62,19 @@
</customwidgets>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>Help</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>Help</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
<x>259</x>
<y>310</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
<x>259</x>
<y>163</y>
</hint>
</hints>
</connection>
Expand Down
73 changes: 48 additions & 25 deletions python/console/console_help/help.htm
Expand Up @@ -8,18 +8,29 @@

<style>
body{
font-family: verdana,arial,helvetica,sans-serif;
/*font-family:Verdana,Geneva,sans-serif;*/
font-family: 'Trebuchet MS', sans-serif;
font-size : 12px;
}
#header{
background: #cccccc;
background: #f6f6f6;
border-bottom: 3px solid #000;
width: 100%;
}
#headerTool td{
background: #f6f6f6;
/*width: 100%;*/
}
._titleP {
padding: 5px;
font-size: 15px;
font-weight: bold;
color: #000;
}
._title {
font-size: 20px;
font-weight: bold;
color: #000;
}
</style>
</head>
<body>
Expand All @@ -29,22 +40,45 @@
<img src="qrc:/images/console/imgHelpDialog.png" />
</td>
<td>
<h2 id="headerTitle">Python Console for QGIS</h2>
<span id="headerTitle" class="_title">Python Console for QGIS</span>
</td>
</tr>
</table>
<table>
<tr>
<td>
<p align="justify">
<span id="headerSubject">Python Console based on PyQScintilla2.</span>
<br><br>
<span id="headerSubjectMain">To access Quantum GIS environment from this console
use qgis.utils.iface object (instance of QgisInterface class).
To import the class QgisInterface can also use the dedicated
button on the toolbar on the left.</span>
</p>
</td>
</tr>
<tr>
<td><img src="qrc:/images/console/imgHelpConsole.png" /></td>
</tr>
<tr>
<td>
<p align="justify">
<span id="">The console is splitted in two main panes, output and input areas.
Both are resizable by using the horizontal splitter.
Output area pane is a widget read-only which shows the commands output.
You can drag and drop or copy text into input area (no matter if selected text contains >>> or ...).
Use 'Share on codepad' from contextual menu for sharing snippets code.
The context menu looks like the image below.<br><br>
<img src="qrc:/images/console/imgHelpMenu.png"><br>
Input area pane is the interactive python shell for input commands.</span>
</p>
</td>
</tr>
</table>
<p align="justify">
<span id="headerSubject">Python Console based on PyQScintilla2.</span>
<br><br>
<span id="headerSubjectMain">To access Quantum GIS environment from this console
use qgis.utils.iface object (instance of QgisInterface class).
To import the class QgisInterface can also use the dedicated
button on the toolbar on the left.</span>
</p>
<table id="header">
<tr>
<td>
<h4 id="features">Features</h4>
<span id="features" class="_titleP">Features</span>
</td>
</tr>
</table>
Expand Down Expand Up @@ -86,7 +120,7 @@ <h4 id="features">Features</h4>
<table id="header">
<tr>
<td>
<h4 id="toolbar">Toolbar</h4>
<span id="toolbar" class="_titleP">Toolbar</span>
</td>
</tr>
</table>
Expand Down Expand Up @@ -139,17 +173,6 @@ <h4 id="toolbar">Toolbar</h4>
<td colspan="2"><span id="toolbarRun">Run command (like Enter key pressed)</span></td>
</tr>
</table>
<br>
<table id="header">
<tr>
<td>
<h4 id="thanks">Acknowledgments</h4>
</td>
</tr>
</table>
<p>
<span id="thanksText">Thanks to Larry Shaffer who provided the API files.</span>
</p>
</body>
<script type="text/javascript">
var parameter = window.location.search.replace( "?", "" );
Expand Down
3 changes: 2 additions & 1 deletion python/console/console_output.py
Expand Up @@ -158,6 +158,7 @@ def clearConsole(self):
#self.SendScintilla(QsciScintilla.SCI_CLEARALL)
self.setText('')
self.insertInitText()
self.edit.setFocus()

def contextMenuEvent(self, e):
menu = QMenu(self)
Expand Down Expand Up @@ -191,7 +192,7 @@ def contextMenuEvent(self, e):
runAction.setEnabled(True)
copyAction.setEnabled(True)
pastebinAction.setEnabled(True)
if not self.text() == '':
if not self.text(3) == '':
selectAllAction.setEnabled(True)
clearAction.setEnabled(True)
action = menu.exec_(self.mapToGlobal(e.pos()))
Expand Down

0 comments on commit b2eb1c1

Please sign in to comment.