daemon mode and bugs fixes
[googlelatitude] / src / latitude.cpp
index aa742f1..7bdc14a 100644 (file)
@@ -26,6 +26,7 @@ LatitudeGUI::LatitudeGUI(QMainWindow *parent) : QMainWindow(parent) {
     // GUI
     url = QUrl::fromEncoded("https://www.google.com/accounts/ServiceLogin?service=friendview&continue=http://www.google.com/maps/m?mode=latitude");
     maps = new QWebView();
+    maps->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
     connect(maps, SIGNAL(loadFinished(bool)), this, SLOT(maps_login()));
     maps->load(url);
     menuBar()->addAction(tr("&Latitude"), this, SLOT(mode_latitude()));
@@ -43,11 +44,7 @@ LatitudeGUI::LatitudeGUI(QMainWindow *parent) : QMainWindow(parent) {
 }
 
 void LatitudeGUI::set() {
-#ifdef Q_WS_MAEMO_5
-    QMaemo5InformationBox::information(this, "new position...", 1000);
-#else
-    qDebug() << "new position...";
-#endif
+    qDebug() << "LatitudeGUI: set";
     glatitude->login(setting->value("user","my_username").toString(),
                      setting->value("pass","my_password").toString());
     glatitude->set(gps->get_lat(),
@@ -56,19 +53,17 @@ void LatitudeGUI::set() {
 }
 
 void LatitudeGUI::latitude_OK() {
-#ifdef Q_WS_MAEMO_5
-    QMaemo5InformationBox::information(this, "...location Sent!", 1000);
-#else
-    qDebug() << "...location Sent!";
-#endif
+    qDebug() << "LatitudeGUI: send";
 }
 
 void LatitudeGUI::latitude_ERROR() {
 #ifdef Q_WS_MAEMO_5
-    QMaemo5InformationBox::information(this, "Error in Authentification !", 3000);
-#else
-    qDebug() << "Error in Authentification !";
+    QString error_message = tr("<b>Error in Authentification!</b><br><br>") +
+                            tr("Plese verify your login details<br>");
+    QMaemo5InformationBox::information(this, error_message,
+                                       QMaemo5InformationBox::NoTimeout);
 #endif
+    qDebug() << "LatitudeGUI: no auth";
 }
 
 void LatitudeGUI::save_user(QString _user) {