Skip to content

Commit badeeae

Browse files
committedNov 11, 2012
Merge pull request #325 from slarosa/master
Updating help and minor changes for console
2 parents c4b74c9 + b2eb1c1 commit badeeae

File tree

7 files changed

+59
-51
lines changed

7 files changed

+59
-51
lines changed
 

‎images/console/imgHelpConsole.png

34.4 KB
Loading

‎images/console/imgHelpMenu.png

6.6 KB
Loading

‎images/images.qrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,8 @@
489489
<file>console/iconRunConsole.png</file>
490490
<file>console/iconAboutConsole.png</file>
491491
<file>console/iconCodepadConsole.png</file>
492+
<file>console/imgHelpConsole.png</file>
493+
<file>console/imgHelpMenu.png</file>
492494
<file>flags/sr_Cyrl.png</file>
493495
<file>flags/sr_Latn.png</file>
494496
<file>flags/sw.png</file>

‎python/console/console_help.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
# This will get replaced with a git SHA1 when you do a git archive
2424
__revision__ = '$Format:%H$'
2525

26-
from PyQt4.QtWebKit import *
2726
from PyQt4.QtCore import *
2827
from PyQt4.QtGui import *
2928
from ui_console_help import Ui_Help
@@ -33,11 +32,10 @@
3332
class HelpDialog(QDialog, Ui_Help):
3433
def __init__(self, parent):
3534
QDialog.__init__(self, parent)
36-
self.setModal(True)
3735
self.setupUi(self)
3836

3937
self.setWindowTitle(QCoreApplication.translate("PythonConsole","Help Python Console"))
40-
self.setMaximumSize(500, 300)
38+
self.setMaximumSize(530, 300)
4139

4240
qgisDataDir = QgsApplication.pkgDataPath()
4341
listFile = os.listdir(qgisDataDir + "/python/console/console_help/i18n")

‎python/console/console_help.ui

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>519</width>
10-
<height>328</height>
9+
<width>555</width>
10+
<height>363</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
@@ -62,35 +62,19 @@
6262
</customwidgets>
6363
<resources/>
6464
<connections>
65-
<connection>
66-
<sender>buttonBox</sender>
67-
<signal>accepted()</signal>
68-
<receiver>Help</receiver>
69-
<slot>accept()</slot>
70-
<hints>
71-
<hint type="sourcelabel">
72-
<x>248</x>
73-
<y>254</y>
74-
</hint>
75-
<hint type="destinationlabel">
76-
<x>157</x>
77-
<y>274</y>
78-
</hint>
79-
</hints>
80-
</connection>
8165
<connection>
8266
<sender>buttonBox</sender>
8367
<signal>rejected()</signal>
8468
<receiver>Help</receiver>
8569
<slot>reject()</slot>
8670
<hints>
8771
<hint type="sourcelabel">
88-
<x>316</x>
89-
<y>260</y>
72+
<x>259</x>
73+
<y>310</y>
9074
</hint>
9175
<hint type="destinationlabel">
92-
<x>286</x>
93-
<y>274</y>
76+
<x>259</x>
77+
<y>163</y>
9478
</hint>
9579
</hints>
9680
</connection>

‎python/console/console_help/help.htm

Lines changed: 48 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,29 @@
88

99
<style>
1010
body{
11-
font-family: verdana,arial,helvetica,sans-serif;
12-
/*font-family:Verdana,Geneva,sans-serif;*/
11+
font-family: 'Trebuchet MS', sans-serif;
1312
font-size : 12px;
1413
}
1514
#header{
16-
background: #cccccc;
15+
background: #f6f6f6;
16+
border-bottom: 3px solid #000;
1717
width: 100%;
1818
}
1919
#headerTool td{
2020
background: #f6f6f6;
2121
/*width: 100%;*/
2222
}
23+
._titleP {
24+
padding: 5px;
25+
font-size: 15px;
26+
font-weight: bold;
27+
color: #000;
28+
}
29+
._title {
30+
font-size: 20px;
31+
font-weight: bold;
32+
color: #000;
33+
}
2334
</style>
2435
</head>
2536
<body>
@@ -29,22 +40,45 @@
2940
<img src="qrc:/images/console/imgHelpDialog.png" />
3041
</td>
3142
<td>
32-
<h2 id="headerTitle">Python Console for QGIS</h2>
43+
<span id="headerTitle" class="_title">Python Console for QGIS</span>
3344
</td>
3445
</tr>
46+
</table>
47+
<table>
48+
<tr>
49+
<td>
50+
<p align="justify">
51+
<span id="headerSubject">Python Console based on PyQScintilla2.</span>
52+
<br><br>
53+
<span id="headerSubjectMain">To access Quantum GIS environment from this console
54+
use qgis.utils.iface object (instance of QgisInterface class).
55+
To import the class QgisInterface can also use the dedicated
56+
button on the toolbar on the left.</span>
57+
</p>
58+
</td>
59+
</tr>
60+
<tr>
61+
<td><img src="qrc:/images/console/imgHelpConsole.png" /></td>
62+
</tr>
63+
<tr>
64+
<td>
65+
<p align="justify">
66+
<span id="">The console is splitted in two main panes, output and input areas.
67+
Both are resizable by using the horizontal splitter.
68+
Output area pane is a widget read-only which shows the commands output.
69+
You can drag and drop or copy text into input area (no matter if selected text contains >>> or ...).
70+
Use 'Share on codepad' from contextual menu for sharing snippets code.
71+
The context menu looks like the image below.<br><br>
72+
<img src="qrc:/images/console/imgHelpMenu.png"><br>
73+
Input area pane is the interactive python shell for input commands.</span>
74+
</p>
75+
</td>
76+
</tr>
3577
</table>
36-
<p align="justify">
37-
<span id="headerSubject">Python Console based on PyQScintilla2.</span>
38-
<br><br>
39-
<span id="headerSubjectMain">To access Quantum GIS environment from this console
40-
use qgis.utils.iface object (instance of QgisInterface class).
41-
To import the class QgisInterface can also use the dedicated
42-
button on the toolbar on the left.</span>
43-
</p>
4478
<table id="header">
4579
<tr>
4680
<td>
47-
<h4 id="features">Features</h4>
81+
<span id="features" class="_titleP">Features</span>
4882
</td>
4983
</tr>
5084
</table>
@@ -86,7 +120,7 @@ <h4 id="features">Features</h4>
86120
<table id="header">
87121
<tr>
88122
<td>
89-
<h4 id="toolbar">Toolbar</h4>
123+
<span id="toolbar" class="_titleP">Toolbar</span>
90124
</td>
91125
</tr>
92126
</table>
@@ -139,17 +173,6 @@ <h4 id="toolbar">Toolbar</h4>
139173
<td colspan="2"><span id="toolbarRun">Run command (like Enter key pressed)</span></td>
140174
</tr>
141175
</table>
142-
<br>
143-
<table id="header">
144-
<tr>
145-
<td>
146-
<h4 id="thanks">Acknowledgments</h4>
147-
</td>
148-
</tr>
149-
</table>
150-
<p>
151-
<span id="thanksText">Thanks to Larry Shaffer who provided the API files.</span>
152-
</p>
153176
</body>
154177
<script type="text/javascript">
155178
var parameter = window.location.search.replace( "?", "" );

‎python/console/console_output.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ def clearConsole(self):
158158
#self.SendScintilla(QsciScintilla.SCI_CLEARALL)
159159
self.setText('')
160160
self.insertInitText()
161+
self.edit.setFocus()
161162

162163
def contextMenuEvent(self, e):
163164
menu = QMenu(self)
@@ -191,7 +192,7 @@ def contextMenuEvent(self, e):
191192
runAction.setEnabled(True)
192193
copyAction.setEnabled(True)
193194
pastebinAction.setEnabled(True)
194-
if not self.text() == '':
195+
if not self.text(3) == '':
195196
selectAllAction.setEnabled(True)
196197
clearAction.setEnabled(True)
197198
action = menu.exec_(self.mapToGlobal(e.pos()))

0 commit comments

Comments
 (0)
Please sign in to comment.