-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvfc_main.py
75 lines (50 loc) · 1.84 KB
/
vfc_main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
from __future__ import absolute_import
from builtins import object
from qgis.PyQt.QtCore import *
from qgis.PyQt.QtGui import *
from qgis.PyQt.QtWidgets import *
from qgis.core import *
from .qgis_utils.gui import *
from . import resources # maintain however
from .main_dialog import MainDialog, HelpDialog
_plugin_name_ = "VectorFieldCalc"
class VectorFieldCal(object):
def __init__(self, iface):
# Save reference to the QGIS interface
self.iface = iface
self.plugin_name = _plugin_name_
self.actions = []
def initGui(self):
# Create action that will start plugin configuration
self.qactMain = create_action(
':/plugins/{}/icons/icon.png'.format(self.plugin_name),
'Open VectorFieldCalc',
self.run,
whats_this="VectorFieldCalc",
parent=self.iface.mainWindow())
self.iface.addPluginToMenu(self.plugin_name,
self.qactMain)
self.qactOpenHelp = create_action(
':/plugins/{}/icons/help.ico'.format(self.plugin_name),
'Help',
self.open_html_help,
whats_this="Topographic and geological profiles Help",
parent=self.iface.mainWindow())
self.iface.addPluginToMenu(self.plugin_name,
self.qactOpenHelp)
def unload(self):
# Remove the plugin menu item and icon
self.iface.removePluginMenu(self.plugin_name, self.qactMain)
self.iface.removePluginMenu(self.plugin_name, self.qactOpenHelp)
def run(self):
# create the dialog
dlg = MainDialog()
# show the dialog
dlg.show()
dlg.exec_()
def open_html_help(self):
# create the dialog
dlg = HelpDialog()
# show the dialog
dlg.show()
dlg.exec_()