Skip to content
Permalink
Browse files
Some usability, i18n and debug changes on GPS importer (and gpxprovid…
…er). Handles #804.

git-svn-id: http://svn.osgeo.org/qgis/trunk@7779 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
homann committed Dec 13, 2007
1 parent b4f3ff3 commit 70a241b1a0a82c56840eb9caca7ea3d15792218f
@@ -246,6 +246,9 @@ void QgsGPSPlugin::importGPSFile(QString inputFilename, QgsBabelFormat* importer
QStringList babelArgs =
importer->importCommand(mBabelPath, typeArg,
inputFilename, outputFilename);

QgsDebugMsg(QString("Import command: ") + babelArgs.join("|"));

Q3Process babelProcess(babelArgs);
if (!babelProcess.start()) {
QMessageBox::warning(NULL, tr("Could not start process"),
@@ -314,7 +317,7 @@ void QgsGPSPlugin::convertGPSFile(QString inputFilename,
QStringList babelArgs;
babelArgs << mBabelPath << "-i"<<"gpx"<<"-f"<< inputFilename
<< convertStrings <<"-o"<<"gpx"<<"-F"<< outputFilename;
QgsDebugMsg(QString("Conversion command: ") + babelArgs.join("_"));
QgsDebugMsg(QString("Conversion command: ") + babelArgs.join("|"));

Q3Process babelProcess(babelArgs);
if (!babelProcess.start()) {
@@ -394,6 +397,10 @@ void QgsGPSPlugin::downloadFromGPS(QString device, QString port,
tr("of ")) + features + ".");
return;
}


QgsDebugMsg(QString("Download command: ") + babelArgs.join("|"));

Q3Process babelProcess(babelArgs);
if (!babelProcess.start()) {
QMessageBox::warning(NULL, tr("Could not start process"),
@@ -476,6 +483,9 @@ void QgsGPSPlugin::uploadToGPS(QgsVectorLayer* gpxLayer, QString device,
features + ".");
return;
}

QgsDebugMsg(QString("Upload command: ") + babelArgs.join("|"));

Q3Process babelProcess(babelArgs);
if (!babelProcess.start()) {
QMessageBox::warning(NULL, tr("Could not start process"),
@@ -91,11 +91,11 @@ void QgsGPSPluginGui::on_buttonBox_accepted()

// or import other file?
case 1: {
const QString& typeString(cmbDLFeatureType->currentText());
const QString& typeString(cmbIMPFeature->currentText());
emit importGPSFile(leIMPInput->text(),
mImporters.find(mImpFormat)->second,
typeString == "Waypoints", typeString == "Routes",
typeString == "Tracks", leIMPOutput->text(),
typeString == tr("Waypoints"), typeString == tr("Routes"),
typeString == tr("Tracks"), leIMPOutput->text(),
leIMPLayer->text());
break;
}
@@ -123,7 +123,9 @@ void QgsGPSPluginGui::on_buttonBox_accepted()
break;
}
}
accept();
// The slots that are called above will emit closeGui() when successfull.
// If not succesfull, the user will get another shot without starting from scratch
// accept();
}


@@ -253,11 +255,11 @@ void QgsGPSPluginGui::on_pbnIMPInput_clicked() {
leIMPInput->setText(myFileName);
cmbIMPFeature->clear();
if (iter->second->supportsWaypoints())
cmbIMPFeature->insertItem("Waypoints");
cmbIMPFeature->insertItem(tr("Waypoints"));
if (iter->second->supportsRoutes())
cmbIMPFeature->insertItem("Routes");
cmbIMPFeature->insertItem(tr("Routes"));
if (iter->second->supportsTracks())
cmbIMPFeature->insertItem("Tracks");
cmbIMPFeature->insertItem(tr("Tracks"));
}
}
}
@@ -385,6 +387,7 @@ void QgsGPSPluginGui::populateIMPBabelFormats() {
BabelMap::const_iterator iter;
for (iter = mImporters.begin(); iter != mImporters.end(); ++iter)
mBabelFilter.append((const char*)iter->first).append(" (*.*);;");
mBabelFilter.chop(2); // Remove the trailing ;;, which otherwise leads to an empty filetype
int u = -1, d = -1;
std::map<QString, QgsGPSDevice*>::const_iterator iter2;
for (iter2 = mDevices.begin(); iter2 != mDevices.end(); ++iter2) {
@@ -233,7 +233,7 @@ p, li { white-space: pre-wrap; }
<widget class="QComboBox" name="cmbIMPFeature" >
<property name="minimumSize" >
<size>
<width>90</width>
<width>130</width>
<height>0</height>
</size>
</property>
@@ -246,6 +246,13 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="2" column="2" >
<widget class="QLabel" name="textLabel2_6" >
<property name="text" >
<string>(Note: Selecting correct file type in browser dialog important!)</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2" >
<widget class="QLineEdit" name="leIMPInput" >
<property name="enabled" >
@@ -125,7 +125,6 @@ bool QgsGPXProvider::getNextFeature(QgsFeature& feature)

QgsAttributeList::const_iterator iter;

QgsDebugMsg("*** GPX ***");
if (mFeatureType == WaypointType)
{
// go through the list of waypoints and return the first one that is in

0 comments on commit 70a241b

Please sign in to comment.