[Kde-imaging] extragear/libs/kipi-plugins/gpssync
Gilles Caulier
caulier.gilles at free.fr
Mon Sep 25 16:27:31 CEST 2006
SVN commit 588294 by cgilles:
kipi-plugins from trunk : GPSSync tool : add links to external web tools to get GPS coordinate. First one is CapeLinks web site...
CCMAIL: kde-imaging at kde.org, alexios.beveratos at gmail.com, gerhard at kulzer.net
CCBUGS: 133359, 111560
M +45 -3 gpseditdialog.cpp
M +1 -0 gpseditdialog.h
--- trunk/extragear/libs/kipi-plugins/gpssync/gpseditdialog.cpp #588293:588294
@@ -22,6 +22,8 @@
#include <qlabel.h>
#include <qlayout.h>
+#include <qcombobox.h>
+#include <qpushbutton.h>
// KDE includes.
@@ -44,13 +46,25 @@
public:
+ enum WebGPSLocator
+ {
+ CapeLinks = 0
+ // TODO : Added here others web GPS coordinates locator
+ };
+
GPSEditDialogDialogPrivate()
{
altitudeInput = 0;
latitudeInput = 0;
longitudeInput = 0;
+ gpsButton = 0;
+ gpsCombo = 0;
}
+ QPushButton *gpsButton;
+
+ QComboBox *gpsCombo;
+
KDoubleSpinBox *altitudeInput;
KDoubleSpinBox *latitudeInput;
KDoubleSpinBox *longitudeInput;
@@ -67,7 +81,7 @@
setHelp("gpssync", "kipi-plugins");
setButtonText(User1, i18n("Delete"));
- QGridLayout* grid = new QGridLayout(plainPage(), 2, 1, 0, spacingHint());
+ QGridLayout* grid = new QGridLayout(plainPage(), 3, 1, 0, spacingHint());
QLabel *altitudeLabel = new QLabel(i18n("Altitude:"), plainPage());
QLabel *latitudeLabel = new QLabel(i18n("Latitude:"), plainPage());
@@ -76,19 +90,29 @@
d->latitudeInput = new KDoubleSpinBox(plainPage());
d->longitudeInput = new KDoubleSpinBox(plainPage());
d->altitudeInput->setRange(-20000.0, 20000.0, 1.0, 1);
- d->latitudeInput->setRange(-90.0, 90.0, 1E-6, 8);
- d->longitudeInput->setRange(-180.0, 180.0, 1E-6, 8);
+ d->latitudeInput->setRange(-90.0, 90.0, 1E-6, 6);
+ d->longitudeInput->setRange(-180.0, 180.0, 1E-6, 6);
d->altitudeInput->setValue(gpsData.altitude());
d->latitudeInput->setValue(gpsData.latitude());
d->longitudeInput->setValue(gpsData.longitude());
+ d->gpsCombo = new QComboBox( false, plainPage() );
+ d->gpsButton = new QPushButton(i18n("Get GPS Coordinates..."), plainPage());
+ d->gpsCombo->insertItem(QString("Capelinks"), GPSEditDialogDialogPrivate::CapeLinks);
+ // TODO : Added here others web GPS coordinates locator
+
grid->addMultiCellWidget(altitudeLabel, 0, 0, 0, 0);
grid->addMultiCellWidget(latitudeLabel, 1, 1, 0, 0);
grid->addMultiCellWidget(longitudeLabel, 2, 2, 0, 0);
grid->addMultiCellWidget(d->altitudeInput, 0, 0, 1, 1);
grid->addMultiCellWidget(d->latitudeInput, 1, 1, 1, 1);
grid->addMultiCellWidget(d->longitudeInput, 2, 2, 1, 1);
+ grid->addMultiCellWidget(d->gpsCombo, 3, 3, 0, 0 );
+ grid->addMultiCellWidget(d->gpsButton, 3, 3, 1, 1 );
+ connect(d->gpsButton, SIGNAL(clicked()),
+ this, SLOT(slotGPSLocator()));
+
adjustSize();
}
@@ -110,4 +134,22 @@
done(-1);
}
+void GPSEditDialog::slotGPSLocator()
+{
+ QString val, url;
+
+ switch( d->gpsCombo->currentItem() )
+ {
+ case GPSEditDialogDialogPrivate::CapeLinks:
+ {
+ url.append("http://www.capelinks.com/cape-cod/maps/gps");
+ break;
+ }
+
+ // TODO : Added here others web GPS coordinates locator
+ }
+
+ KApplication::kApplication()->invokeBrowser(url);
+}
+
} // namespace KIPIGPSSyncPlugin
--- trunk/extragear/libs/kipi-plugins/gpssync/gpseditdialog.h #588293:588294
@@ -49,6 +49,7 @@
protected slots:
void slotUser1();
+ void slotGPSLocator();
private:
More information about the Kde-imaging
mailing list