Merge branch 'master' into map_double_click_zoom
authorJussi Laitinen <jupe@l3l7588.ixonos.local>
Fri, 18 Jun 2010 12:38:41 +0000 (15:38 +0300)
committerJussi Laitinen <jupe@l3l7588.ixonos.local>
Fri, 18 Jun 2010 12:38:41 +0000 (15:38 +0300)
Conflicts:
src/src.pro

debian/changelog
debian/control
src/engine/engine.cpp
src/facebookservice/facebookauthentication.cpp
src/facebookservice/facebookauthentication.h
src/situareservice/situareservice.cpp
src/situareservice/situareservice.h
src/src.pro
src/ui/mainwindow.cpp
src/ui/mainwindow.h

index ddb962e..f21e9a4 100644 (file)
@@ -1,9 +1,9 @@
 situare (0.7-0) unstable; urgency=low
   * Situare Beta Release (Intermediate build)
 
- -- Kaj Wallin <kaj.wallin@ixonos.com>  Mon, 16 Jun 2010 08:20:00 +0300
+ -- Kaj Wallin <kaj.wallin@ixonos.com>  Sat, 19 Jun 2010 08:20:00 +0300
 
-situare (0.6-2) unstable; urgency=low
+situare (0.6-5) unstable; urgency=low
   * Situare Beta Release
 
   * New Features:
@@ -21,7 +21,7 @@ situare (0.6-2) unstable; urgency=low
     - Login e-mail field is now properly filled after failed login attempt (#5866)
     - Mouse event work properly over friends items on map (#5867)
 
- -- Kaj Wallin <kaj.wallin@ixonos.com>  Mon, 16 Jun 2010 08:20:00 +0300
+ -- Kaj Wallin <kaj.wallin@ixonos.com>  Fri, 18 Jun 2010 08:54:00 +0300
 
 situare (0.5-1) unstable; urgency=low
   * Alpha release
index fc13f34..07dc18d 100644 (file)
@@ -1,24 +1,23 @@
 Source: situare
 Section: user/navigation
 Priority: optional
-Maintainer: Kaj Wallin <kaj.wallin@ixonos.com>
-Build-Depends:
+Maintainer: Jussi Laitinen <jussi.laitinen@ixonos.com>
+Build-Depends: debhelper, libdbus-1-dev, icd2-dev, libx11-dev, libqt4-dev, libqjson-dev, liblocation-dev, libqtm-dev
 Standards-Version: 3.7.2
 
 Package: situare
-Architecture: any
+Architecture: armel
 Depends: ${shlibs:Depends}
 Description: This is the Situare client for Maemo.
  Situare application introduces a concept of social locating.
  It allows users to view, update and share their location
  using facebook accounts. Situare utilizes OpenStreetMap
  database for mapping and device GPS for automatic locating.
- Project home is located in http://www.assembla.cc/wiki/show/situare.
+ Project home is located in https://garage.maemo.org/projects/situare/.
  Check also www.situare.net.
- This application requires Qt4.6.2 libraries
 XSBC-Bugtracker: https://garage.maemo.org/tracker/?atid=5192&group_id=1420&func=browse
 XB-Maemo-Display-Name: Situare
-XB-Maemo-Upgrade-Description: Alpha release
+XB-Maemo-Upgrade-Description: Beta release
 XB-Maemo-Icon-26:
  iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAA3X
  AAAN1wFCKJt4AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNn
index 47771dc..f087fa9 100644 (file)
@@ -214,15 +214,19 @@ void SituareEngine::error(const int error)
     switch(error)
     {
     case QNetworkReply::ConnectionRefusedError:
+        m_ui->toggleProgressIndicator(false);
         m_ui->buildInformationBox(tr("Connection refused by the server"), true);
         break;
     case QNetworkReply::RemoteHostClosedError:
+        m_ui->toggleProgressIndicator(false);
         m_ui->buildInformationBox(tr("Connection closed by the server"), true);
         break;
     case QNetworkReply::HostNotFoundError:
+        m_ui->toggleProgressIndicator(false);
         m_ui->buildInformationBox(tr("Remote server not found"), true);
         break;
     case QNetworkReply::TimeoutError:
+        m_ui->toggleProgressIndicator(false);
         m_ui->buildInformationBox(tr("Connection timed out"), true);
         break;
     case SituareError::SESSION_EXPIRED:
@@ -233,12 +237,16 @@ void SituareEngine::error(const int error)
         m_ui->loginFailed();
         break;
     case SituareError::LOGIN_FAILED:
+        m_ui->toggleProgressIndicator(false);
         m_ui->buildInformationBox(tr("Invalid E-mail address or password"), true);
+        m_ui->loginFailed();
         break;
     case SituareError::UPDATE_FAILED:
+        m_ui->toggleProgressIndicator(false);
         m_ui->buildInformationBox(tr("Update failed, please try again"), true);
         break;
     case SituareError::DATA_RETRIEVAL_FAILED:
+        m_ui->toggleProgressIndicator(false);
         m_ui->buildInformationBox(tr("Data retrieval failed, please try again"), true);
         break;
     case SituareError::ADDRESS_RETRIEVAL_FAILED:
@@ -255,6 +263,7 @@ void SituareEngine::error(const int error)
         m_ui->buildInformationBox(tr("GPS initialization failed"), true);
         break;
     case SituareError::UNKNOWN_REPLY:
+        m_ui->toggleProgressIndicator(false);
         m_ui->buildInformationBox(tr("Unknown server response"), true);
         break;
     case SituareError::INVALID_JSON:
@@ -263,6 +272,7 @@ void SituareEngine::error(const int error)
         m_facebookAuthenticator->clearAccountInformation(false); // clean all
         break;
     default:
+        m_ui->toggleProgressIndicator(false);
         qCritical() << "QNetworkReply::NetworkError :" << error;
         break;
     }
@@ -441,9 +451,6 @@ void SituareEngine::signalsFromFacebookAuthenticator()
     connect(m_facebookAuthenticator, SIGNAL(newLoginRequest()),
             m_ui, SLOT(startLoginProcess()));
 
-    connect(m_facebookAuthenticator, SIGNAL(loginFailure()),
-            m_ui, SLOT(loginFailed()));
-
     connect(m_facebookAuthenticator, SIGNAL(saveCookiesRequest()),
             m_ui, SLOT(saveCookies()));
 
@@ -600,6 +607,7 @@ void SituareEngine::userDataChanged(User *user, QList<User *> &friendsList)
     qDebug() << __PRETTY_FUNCTION__;
 
     m_ui->toggleProgressIndicator(false);
+    m_ui->showPanels();
 
     emit userLocationReady(user);
     emit friendsLocationsReady(friendsList);
index d238821..716b054 100644 (file)
@@ -169,7 +169,6 @@ bool FacebookAuthentication::updateCredentials(const QUrl &url)
             clearAccountInformation(true);
             if(m_freshLogin) {
                 emit error(SituareError::LOGIN_FAILED);
-                emit loginFailure();
             } else {
                 m_freshLogin = true;
                 emit error(SituareError::SESSION_EXPIRED);
@@ -179,12 +178,12 @@ bool FacebookAuthentication::updateCredentials(const QUrl &url)
         } else {
             qDebug() << "totally wrong webPage";
             // we should not get a wrong page at this point
-            emit loginFailure();
+            emit error(SituareError::LOGIN_FAILED);
         }
     } else {
         qDebug() << " Loading of page failed invalid URL" << endl;
         // we should not get a wrong page at this point
-        emit loginFailure();
+        emit error(SituareError::LOGIN_FAILED);
     }
     return found;
 }
index 06ec2c4..0f06828 100644 (file)
@@ -124,12 +124,6 @@ signals:
     void credentialsReady(const FacebookCredentials &credentials);
 
     /**
-    * @brief This signal is emitted if updateCredentials method can't find credentials from URL
-    *
-    */
-    void loginFailure();
-
-    /**
     * @brief This signal is emitted always when login is called. At first  the application tries
     *        to login using saved cookies
     *
index 2360ee1..7b9cd3d 100644 (file)
@@ -298,7 +298,7 @@ void SituareService::credentialsReady(const FacebookCredentials &credentials)
     m_credentials = credentials;    
 }
 
-void SituareService::parseUserData(/*const*/ QByteArray &jsonReply)
+void SituareService::parseUserData(const QByteArray &jsonReply)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
index 4ed475f..1b40c14 100644 (file)
@@ -159,7 +159,7 @@ private:
     *
     * @param jsonReply JSON string
     */
-    void parseUserData(/*const*/ QByteArray &jsonReply);
+    void parseUserData(const QByteArray &jsonReply);
 
     /**
     * @brief Sends http request
index 253e1a6..d1377cd 100644 (file)
@@ -21,6 +21,7 @@ SOURCES += main.cpp \
     map/mapengine.cpp \
     map/mapfetcher.cpp \
     map/mapscene.cpp \
+    map/mapscroller.cpp \
     map/maptile.cpp \
     map/maptilerequest.cpp \
     map/mapview.cpp \
@@ -51,7 +52,6 @@ SOURCES += main.cpp \
     ui/zoombutton.cpp \
     ui/zoombuttonpanel.cpp \
     user/user.cpp \
-    map/mapscroller.cpp \
     ui/fullscreenbutton.cpp
 HEADERS += common.h \
     engine/engine.h \
@@ -69,6 +69,7 @@ HEADERS += common.h \
     map/mapengine.h \
     map/mapfetcher.h \
     map/mapscene.h \
+    map/mapscroller.h \
     map/maptile.h \
     map/maptilerequest.h \
     map/mapview.h \
@@ -101,7 +102,6 @@ HEADERS += common.h \
     ui/zoombutton.h \
     ui/zoombuttonpanel.h \
     user/user.h \
-    map/mapscroller.h \
     ui/fullscreenbutton.h
 QT += network \
     webkit
@@ -133,6 +133,7 @@ simulator {
 #                   gps/geocoordinate.h
 #        CONFIG += link_pkgconfig
 #        PKGCONFIG += glib-2.0 liblocation
+#        LIBS += -llocation
         SOURCES += gps/gpspositionprivatestub.cpp
         HEADERS += gps/gpspositionprivatestub.h
     } else {
index 64469d2..8635428 100644 (file)
@@ -55,6 +55,7 @@ MainWindow::MainWindow(QWidget *parent)
     m_errorShown(false),
     m_loggedIn(false),
     m_refresh(false),
+    m_progressIndicatorCount(0),
     m_ownLocationCrosshair(0),
     m_email(),    
     m_password(),
@@ -672,9 +673,6 @@ void MainWindow::loginFailed()
     qDebug() << __PRETTY_FUNCTION__;
 
     clearCookieJar();
-
-    toggleProgressIndicator(false);
-
     startLoginProcess();
 }
 
@@ -881,6 +879,23 @@ void MainWindow::showInformationBox()
     }
 }
 
+void MainWindow::showPanels()
+{
+    qDebug() << __PRETTY_FUNCTION__;
+
+    if(m_loggedIn) {
+        if(!m_friendsListPanel->isVisible()) {
+            m_friendsListPanel->show();
+            m_friendsListPanelSidebar->show();
+        }
+
+        if(!m_userPanel->isVisible()) {
+            m_userPanel->show();
+            m_userPanelSidebar->show();
+        }
+    }
+}
+
 void MainWindow::startLoginProcess()
 {
     qDebug() << __PRETTY_FUNCTION__;
@@ -902,7 +917,16 @@ void MainWindow::toggleProgressIndicator(bool value)
     qDebug() << __PRETTY_FUNCTION__;
 
 #ifdef Q_WS_MAEMO_5
-    setAttribute(Qt::WA_Maemo5ShowProgressIndicator, value);
+    if(value) {
+        m_progressIndicatorCount++;
+        setAttribute(Qt::WA_Maemo5ShowProgressIndicator, true);
+    } else {
+        if(m_progressIndicatorCount > 0)
+            m_progressIndicatorCount--;
+
+        if(m_progressIndicatorCount == 0)
+            setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false);
+    }
 #else
     Q_UNUSED(value);
 #endif // Q_WS_MAEMO_5
@@ -912,11 +936,7 @@ void MainWindow::updateItemVisibility()
 {
     qDebug() << __PRETTY_FUNCTION__;
     
-    if(m_loggedIn) {
-        m_friendsListPanel->show();
-        m_friendsListPanelSidebar->show();
-        m_userPanel->show();
-        m_userPanelSidebar->show();
+    if(m_loggedIn) {       
 
         if(!m_gpsToggleAct->isChecked())
             setOwnLocationCrosshairVisibility(true);
@@ -948,7 +968,6 @@ void MainWindow::webViewRequestFinished(QNetworkReply *reply)
     if(reply->error() != QNetworkReply::OperationCanceledError &&
        reply->error() != QNetworkReply::NoError) {
         emit error(reply->error());
-        toggleProgressIndicator(false);
     }
 }
 
index aae2e50..d34798a 100644 (file)
@@ -155,7 +155,7 @@ public slots:
     void buildInformationBox(const QString &message, bool modal=false);
 
     /**
-    * @brief Slot to intercept signal when login has failed (loginFailure signal)
+    * @brief Slot for failed login
     *
     */
     void loginFailed();
@@ -186,6 +186,12 @@ public slots:
     void setUsername(const QString &username);
 
     /**
+    * @brief Method to show panels
+    *
+    */
+    void showPanels();
+
+    /**
     * @brief Public slot to intercept signal when old cerdentials are invalid or credentials
     *        doesn't exist yet
     *
@@ -591,6 +597,7 @@ private:
     bool m_loggedIn;                        ///< Indicates login state
     bool m_refresh;                         ///< Indicates when webpage is refreshed
 
+    int m_progressIndicatorCount;           ///< Indicates the number of progress indicator calls
 
     QAction *m_autoCenteringAct;            ///< Action to auto center map using gps position
     QAction *m_gpsToggleAct;                ///< Action to trigger gps toggle