Skip to content

File tree

3 files changed

+83
-24
lines changed

3 files changed

+83
-24
lines changed
 

‎src/plugins/gps_importer/qgsgpsplugingui.cpp

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ QgsGPSPluginGui::QgsGPSPluginGui(const BabelMap& importers,
3737
populatePortComboBoxes();
3838
populateULLayerComboBox();
3939
populateIMPBabelFormats();
40+
populateLoadDialog();
41+
populateULDialog();
42+
populateDLDialog();
43+
populateIMPDialog();
4044
populateCONVDialog();
4145

4246
connect(pbULEditDevices, SIGNAL(clicked()), this, SLOT(openDeviceEditor()));
@@ -404,6 +408,73 @@ void QgsGPSPluginGui::populateIMPBabelFormats() {
404408
cmbDLDevice->setCurrentItem(d);
405409
}
406410

411+
void QgsGPSPluginGui::populateLoadDialog() {
412+
413+
QString format = QString("<p>%1</p><p>%2</p>");
414+
415+
QString sentence1 = tr("GPX is the %1, which is used to store information about waypoints, routes, and tracks.").
416+
arg(QString("<a href=http://www.topografix.com/gpx.asp>%1</a>").arg(tr("GPS eXchange file format")));
417+
QString sentence2 = tr("Select a GPX file and then select the feature types that you want to load.");
418+
419+
QString text = format.arg(sentence1).arg(sentence2);
420+
421+
teLoadDescription->setHtml(text);
422+
QgsDebugMsg(text);
423+
}
424+
425+
void QgsGPSPluginGui::populateDLDialog() {
426+
427+
QString format = QString("<p>%1 %2 %3<p>%4 %5</p>");
428+
429+
QString sentence1 = tr("This tool will help you download data from a GPS device.");
430+
QString sentence2 = tr("Choose your GPS device, the port it is connected to, the feature type you want to download, a name for your new layer, and the GPX file where you want to store the data.");
431+
QString sentence3 = tr("If your device isn't listed, or if you want to change some settings, you can also edit the devices.");
432+
QString sentence4 = tr("This tool uses the program GPSBabel (%1) to transfer the data.")
433+
.arg("<a href=\"http://www.gpsbabel.org\">http://www.gpsbabel.org</a>");
434+
435+
QString sentence5 = tr("This requires that you have GPSBabel installed where QGIS can find it.");
436+
437+
QString text = format.arg(sentence1).arg(sentence2).arg(sentence3).arg(sentence4).arg(sentence5);
438+
439+
teDLDescription->setHtml(text);
440+
QgsDebugMsg(text);
441+
}
442+
443+
void QgsGPSPluginGui::populateULDialog() {
444+
445+
QString format = QString("<p>%1 %2 %3<p>%4 %5</p>");
446+
447+
QString sentence1 = tr("This tool will help you upload data from a GPX layer to a GPS device.");
448+
QString sentence2 = tr("Choose the layer you want to upload, the device you want to upload it to, and the port your device is connected to.");
449+
QString sentence3 = tr("If your device isn't listed, or if you want to change some settings, you can also edit the devices.");
450+
QString sentence4 = tr("This tool uses the program GPSBabel (%1) to transfer the data.")
451+
.arg("<a href=\"http://www.gpsbabel.org\">http://www.gpsbabel.org</a>");
452+
453+
QString sentence5 = tr("This requires that you have GPSBabel installed where QGIS can find it.");
454+
455+
QString text = format.arg(sentence1).arg(sentence2).arg(sentence3).arg(sentence4).arg(sentence5);
456+
457+
teULDescription->setHtml(text);
458+
QgsDebugMsg(text);
459+
}
460+
461+
void QgsGPSPluginGui::populateIMPDialog() {
462+
463+
QString format = QString("<p>%1 %2<p><p>%3 %4</p>");
464+
465+
QString sentence1 = tr("QGIS can only load GPX files by itself, but many other formats can be converted to GPX using GPSBabel (%1).")
466+
.arg("<a href=\"http://www.gpsbabel.org\">http://www.gpsbabel.org</a>");
467+
QString sentence2 = tr("This requires that you have GPSBabel installed where QGIS can find it.");
468+
QString sentence3 = tr("Select a GPS file format and the file that you want to import, the feature type that you want to use, a GPX filename that you want to save the converted file as, and a name for the new layer.");
469+
QString sentence4 = tr("All file formats can not store waypoints, routes, and tracks, so some feature types may be disabled for some file formats.");
470+
471+
QString text = format.arg(sentence1).arg(sentence2).arg(sentence3).arg(sentence4);
472+
473+
teIMPDescription->setHtml(text);
474+
QgsDebugMsg(text);
475+
}
476+
477+
407478
void QgsGPSPluginGui::populateCONVDialog() {
408479
cmbCONVType->insertItem(tr("Routes") + " -> " + tr("Waypoints"));
409480
cmbCONVType->insertItem(tr("Waypoints") + " -> " + tr("Routes"));

‎src/plugins/gps_importer/qgsgpsplugingui.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ public slots:
6363
void populateULLayerComboBox();
6464
void populateIMPBabelFormats();
6565
void populatePortComboBoxes();
66+
void populateLoadDialog();
67+
void populateDLDialog();
68+
void populateULDialog();
69+
void populateIMPDialog();
6670
void populateCONVDialog();
6771

6872
private slots:

‎src/plugins/gps_importer/qgsgpspluginguibase.ui

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
<number>6</number>
6666
</property>
6767
<item row="0" column="0" colspan="2" >
68-
<widget class="QTextEdit" name="textEdit" >
68+
<widget class="QTextEdit" name="teLoadDescription" >
6969
<property name="sizePolicy" >
7070
<sizepolicy>
7171
<hsizetype>7</hsizetype>
@@ -81,11 +81,7 @@
8181
<bool>true</bool>
8282
</property>
8383
<property name="html" >
84-
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
85-
p, li { white-space: pre-wrap; }
86-
&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
87-
&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:12pt;">&lt;span style=" font-size:10pt;">GPX is the &lt;/span>&lt;a href="http://www.topografix.com/gpx.asp">&lt;span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">GPS eXchange file format&lt;/span>&lt;/a>&lt;span style=" font-size:10pt;">, which is used to store information about waypoints, routes, and tracks.&lt;/span>&lt;/p>
88-
&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;">Select a GPX file and then select the feature types that you want to load.&lt;/p>&lt;/body>&lt;/html></string>
84+
<string></string>
8985
</property>
9086
</widget>
9187
</item>
@@ -166,16 +162,12 @@ p, li { white-space: pre-wrap; }
166162
<number>6</number>
167163
</property>
168164
<item row="0" column="0" colspan="4" >
169-
<widget class="QTextEdit" name="textEdit_2" >
165+
<widget class="QTextEdit" name="teIMPDescription" >
170166
<property name="readOnly" >
171167
<bool>true</bool>
172168
</property>
173169
<property name="html" >
174-
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
175-
p, li { white-space: pre-wrap; }
176-
&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
177-
&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:12pt;">&lt;span style=" font-size:10pt;">QGIS can only load GPX files by itself, but many other formats can be converted to GPX using GPSBabel (&lt;/span>&lt;a href="http://gpsbabel.sf.net">&lt;span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">http://gpsbabel.sf.net&lt;/span>&lt;/a>&lt;span style=" font-size:10pt;">). This requires that you have GPSBabel installed where QGIS can find it.&lt;/span>&lt;/p>
178-
&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;">Select a GPS file format and the file that you want to import, the feature type that you want to use, a GPX filename that you want to save the converted file as, and a name for the new layer. All file formats can not store waypoints, routes, and tracks, so some feature types may be disabled for some file formats.&lt;/p>&lt;/body>&lt;/html></string>
170+
<string></string>
179171
</property>
180172
</widget>
181173
</item>
@@ -281,16 +273,12 @@ p, li { white-space: pre-wrap; }
281273
<number>6</number>
282274
</property>
283275
<item row="0" column="0" colspan="5" >
284-
<widget class="QTextEdit" name="textEdit_3" >
276+
<widget class="QTextEdit" name="teDLDescription" >
285277
<property name="readOnly" >
286278
<bool>true</bool>
287279
</property>
288280
<property name="html" >
289-
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
290-
p, li { white-space: pre-wrap; }
291-
&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
292-
&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:12pt;">&lt;span style=" font-size:10pt;">This tool will help you download data from a GPS device. Choose your GPS device, the port it is connected to, the feature type you want to download, a name for your new layer, and the GPX file where you want to store the data. If your device isn't listed, or if you want to change some settings, you can also edit the devices.&lt;/span>&lt;/p>
293-
&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;">This tool uses the program GPSBabel (&lt;a href="http://gpsbabel.sf.net">&lt;span style=" text-decoration: underline; color:#0000ff;">http://gpsbabel.sf.net&lt;/span>&lt;/a>) to transfer the data. If you don't have GPSBabel installed where QGIS can find it, this tool will not work.&lt;/p>&lt;/body>&lt;/html></string>
281+
<string></string>
294282
</property>
295283
</widget>
296284
</item>
@@ -456,16 +444,12 @@ p, li { white-space: pre-wrap; }
456444
</spacer>
457445
</item>
458446
<item row="0" column="0" colspan="5" >
459-
<widget class="QTextEdit" name="textEdit_4" >
447+
<widget class="QTextEdit" name="teULDescription" >
460448
<property name="readOnly" >
461449
<bool>true</bool>
462450
</property>
463451
<property name="html" >
464-
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
465-
p, li { white-space: pre-wrap; }
466-
&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
467-
&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:12pt;">&lt;span style=" font-size:10pt;">This tool will help you upload data from a GPX layer to a GPS device. Choose the layer you want to upload, the device you want to upload it to, and the port your device is connected to. If your device isn't listed, or if you want to change some settings, you can also edit the devices.&lt;/span>&lt;/p>
468-
&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;">This tool uses the program GPSBabel (&lt;a href="http://gpsbabel.sf.net">&lt;span style=" text-decoration: underline; color:#0000ff;">http://gpsbabel.sf.net&lt;/span>&lt;/a>) to transfer the data. If you don't have GPSBabel installed where QGIS can find it, this tool will not work.&lt;/p>&lt;/body>&lt;/html></string>
452+
<string></string>
469453
</property>
470454
</widget>
471455
</item>

0 commit comments

Comments
 (0)
Please sign in to comment.