-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathui_osgr.py
300 lines (294 loc) · 18.8 KB
/
ui_osgr.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui_osgr.ui'
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_osgr(object):
def setupUi(self, osgr):
osgr.setObjectName("osgr")
osgr.setEnabled(True)
osgr.resize(299, 356)
self.verticalLayout_4 = QtWidgets.QVBoxLayout(osgr)
self.verticalLayout_4.setObjectName("verticalLayout_4")
self.groupBox = QtWidgets.QGroupBox(osgr)
self.groupBox.setObjectName("groupBox")
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.groupBox)
self.verticalLayout_3.setObjectName("verticalLayout_3")
self.cboPrecision = QtWidgets.QComboBox(self.groupBox)
self.cboPrecision.setObjectName("cboPrecision")
self.cboPrecision.addItem("")
self.cboPrecision.addItem("")
self.cboPrecision.addItem("")
self.cboPrecision.addItem("")
self.cboPrecision.addItem("")
self.cboPrecision.addItem("")
self.cboPrecision.addItem("")
self.cboPrecision.addItem("")
self.verticalLayout_3.addWidget(self.cboPrecision)
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.label = QtWidgets.QLabel(self.groupBox)
self.label.setObjectName("label")
self.horizontalLayout.addWidget(self.label)
self.dsbGridSize = QtWidgets.QDoubleSpinBox(self.groupBox)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.dsbGridSize.sizePolicy().hasHeightForWidth())
self.dsbGridSize.setSizePolicy(sizePolicy)
self.dsbGridSize.setDecimals(3)
self.dsbGridSize.setMaximum(100000000.0)
self.dsbGridSize.setSingleStep(1.0)
self.dsbGridSize.setObjectName("dsbGridSize")
self.horizontalLayout.addWidget(self.dsbGridSize)
self.verticalLayout_3.addLayout(self.horizontalLayout)
self.horizontalLayout_7 = QtWidgets.QHBoxLayout()
self.horizontalLayout_7.setObjectName("horizontalLayout_7")
self.rbOutCrsBritish = QtWidgets.QRadioButton(self.groupBox)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.rbOutCrsBritish.sizePolicy().hasHeightForWidth())
self.rbOutCrsBritish.setSizePolicy(sizePolicy)
self.rbOutCrsBritish.setMinimumSize(QtCore.QSize(50, 0))
self.rbOutCrsBritish.setChecked(True)
self.rbOutCrsBritish.setObjectName("rbOutCrsBritish")
self.horizontalLayout_7.addWidget(self.rbOutCrsBritish)
self.rbOutCrsIrish = QtWidgets.QRadioButton(self.groupBox)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.rbOutCrsIrish.sizePolicy().hasHeightForWidth())
self.rbOutCrsIrish.setSizePolicy(sizePolicy)
self.rbOutCrsIrish.setMinimumSize(QtCore.QSize(50, 0))
self.rbOutCrsIrish.setObjectName("rbOutCrsIrish")
self.horizontalLayout_7.addWidget(self.rbOutCrsIrish)
self.rbOutCrsOther = QtWidgets.QRadioButton(self.groupBox)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.rbOutCrsOther.sizePolicy().hasHeightForWidth())
self.rbOutCrsOther.setSizePolicy(sizePolicy)
self.rbOutCrsOther.setMinimumSize(QtCore.QSize(50, 0))
self.rbOutCrsOther.setObjectName("rbOutCrsOther")
self.horizontalLayout_7.addWidget(self.rbOutCrsOther)
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_7.addItem(spacerItem)
self.verticalLayout_3.addLayout(self.horizontalLayout_7)
self.verticalLayout_4.addWidget(self.groupBox)
self.gbGridRef = QtWidgets.QGroupBox(osgr)
self.gbGridRef.setMinimumSize(QtCore.QSize(0, 86))
self.gbGridRef.setObjectName("gbGridRef")
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.gbGridRef)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.leOSGR = QtWidgets.QLineEdit(self.gbGridRef)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.leOSGR.sizePolicy().hasHeightForWidth())
self.leOSGR.setSizePolicy(sizePolicy)
self.leOSGR.setText("")
self.leOSGR.setObjectName("leOSGR")
self.horizontalLayout_3.addWidget(self.leOSGR)
self.butZoom = QtWidgets.QPushButton(self.gbGridRef)
self.butZoom.setMinimumSize(QtCore.QSize(0, 0))
self.butZoom.setMaximumSize(QtCore.QSize(16777215, 16777215))
self.butZoom.setObjectName("butZoom")
self.horizontalLayout_3.addWidget(self.butZoom)
self.butPan = QtWidgets.QPushButton(self.gbGridRef)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.butPan.sizePolicy().hasHeightForWidth())
self.butPan.setSizePolicy(sizePolicy)
self.butPan.setMinimumSize(QtCore.QSize(0, 0))
self.butPan.setMaximumSize(QtCore.QSize(16777215, 16777215))
self.butPan.setObjectName("butPan")
self.horizontalLayout_3.addWidget(self.butPan)
self.verticalLayout_2.addLayout(self.horizontalLayout_3)
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.cbGROnClick = QtWidgets.QCheckBox(self.gbGridRef)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.cbGROnClick.sizePolicy().hasHeightForWidth())
self.cbGROnClick.setSizePolicy(sizePolicy)
self.cbGROnClick.setObjectName("cbGROnClick")
self.horizontalLayout_4.addWidget(self.cbGROnClick)
self.cbGRShowSquare = QtWidgets.QCheckBox(self.gbGridRef)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.cbGRShowSquare.sizePolicy().hasHeightForWidth())
self.cbGRShowSquare.setSizePolicy(sizePolicy)
self.cbGRShowSquare.setObjectName("cbGRShowSquare")
self.horizontalLayout_4.addWidget(self.cbGRShowSquare)
self.cbGRShowPoint = QtWidgets.QCheckBox(self.gbGridRef)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.cbGRShowPoint.sizePolicy().hasHeightForWidth())
self.cbGRShowPoint.setSizePolicy(sizePolicy)
self.cbGRShowPoint.setObjectName("cbGRShowPoint")
self.horizontalLayout_4.addWidget(self.cbGRShowPoint)
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_4.addItem(spacerItem1)
self.verticalLayout_2.addLayout(self.horizontalLayout_4)
self.verticalLayout_4.addWidget(self.gbGridRef)
self.gpGridSquares = QtWidgets.QGroupBox(osgr)
self.gpGridSquares.setMinimumSize(QtCore.QSize(0, 119))
self.gpGridSquares.setObjectName("gpGridSquares")
self.verticalLayout = QtWidgets.QVBoxLayout(self.gpGridSquares)
self.verticalLayout.setObjectName("verticalLayout")
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.butGridTool = QtWidgets.QPushButton(self.gpGridSquares)
self.butGridTool.setMinimumSize(QtCore.QSize(30, 30))
self.butGridTool.setMaximumSize(QtCore.QSize(30, 30))
self.butGridTool.setText("")
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap("images/osgr.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.butGridTool.setIcon(icon)
self.butGridTool.setIconSize(QtCore.QSize(26, 26))
self.butGridTool.setCheckable(True)
self.butGridTool.setFlat(False)
self.butGridTool.setObjectName("butGridTool")
self.horizontalLayout_2.addWidget(self.butGridTool)
self.butGridPoly = QtWidgets.QPushButton(self.gpGridSquares)
self.butGridPoly.setMinimumSize(QtCore.QSize(30, 30))
self.butGridPoly.setMaximumSize(QtCore.QSize(30, 30))
self.butGridPoly.setText("")
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap("images/osgrPoly.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.butGridPoly.setIcon(icon1)
self.butGridPoly.setIconSize(QtCore.QSize(26, 26))
self.butGridPoly.setCheckable(False)
self.butGridPoly.setObjectName("butGridPoly")
self.horizontalLayout_2.addWidget(self.butGridPoly)
self.butPaste = QtWidgets.QPushButton(self.gpGridSquares)
self.butPaste.setMinimumSize(QtCore.QSize(30, 30))
self.butPaste.setMaximumSize(QtCore.QSize(30, 30))
self.butPaste.setText("")
icon2 = QtGui.QIcon()
icon2.addPixmap(QtGui.QPixmap("images/osgrPaste.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.butPaste.setIcon(icon2)
self.butPaste.setIconSize(QtCore.QSize(26, 26))
self.butPaste.setCheckable(False)
self.butPaste.setObjectName("butPaste")
self.horizontalLayout_2.addWidget(self.butPaste)
self.butClear = QtWidgets.QPushButton(self.gpGridSquares)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.butClear.sizePolicy().hasHeightForWidth())
self.butClear.setSizePolicy(sizePolicy)
self.butClear.setMinimumSize(QtCore.QSize(30, 30))
self.butClear.setMaximumSize(QtCore.QSize(30, 30))
self.butClear.setText("")
icon3 = QtGui.QIcon()
icon3.addPixmap(QtGui.QPixmap("images/cross.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.butClear.setIcon(icon3)
self.butClear.setIconSize(QtCore.QSize(30, 30))
self.butClear.setObjectName("butClear")
self.horizontalLayout_2.addWidget(self.butClear)
spacerItem2 = QtWidgets.QSpacerItem(30, 30, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem2)
self.butHelp = QtWidgets.QPushButton(self.gpGridSquares)
self.butHelp.setMinimumSize(QtCore.QSize(30, 30))
self.butHelp.setMaximumSize(QtCore.QSize(30, 30))
self.butHelp.setText("")
icon4 = QtGui.QIcon()
icon4.addPixmap(QtGui.QPixmap("images/info.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.butHelp.setIcon(icon4)
self.butHelp.setIconSize(QtCore.QSize(24, 24))
self.butHelp.setObjectName("butHelp")
self.horizontalLayout_2.addWidget(self.butHelp)
self.butGithub = QtWidgets.QPushButton(self.gpGridSquares)
self.butGithub.setMinimumSize(QtCore.QSize(30, 30))
self.butGithub.setMaximumSize(QtCore.QSize(30, 30))
self.butGithub.setText("")
icon5 = QtGui.QIcon()
icon5.addPixmap(QtGui.QPixmap("images/github.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.butGithub.setIcon(icon5)
self.butGithub.setIconSize(QtCore.QSize(24, 24))
self.butGithub.setObjectName("butGithub")
self.horizontalLayout_2.addWidget(self.butGithub)
self.verticalLayout.addLayout(self.horizontalLayout_2)
self.cbLabel = QtWidgets.QCheckBox(self.gpGridSquares)
self.cbLabel.setChecked(True)
self.cbLabel.setObjectName("cbLabel")
self.verticalLayout.addWidget(self.cbLabel)
self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
self.pbGridSquares = QtWidgets.QProgressBar(self.gpGridSquares)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.pbGridSquares.sizePolicy().hasHeightForWidth())
self.pbGridSquares.setSizePolicy(sizePolicy)
self.pbGridSquares.setProperty("value", 0)
self.pbGridSquares.setObjectName("pbGridSquares")
self.horizontalLayout_5.addWidget(self.pbGridSquares)
self.butCancel = QtWidgets.QPushButton(self.gpGridSquares)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.butCancel.sizePolicy().hasHeightForWidth())
self.butCancel.setSizePolicy(sizePolicy)
self.butCancel.setMinimumSize(QtCore.QSize(0, 0))
self.butCancel.setMaximumSize(QtCore.QSize(16777215, 16777215))
self.butCancel.setObjectName("butCancel")
self.horizontalLayout_5.addWidget(self.butCancel)
self.verticalLayout.addLayout(self.horizontalLayout_5)
spacerItem3 = QtWidgets.QSpacerItem(20, 5, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem3)
self.verticalLayout_4.addWidget(self.gpGridSquares)
self.retranslateUi(osgr)
self.cboPrecision.setCurrentIndex(2)
QtCore.QMetaObject.connectSlotsByName(osgr)
def retranslateUi(self, osgr):
_translate = QtCore.QCoreApplication.translate
osgr.setWindowTitle(_translate("osgr", "Form"))
self.groupBox.setTitle(_translate("osgr", "Grid size / Grid Ref precision"))
self.cboPrecision.setToolTip(_translate("osgr", "Set the OSGR precision."))
self.cboPrecision.setItemText(0, _translate("osgr", "10 figure"))
self.cboPrecision.setItemText(1, _translate("osgr", "8 figure"))
self.cboPrecision.setItemText(2, _translate("osgr", "6 figure"))
self.cboPrecision.setItemText(3, _translate("osgr", "Monad (1 km square)"))
self.cboPrecision.setItemText(4, _translate("osgr", "Tetrad (2 km square)"))
self.cboPrecision.setItemText(5, _translate("osgr", "Quadrant (5 km square)"))
self.cboPrecision.setItemText(6, _translate("osgr", "Hectad (10 km square)"))
self.cboPrecision.setItemText(7, _translate("osgr", "100 km square"))
self.label.setText(_translate("osgr", "Grid size:"))
self.dsbGridSize.setToolTip(_translate("osgr", "Set a size for the grid squares in the unitsused by the current project map CRS."))
self.rbOutCrsBritish.setText(_translate("osgr", "British"))
self.rbOutCrsIrish.setText(_translate("osgr", "Irish"))
self.rbOutCrsOther.setText(_translate("osgr", "Other"))
self.gbGridRef.setTitle(_translate("osgr", "Grid Ref at mouse cursor"))
self.leOSGR.setToolTip(_translate("osgr", "<html><head/><body><p>Grid reference at mouse location or grid reference to which you want to navigate.</p></body></html>"))
self.butZoom.setToolTip(_translate("osgr", "<html><head/><body><p>Zoom the map to the specified grid reference.</p></body></html>"))
self.butZoom.setText(_translate("osgr", "Zoom"))
self.butPan.setToolTip(_translate("osgr", "<html><head/><body><p>Pan the map to the specified grid reference.</p></body></html>"))
self.butPan.setText(_translate("osgr", "Pan"))
self.cbGROnClick.setToolTip(_translate("osgr", "<html><head/><body><p>Update grid reference only when map is clicked.</p></body></html>"))
self.cbGROnClick.setText(_translate("osgr", "On click"))
self.cbGRShowSquare.setToolTip(_translate("osgr", "<html><head/><body><p>Show grid square corresponding to grid reference.</p></body></html>"))
self.cbGRShowSquare.setText(_translate("osgr", "Show square"))
self.cbGRShowPoint.setToolTip(_translate("osgr", "<html><head/><body><p>Show centre point of grid square corresponding to grid reference.</p></body></html>"))
self.cbGRShowPoint.setText(_translate("osgr", "Show point"))
self.gpGridSquares.setTitle(_translate("osgr", "Grid squares"))
self.butGridTool.setToolTip(_translate("osgr", "<html><head/><body><p>With this tool selected, drag a box over the map to generate grid squares.</p></body></html>"))
self.butGridPoly.setToolTip(_translate("osgr", "<html><head/><body><p>With a feature selected, click this tool to generate grid squares over the feature.</p></body></html>"))
self.butPaste.setToolTip(_translate("osgr", "<html><head/><body><p>This button will create grid squares from grid references in the clipboard.</p></body></html>"))
self.butClear.setToolTip(_translate("osgr", "<html><head/><body><p>Delete all generated grid squares.</p></body></html>"))
self.butHelp.setToolTip(_translate("osgr", "<html><head/><body><p><span style=\" font-size:12pt;\">Get more information about this tool and help on using it. This links to a webpage with up-to-date information about the tool. </span></p></body></html>"))
self.butGithub.setToolTip(_translate("osgr", "<html><head/><body><p><span style=\" font-size:12pt; font-weight:600;\">Report an issue with this tool.</span><span style=\" font-size:12pt;\"> Using this channel is the best way to get attention quickly. Issues can be bug reports, enhancement requests or just questions. Anyone can view current issues, but to add a new issue you will need to sign up for a free Github account (very easy).</span></p></body></html>"))
self.cbLabel.setToolTip(_translate("osgr", "<html><head/><body><p>Indicates whether or not to show labels for generated grids.</p></body></html>"))
self.cbLabel.setText(_translate("osgr", "Label"))
self.butCancel.setToolTip(_translate("osgr", "<html><head/><body><p>Interrupt the generation of grid squares.</p></body></html>"))
self.butCancel.setText(_translate("osgr", "Cancel"))