Skip to content

Commit 8ac7ec8

Browse files
committed
Vers. 0.2.0 for QGIS3
1 parent d6ed5c4 commit 8ac7ec8

File tree

4 files changed

+64
-29
lines changed

4 files changed

+64
-29
lines changed

beePen_QWidget.py

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,9 @@ def setup_gui(self):
155155
self.setWindowTitle(self.plugin_name)
156156

157157
def open_help_page(self):
158-
159-
import webbrowser
160-
local_url = os.path.dirname(os.path.realpath(__file__)) + os.sep + "help" + os.sep + "help.html"
161-
local_url = local_url.replace("\\","/")
162-
if not webbrowser.open(local_url):
163-
warn(self.main_window,
164-
self.plugin_name,
165-
"Error with browser.\nOpen help/help.html")
158+
159+
dialog = HelpDialog()
160+
dialog.exec_()
166161

167162
def get_prjcrs_as_proj4str(self):
168163
# get project CRS information
@@ -245,6 +240,26 @@ def error(self, msg):
245240
QMessageBox.error(self, self.plugin_name, msg)
246241

247242

243+
class HelpDialog(QDialog):
244+
245+
def __init__(self, parent=None):
246+
247+
super(HelpDialog, self).__init__(parent)
248+
249+
layout = QVBoxLayout()
250+
251+
# About section
252+
253+
helpTextBrwsr = QTextBrowser(self)
254+
255+
helpTextBrwsr.setSource(QUrl('{}/help/help.html'.format(os.path.dirname(__file__))))
256+
helpTextBrwsr.setSearchPaths(['{}/help'.format(os.path.dirname(__file__))])
257+
258+
layout.addWidget(helpTextBrwsr)
259+
260+
self.setLayout(layout)
261+
262+
self.setWindowTitle("beePen Help")
248263

249264

250265

beePen_gui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ def erase_features(self):
302302
"First launch %s" % self.plugin_name)
303303
return
304304

305-
self.eraser_tool = EraserTool(self.canvas)
305+
self.eraser_tool = EraserTool(self.interface, self.canvas)
306306

307307
self.canvas.setMapTool(self.eraser_tool)
308308
self.beePen_rubber_QAction.setChecked(True)

help/help.html

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,56 @@
22
<html>
33
<head>
44
<title>beePen help</title>
5+
<style>
6+
h5 { font-size: 95%; color: #333; }
7+
img { max-width: 95%; }
8+
figure {
9+
text-align: center;
10+
font-style: italic;
11+
font-size: smaller;
12+
text-indent: 0;
13+
border: thin silver solid;
14+
margin: 0.5em;
15+
padding: 0.5em;
16+
}
17+
figcaption { font-size: 95%; color: #333; }
18+
</style>
519
</head>
620

7-
<h1>beePen help</h1>
8-
21+
<h2>beePen help</h2>
22+
<h3>vers. 0.2.0 for QGIS 3</h3>
23+
24+
<div style="font-size: 90%; font-style: italic;">
25+
Plugin creators: Mauro Dedonatis (Urbino Univ., Italy, [email protected]) and Mauro Alberti (alberti.m65 at gmail.com).
26+
<br />The original concept is by Mauro DeDonatis, while the implementation is by Mauro Alberti.
27+
</div>
28+
<br />
29+
<div>
930
beePen is a Python plugin for drawing freeand annotations and sketches in an ad-hoc layer in QGis.
10-
It is inspired by the corresponding tool in <a href="http://www.beegis.org/" target="_blank">BeeGIS</a>
11-
and re-use the code by Pavol Kapusta in his Frehand Editing plugin. The plugin window is started by the "beePen" command (Fig. 1).
31+
It is inspired by the corresponding tool in <a href="http://www.beegis.org/" target="_blank">BeeGIS</a>.
32+
and based on the code by Pavol Kapusta in his Frehand Editing plugin. The plugin window is started by the "beePen" command (Fig. 1).
1233
<br /><br />
13-
<img src="ims/beepen_icon.png">
14-
<br/>Fig. 1.
15-
<br /><br /><br />
34+
<figure>
35+
<p><img src="ims/beepen_icon.png">
36+
<figcaption>Fig. 1</figcaption>
37+
</figure>
1638
beePen allows to create an annotation layer, that is characterized by three fields, storing: 1) the user-defined width (in map units); 2) the color and transparency of the pen;
1739
3) the optional note to be associated with each element.
1840
These value are automatically inserted based on the user choice in the plugin window (Fig. 2).<br />
19-
<br />
20-
<img src="ims/beepen_window.png">
21-
<br/>Fig. 2.
22-
<br /><br /><br />
41+
<figure>
42+
<p><img src="ims/beepen_window.png">
43+
<figcaption>Fig. 2</figcaption>
44+
</figure>
2345
To draw annotations, create a new annotation layer from the beePen window (see Fig. 2) or load an existing one with QGIS (and style it if necessary
2446
with the "Style selected layers" command), and then draw annotations by selecting the pen tool (command with pencil icon in Fig. 3).
2547
You can delete one or more annotations by drawing a line above them with the eraser tool (rightmost command in Fig. 3).<br />
26-
<br />
27-
<img src="ims/beepen_commands.png">
28-
<br/>Fig. 3.
29-
<br />
30-
<div>
31-
<br /><br />
32-
The conception of beePen is by Mauro Dedonatis (Urbino Univ., Italy), while the implementation is by Mauro Alberti.</div>
33-
<br />
34-
<div style="font-style: italic; font-size:90%">Milan, September 2016, by Mauro Alberti</div>
48+
<figure>
49+
<p><img src="ims/beepen_commands.png">
50+
<figcaption>Fig. 3</figcaption>
51+
</figure>
52+
</div>
53+
<br /><br />
54+
<div style="font-style: italic; font-size:80%">Text version: August 5, 2018, by Mauro Alberti</div>
3555

3656

3757

help/ims/beepen_window.png

1.26 KB
Loading

0 commit comments

Comments
 (0)