Fixed GPS/manual states when logging in
[situare] / src / ui / mainwindow.h
index a753d20..c8b1231 100644 (file)
@@ -27,7 +27,7 @@
 #include <QtGui/QMainWindow>
 #include <QUrl>
 
-#include "networkcookiejar.h"
+#include "network/networkcookiejar.h"
 #include "panelsidebar.h"
 
 class QGraphicsScene;
@@ -36,7 +36,6 @@ class QWebView;
 
 class FacebookAuthentication;
 class FriendListPanel;
-class LoginDialog;
 class MapScene;
 class MapView;
 class SituareService;
@@ -77,7 +76,13 @@ private:
 /*******************************************************************************
  * MEMBER FUNCTIONS AND SLOTS
  ******************************************************************************/
-public:    
+public:
+    /**
+    * @brief Clears cookie jar
+    *
+    */
+    void clearCookieJar();
+
     /**
     * @brief
     *
@@ -111,9 +116,10 @@ public:
     /**
     * @brief Show Maemo information box with message.
     *
-    * @brief message information message
+    * @param message Information message
+    * @param modal Modal = true, non-modal false
     */
-    void showMaemoInformationBox(const QString &message);
+    void showMaemoInformationBox(const QString &message, bool modal=false);
 
     /**
     * @brief Gets the username from member variable for saving purposes
@@ -123,13 +129,6 @@ public:
     const QString username();
 
 public slots:
-    /**
-    * @brief Slot to intercept signal when user has pressed connect button from loginDialog
-    *
-    * @param email E-mail
-    * @param password Password
-    */
-    void loginDialogDone(const QString &email, const QString &password);
 
     /**
     * @brief Slot to intercept signal when login has failed (loginFailure signal)
@@ -137,6 +136,10 @@ public slots:
     */
     void loginFailed();
 
+    /**
+    * @brief Slot to intercept signal when login with cookies is requested
+    *
+    */
     void loginUsingCookies();
 
     /**
@@ -152,13 +155,6 @@ public slots:
     void setUsername(const QString &username);
 
     /**
-    * @brief
-    *
-    * @param show
-    */
-    void showPanels(bool show);
-
-    /**
     * @brief Public slot to intercept signal when old cerdentials are invalid or credentials
     *        doesn't exist yet
     *
@@ -173,14 +169,19 @@ public slots:
     */
     void toggleProgressIndicator(bool state);
 
+    /**
+    * @brief Shows / hides Situare related UI items
+    *
+    * @param show
+    */
+    void updateItemVisibility(bool show);
+
 private:
     /**
       * @brief Build friend list panel and connect slots
       */
     void buildFriendListPanel();
 
-    void buildLoginDialog();
-
     /**
       * @brief Build manual location setting cross hair and connect slots
       */
@@ -201,6 +202,10 @@ private:
       */
     void buildUserInfoPanel();
 
+    /**
+    * @brief Build webview and connect slots
+    *
+    */
     void buildWebView();
 
     /**
@@ -208,10 +213,6 @@ private:
       */
     void buildZoomButtonPanel();
 
-    void clearCookieJar();
-
-    void connectWebViewSignals(bool connectSignals);
-
     /**
     * @brief Private method to create the Menu items
     */
@@ -261,6 +262,10 @@ private slots:
     */
     void gpsTimeout();
 
+    /**
+    * @brief Slot to load cookies from settings
+    *
+    */
     void loadCookies();
 
     /**
@@ -270,6 +275,10 @@ private slots:
     */
     void loadDone(bool done);
 
+    /**
+    * @brief Slot to save cookies to settings
+    *
+    */
     void saveCookies();
 
     /**
@@ -311,6 +320,13 @@ signals:
     void fetchUsernameFromSettings();
 
     /**
+    * @brief Signal for finding user.
+    *
+    * @param coordinates user geo coordinates
+    */
+    void findUser(const QPointF &coordinates);
+
+    /**
     * @brief GPS setting changed
     *
     * @param enabled True if GPS is enabled, otherwise false
@@ -457,9 +473,8 @@ private:
     QWebView *m_webView;                    ///< Shows facebook login page
 
     FriendListPanel *m_friendsListPanel;    ///< Instance of friends list panel
-    LoginDialog *m_loginDialog;             ///< Login dialog
     MapView *m_mapView;                     ///< Instance of the map view
-    NetworkCookieJar *m_cookieJar;
+    NetworkCookieJar *m_cookieJar;          ///< Placeholder for QNetworkCookies
     PanelSideBar *m_userPanelSidebar;       ///< User panel side bar
     PanelSideBar *m_friendsListPanelSidebar;///< Friends panel side bar
     UserInfoPanel *m_userPanel;             ///< Instance of the user information panel