[Digikam-devel] [Bug 133359] WISH: Google maps support to show satellite images of the photos
Gilles Caulier
caulier.gilles at free.fr
Wed Sep 27 09:52:59 BST 2006
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=133359
------- Additional Comments From caulier.gilles free fr 2006-09-27 10:52 -------
SVN commit 588865 by cgilles:
kipi-plugins from trunk : GPSSync tool : use a KHTMLPart widget to embed web locator page in GPS positions editor dialog
CCMAIL: gerhard kulzer net
CCBUGS: 133359, 111560
M +1 -1 Makefile.am
M +22 -16 gpseditdialog.cpp
M +1 -1 gpseditdialog.h
M +5 -0 gpssyncdialog.cpp
--- trunk/extragear/libs/kipi-plugins/gpssync/Makefile.am #588864:588865
@ -14,7 +14,7 @
# Libs needed by the plugin
kipiplugin_gpssync_la_LIBADD = $(top_builddir)/kipi-plugins/common/exiv2iface/libexiv2iface.la \
- $(LIBKIPI_LIBS) $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_QT)
+ $(LIBKIPI_LIBS) $(LIB_KDEUI) $(LIB_KHTML) $(LIB_KDECORE) $(LIB_QT)
# LD flags for the plugin
kipiplugin_gpssync_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries)
--- trunk/extragear/libs/kipi-plugins/gpssync/gpseditdialog.cpp #588864:588865
@ -21,6 +21,7 @
// Qt includes.
#include <qlabel.h>
+#include <qframe.h>
#include <qlayout.h>
#include <qcombobox.h>
#include <qpushbutton.h>
@ -34,6 +35,8 @
#include <kapplication.h>
#include <klineedit.h>
#include <kmessagebox.h>
+#include <khtml_part.h>
+#include <khtmlview.h>
// Local includes.
@ -60,17 +63,17 @
altitudeInput = 0;
latitudeInput = 0;
longitudeInput = 0;
- gpsButton = 0;
gpsCombo = 0;
+ worldMap = 0;
}
- QPushButton *gpsButton;
-
QComboBox *gpsCombo;
KLineEdit *altitudeInput;
KLineEdit *latitudeInput;
KLineEdit *longitudeInput;
+
+ KHTMLPart *worldMap;
};
GPSEditDialog::GPSEditDialog(QWidget* parent, GPSDataContainer gpsData,
@ -84,7 +87,7 @
setHelp("gpssync", "kipi-plugins");
setButtonText(User1, i18n("Delete"));
- QGridLayout* grid = new QGridLayout(plainPage(), 3, 2, 0, spacingHint());
+ QGridLayout* grid = new QGridLayout(plainPage(), 4, 3, 0, spacingHint());
QLabel *altitudeLabel = new QLabel(i18n("Altitude:"), plainPage());
QLabel *latitudeLabel = new QLabel(i18n("Latitude:"), plainPage());
@ -106,8 +109,12 @
d->latitudeInput->setText(QString::number(gpsData.latitude(), 'g', 12));
d->longitudeInput->setText(QString::number(gpsData.longitude(), 'g', 12));
+ d->worldMap = new KHTMLPart(plainPage());
+ /*d->worldMap->openURL(KURL("/home/gilles/Documents/Devel/SVN/trunk/extragear/libs/kipi-plugins/gpssync/getlonlat.html"));*/
+ d->worldMap->view()->resize(640, 480);
+ d->worldMap->show();
+
d->gpsCombo = new QComboBox( false, plainPage() );
- d->gpsButton = new QPushButton(i18n("Get GPS Coordinates..."), plainPage());
d->gpsCombo->insertItem(QString("Capelinks"), GPSEditDialogDialogPrivate::CapeLinks);
d->gpsCombo->insertItem(QString("MapKi"), GPSEditDialogDialogPrivate::MapKi);
@ -123,10 +130,12 @
grid->addMultiCellWidget(latResetButton, 1, 1, 2, 2);
grid->addMultiCellWidget(lonResetButton, 2, 2, 2, 2);
grid->addMultiCellWidget(d->gpsCombo, 3, 3, 0, 0);
- grid->addMultiCellWidget(d->gpsButton, 3, 3, 1, 2);
+ grid->addMultiCellWidget(d->worldMap->view(), 0, 4, 3, 3);
+ grid->setColStretch(3, 10);
+ grid->setRowStretch(4, 10);
- connect(d->gpsButton, SIGNAL(clicked()),
- this, SLOT(slotGPSLocator()));
+ connect(d->gpsCombo, SIGNAL(activated(int)),
+ this, SLOT(slotGPSLocator(int)));
connect(altResetButton, SIGNAL(clicked()),
d->altitudeInput, SLOT(clear()));
@ -138,6 +147,7 @
d->longitudeInput, SLOT(clear()));
adjustSize();
+ slotGPSLocator(d->gpsCombo->currentItem());
}
GPSEditDialog::~GPSEditDialog()
@ -186,28 +196,24 @
done(-1);
}
-void GPSEditDialog::slotGPSLocator()
+void GPSEditDialog::slotGPSLocator(int i)
{
- QString val, url;
-
- switch( d->gpsCombo->currentItem() )
+ switch(i)
{
case GPSEditDialogDialogPrivate::CapeLinks:
{
- url.append("http://www.capelinks.com/cape-cod/maps/gps");
+ d->worldMap->openURL(KURL("http://www.capelinks.com/cape-cod/maps/gps"));
break;
}
case GPSEditDialogDialogPrivate::MapKi:
{
- url.append("http://mapki.com/getLonLat.php");
+ d->worldMap->openURL(KURL("http://mapki.com/getLonLat.php"));
break;
}
// TODO : Added here others web GPS coordinates locator
}
-
- KApplication::kApplication()->invokeBrowser(url);
}
} // namespace KIPIGPSSyncPlugin
--- trunk/extragear/libs/kipi-plugins/gpssync/gpseditdialog.h #588864:588865
@ -50,7 +50,7 @
void slotOk();
void slotUser1();
- void slotGPSLocator();
+ void slotGPSLocator(int);
private:
--- trunk/extragear/libs/kipi-plugins/gpssync/gpssyncdialog.cpp #588864:588865
@ -427,6 +427,8 @
void GPSSyncDialog::slotApply()
{
+ KURL::List images;
+
QListViewItemIterator it( d->listView );
while ( it.current() )
{
@ -434,12 +436,15 @
d->listView->setSelected(item, true);
d->listView->ensureItemVisible(item);
item->writeGPSInfoToFile();
+ images.append(item->getUrl());
// TODO : new libkipi method to store GPS info in host database.
++it;
kapp->processEvents();
}
+
+ d->interface->refreshImages(images);
}
} // NameSpace KIPIGPSSyncPlugin
More information about the Digikam-devel
mailing list