Skip to content

Commit 542339e

Browse files
author
timlinux
committedFeb 8, 2008
Allow large numbers to be entered (reverted to line edits)
Saved ui in qt4.2.x git-svn-id: http://svn.osgeo.org/qgis/trunk@8120 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 438f277 commit 542339e

File tree

2 files changed

+193
-157
lines changed

2 files changed

+193
-157
lines changed
 

‎src/plugins/grid_maker/plugingui.cpp

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ void QgsGridMakerPluginGui::on_buttonBox_accepted()
3939
//
4040
QgsLogger::debug("GrativuleCreator called with: " +
4141
leOutputShapeFile->text() + " " +
42-
spindblXInterval->text() + " " +
43-
spindblYInterval->text() + " " +
44-
QString::number(spindblMinX->value()) + " " +
45-
QString::number(spindblMinY->value()) + " " +
46-
QString::number(spindblMaxX->value()) + " " +
47-
QString::number(spindblMaxY->value()));
42+
leXInterval->text() + " " +
43+
leYInterval->text() + " " +
44+
leXLowerLeft->text() + " " +
45+
leYLowerLeft->text() + " " +
46+
leXUpperRight->text() + " " +
47+
leYUpperRight->text());
4848

4949
if (leOutputShapeFile->text().isEmpty())
5050
{
@@ -54,36 +54,36 @@ void QgsGridMakerPluginGui::on_buttonBox_accepted()
5454
}
5555

5656

57-
double myLongitudeInterval = spindblXInterval->value();
58-
double myLatitudeInterval = spindblYInterval->value();
59-
double myLongitudeOrigin = spindblMinX->value();
60-
double myLatitudeOrigin = spindblMinY->value();
61-
double myEndPointLongitude = spindblMaxX->value();
62-
double myEndPointLatitude = spindblMaxY->value();
57+
double myXInterval = leXInterval->text().toDouble();
58+
double myYInterval = leYInterval->text().toDouble();
59+
double myXOrigin = leXLowerLeft->text().toDouble();
60+
double myYOrigin = leYLowerLeft->text().toDouble();
61+
double myEndPointX = leXUpperRight->text().toDouble();
62+
double myEndPointY = leYUpperRight->text().toDouble();
6363

6464

6565
if (radPoint->isChecked())
6666
{
6767
GraticuleCreator myGraticuleCreator ( leOutputShapeFile->text());
6868
myGraticuleCreator.generatePointGraticule(
69-
myLongitudeInterval,
70-
myLatitudeInterval,
71-
myLongitudeOrigin,
72-
myLatitudeOrigin,
73-
myEndPointLongitude,
74-
myEndPointLatitude
69+
myXInterval,
70+
myYInterval,
71+
myXOrigin,
72+
myYOrigin,
73+
myEndPointX,
74+
myEndPointY
7575
);
7676
}
7777
else
7878
{
7979
GraticuleCreator myGraticuleCreator ( leOutputShapeFile->text());
8080
myGraticuleCreator.generatePolygonGraticule(
81-
myLongitudeInterval,
82-
myLatitudeInterval,
83-
myLongitudeOrigin,
84-
myLatitudeOrigin,
85-
myEndPointLongitude,
86-
myEndPointLatitude
81+
myXInterval,
82+
myYInterval,
83+
myXOrigin,
84+
myYOrigin,
85+
myEndPointX,
86+
myEndPointY
8787
);
8888
}
8989
//

‎src/plugins/grid_maker/pluginguibase.ui

Lines changed: 169 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -16,112 +16,50 @@
1616
<iconset/>
1717
</property>
1818
<layout class="QGridLayout" >
19-
<item row="0" column="0" colspan="2" >
20-
<widget class="QLabel" name="txtHeading" >
21-
<property name="font" >
22-
<font>
23-
<family>Sans Serif</family>
24-
<pointsize>24</pointsize>
25-
<weight>50</weight>
26-
<italic>false</italic>
27-
<bold>false</bold>
28-
<underline>false</underline>
29-
<strikeout>false</strikeout>
30-
</font>
31-
</property>
32-
<property name="text" >
33-
<string>Graticule Builder</string>
34-
</property>
35-
<property name="alignment" >
36-
<set>Qt::AlignCenter</set>
37-
</property>
38-
</widget>
39-
</item>
40-
<item rowspan="6" row="1" column="0" >
41-
<widget class="QLabel" name="label" >
42-
<property name="text" >
43-
<string/>
44-
</property>
45-
<property name="pixmap" >
46-
<pixmap resource="gridmaker_plugin.qrc" >:/grid_pic2.png</pixmap>
47-
</property>
48-
<property name="scaledContents" >
49-
<bool>true</bool>
50-
</property>
51-
</widget>
52-
</item>
53-
<item row="1" column="1" >
54-
<widget class="QTextEdit" name="textEdit" >
55-
<property name="readOnly" >
56-
<bool>true</bool>
57-
</property>
58-
<property name="html" >
59-
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
60-
p, li { white-space: pre-wrap; }
61-
&lt;/style>&lt;/head>&lt;body style=" font-family:'Lucida Grande'; font-size:13pt; font-weight:400; font-style:normal;">
62-
&lt;p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Arial'; font-size:11pt;">&lt;span style=" font-size:10pt;">This plugin will help you to build a graticule shapefile that you can use as an overlay within your qgis map viewer.&lt;/span>&lt;/p>
63-
&lt;p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Arial'; font-size:10pt;">Please enter all units in decimal degrees&lt;/p>&lt;/body>&lt;/html></string>
64-
</property>
65-
</widget>
66-
</item>
67-
<item row="2" column="1" >
68-
<widget class="QGroupBox" name="groupBox1" >
19+
<property name="margin" >
20+
<number>9</number>
21+
</property>
22+
<property name="spacing" >
23+
<number>6</number>
24+
</property>
25+
<item row="5" column="1" >
26+
<widget class="QGroupBox" name="groupBox_2" >
6927
<property name="title" >
70-
<string>Type</string>
28+
<string>Graticle size</string>
7129
</property>
72-
<layout class="QHBoxLayout" >
73-
<item>
74-
<widget class="QRadioButton" name="radPoint" >
75-
<property name="text" >
76-
<string>Point</string>
77-
</property>
78-
<property name="checked" >
79-
<bool>true</bool>
80-
</property>
81-
</widget>
30+
<layout class="QGridLayout" >
31+
<property name="margin" >
32+
<number>9</number>
33+
</property>
34+
<property name="spacing" >
35+
<number>6</number>
36+
</property>
37+
<item row="0" column="3" >
38+
<widget class="QLineEdit" name="leYInterval" />
8239
</item>
83-
<item>
84-
<widget class="QRadioButton" name="radPolygon" >
85-
<property name="text" >
86-
<string>Polygon</string>
87-
</property>
88-
</widget>
40+
<item row="0" column="1" >
41+
<widget class="QLineEdit" name="leXInterval" />
8942
</item>
90-
</layout>
91-
</widget>
92-
</item>
93-
<item row="3" column="1" >
94-
<widget class="QGroupBox" name="groupBox" >
95-
<property name="title" >
96-
<string>Origin (lower left)</string>
97-
</property>
98-
<layout class="QGridLayout" >
99-
<item row="0" column="0" >
100-
<widget class="QLabel" name="textLabel1" >
43+
<item row="0" column="2" >
44+
<widget class="QLabel" name="lblMinDistanceGap" >
10145
<property name="text" >
102-
<string>X</string>
46+
<string>Y Interval:</string>
10347
</property>
10448
<property name="buddy" >
105-
<cstring>spindblMinX</cstring>
49+
<cstring>leYInterval</cstring>
10650
</property>
10751
</widget>
10852
</item>
109-
<item row="0" column="1" >
110-
<widget class="QDoubleSpinBox" name="spindblMinX" />
111-
</item>
112-
<item row="0" column="2" >
113-
<widget class="QLabel" name="textLabel1_2" >
53+
<item row="0" column="0" >
54+
<widget class="QLabel" name="lblMinTimeGap" >
11455
<property name="text" >
115-
<string>Y</string>
56+
<string>X Interval:</string>
11657
</property>
11758
<property name="buddy" >
118-
<cstring>spindblMinY</cstring>
59+
<cstring>leXInterval</cstring>
11960
</property>
12061
</widget>
12162
</item>
122-
<item row="0" column="3" >
123-
<widget class="QDoubleSpinBox" name="spindblMinY" />
124-
</item>
12563
</layout>
12664
</widget>
12765
</item>
@@ -131,76 +69,104 @@ p, li { white-space: pre-wrap; }
13169
<string>End point (upper right)</string>
13270
</property>
13371
<layout class="QGridLayout" >
134-
<item row="0" column="0" >
135-
<widget class="QLabel" name="textLabel1_3" >
136-
<property name="text" >
137-
<string>X</string>
138-
</property>
139-
<property name="buddy" >
140-
<cstring>spindblMaxX</cstring>
141-
</property>
142-
</widget>
72+
<property name="margin" >
73+
<number>9</number>
74+
</property>
75+
<property name="spacing" >
76+
<number>6</number>
77+
</property>
78+
<item row="0" column="3" >
79+
<widget class="QLineEdit" name="leYUpperRight" />
14380
</item>
14481
<item row="0" column="1" >
145-
<widget class="QDoubleSpinBox" name="spindblMaxX" />
82+
<widget class="QLineEdit" name="leXUpperRight" />
14683
</item>
14784
<item row="0" column="2" >
14885
<widget class="QLabel" name="textLabel1_2_2" >
14986
<property name="text" >
15087
<string>Y</string>
15188
</property>
15289
<property name="buddy" >
153-
<cstring>spindblMaxY</cstring>
90+
<cstring>leYUpperRight</cstring>
15491
</property>
15592
</widget>
15693
</item>
157-
<item row="0" column="3" >
158-
<widget class="QDoubleSpinBox" name="spindblMaxY" />
94+
<item row="0" column="0" >
95+
<widget class="QLabel" name="textLabel1_3" >
96+
<property name="text" >
97+
<string>X</string>
98+
</property>
99+
<property name="buddy" >
100+
<cstring>leXUpperRight</cstring>
101+
</property>
102+
</widget>
159103
</item>
160104
</layout>
161105
</widget>
162106
</item>
163-
<item row="5" column="1" >
164-
<widget class="QGroupBox" name="groupBox_2" >
107+
<item row="3" column="1" >
108+
<widget class="QGroupBox" name="groupBox" >
165109
<property name="title" >
166-
<string>Graticle size</string>
110+
<string>Origin (lower left)</string>
167111
</property>
168112
<layout class="QGridLayout" >
169-
<item row="0" column="0" >
170-
<widget class="QLabel" name="lblMinTimeGap" >
113+
<property name="margin" >
114+
<number>9</number>
115+
</property>
116+
<property name="spacing" >
117+
<number>6</number>
118+
</property>
119+
<item row="0" column="3" >
120+
<widget class="QLineEdit" name="leYLowerLeft" />
121+
</item>
122+
<item row="0" column="1" >
123+
<widget class="QLineEdit" name="leXLowerLeft" />
124+
</item>
125+
<item row="0" column="2" >
126+
<widget class="QLabel" name="textLabel1_2" >
171127
<property name="text" >
172-
<string>X Interval:</string>
128+
<string>Y</string>
173129
</property>
174130
<property name="buddy" >
175-
<cstring>spindblXInterval</cstring>
131+
<cstring>leYLowerLeft</cstring>
176132
</property>
177133
</widget>
178134
</item>
179-
<item row="0" column="1" >
180-
<widget class="QDoubleSpinBox" name="spindblXInterval" />
181-
</item>
182-
<item row="0" column="2" >
183-
<widget class="QLabel" name="lblMinDistanceGap" >
135+
<item row="0" column="0" >
136+
<widget class="QLabel" name="textLabel1" >
184137
<property name="text" >
185-
<string>Y Interval:</string>
138+
<string>X</string>
186139
</property>
187140
<property name="buddy" >
188-
<cstring>spindblYInterval</cstring>
141+
<cstring>leXLowerLeft</cstring>
189142
</property>
190143
</widget>
191144
</item>
192-
<item row="0" column="3" >
193-
<widget class="QDoubleSpinBox" name="spindblYInterval" />
194-
</item>
195145
</layout>
196146
</widget>
197147
</item>
148+
<item row="7" column="0" colspan="2" >
149+
<widget class="QDialogButtonBox" name="buttonBox" >
150+
<property name="orientation" >
151+
<enum>Qt::Horizontal</enum>
152+
</property>
153+
<property name="standardButtons" >
154+
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
155+
</property>
156+
</widget>
157+
</item>
198158
<item row="6" column="1" >
199159
<widget class="QGroupBox" name="groupBox_4" >
200160
<property name="title" >
201161
<string>Output (shape) file</string>
202162
</property>
203163
<layout class="QHBoxLayout" >
164+
<property name="margin" >
165+
<number>11</number>
166+
</property>
167+
<property name="spacing" >
168+
<number>6</number>
169+
</property>
204170
<item>
205171
<widget class="QLineEdit" name="leOutputShapeFile" />
206172
</item>
@@ -214,31 +180,101 @@ p, li { white-space: pre-wrap; }
214180
</layout>
215181
</widget>
216182
</item>
217-
<item row="7" column="0" colspan="2" >
218-
<widget class="QDialogButtonBox" name="buttonBox" >
219-
<property name="orientation" >
220-
<enum>Qt::Horizontal</enum>
183+
<item row="2" column="1" >
184+
<widget class="QGroupBox" name="groupBox1" >
185+
<property name="title" >
186+
<string>Type</string>
221187
</property>
222-
<property name="standardButtons" >
223-
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
188+
<layout class="QHBoxLayout" >
189+
<property name="margin" >
190+
<number>11</number>
191+
</property>
192+
<property name="spacing" >
193+
<number>6</number>
194+
</property>
195+
<item>
196+
<widget class="QRadioButton" name="radPoint" >
197+
<property name="text" >
198+
<string>Point</string>
199+
</property>
200+
<property name="checked" >
201+
<bool>true</bool>
202+
</property>
203+
</widget>
204+
</item>
205+
<item>
206+
<widget class="QRadioButton" name="radPolygon" >
207+
<property name="text" >
208+
<string>Polygon</string>
209+
</property>
210+
</widget>
211+
</item>
212+
</layout>
213+
</widget>
214+
</item>
215+
<item row="1" column="1" >
216+
<widget class="QTextEdit" name="textEdit" >
217+
<property name="readOnly" >
218+
<bool>true</bool>
219+
</property>
220+
<property name="html" >
221+
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
222+
p, li { white-space: pre-wrap; }
223+
&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
224+
&lt;p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Arial'; font-size:11pt;">&lt;span style=" font-size:10pt;">This plugin will help you to build a graticule shapefile that you can use as an overlay within your qgis map viewer.&lt;/span>&lt;/p>
225+
&lt;p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Arial'; font-size:10pt;">Please enter all units in decimal degrees&lt;/p>&lt;/body>&lt;/html></string>
226+
</property>
227+
</widget>
228+
</item>
229+
<item rowspan="6" row="1" column="0" >
230+
<widget class="QLabel" name="label" >
231+
<property name="text" >
232+
<string/>
233+
</property>
234+
<property name="pixmap" >
235+
<pixmap resource="gridmaker_plugin.qrc" >:/grid_pic2.png</pixmap>
236+
</property>
237+
<property name="scaledContents" >
238+
<bool>true</bool>
239+
</property>
240+
</widget>
241+
</item>
242+
<item row="0" column="0" colspan="2" >
243+
<widget class="QLabel" name="txtHeading" >
244+
<property name="font" >
245+
<font>
246+
<family>Sans Serif</family>
247+
<pointsize>24</pointsize>
248+
<weight>50</weight>
249+
<italic>false</italic>
250+
<bold>false</bold>
251+
<underline>false</underline>
252+
<strikeout>false</strikeout>
253+
</font>
254+
</property>
255+
<property name="text" >
256+
<string>Graticule Builder</string>
257+
</property>
258+
<property name="alignment" >
259+
<set>Qt::AlignCenter</set>
224260
</property>
225261
</widget>
226262
</item>
227263
</layout>
228264
</widget>
229265
<layoutdefault spacing="6" margin="11" />
230266
<tabstops>
231-
<tabstop>textEdit</tabstop>
232267
<tabstop>radPoint</tabstop>
233268
<tabstop>radPolygon</tabstop>
234-
<tabstop>spindblMinX</tabstop>
235-
<tabstop>spindblMinY</tabstop>
236-
<tabstop>spindblMaxX</tabstop>
237-
<tabstop>spindblMaxY</tabstop>
238-
<tabstop>spindblXInterval</tabstop>
239-
<tabstop>spindblYInterval</tabstop>
269+
<tabstop>leXLowerLeft</tabstop>
270+
<tabstop>leYLowerLeft</tabstop>
271+
<tabstop>leXUpperRight</tabstop>
272+
<tabstop>leYUpperRight</tabstop>
273+
<tabstop>leXInterval</tabstop>
274+
<tabstop>leYInterval</tabstop>
240275
<tabstop>leOutputShapeFile</tabstop>
241276
<tabstop>pbnSelectOutputFile</tabstop>
277+
<tabstop>textEdit</tabstop>
242278
<tabstop>buttonBox</tabstop>
243279
</tabstops>
244280
<resources>

0 commit comments

Comments
 (0)
Please sign in to comment.