Merge branch 'master' into settings_auto_update
[situare] / src / ui / mainwindow.h
index 68ce6a6..ba7a8bd 100644 (file)
@@ -33,6 +33,7 @@
 class QGraphicsScene;
 class QLabel;
 class QWebView;
+class QNetworkReply;
 
 class FacebookAuthentication;
 class FriendListPanel;
@@ -87,6 +88,14 @@ public:
     void automaticLocationUpdateEnabled(bool enabled);
 
     /**
+    * @brief Builds information box with message.
+    *
+    * @param message Information message
+    * @param modal Modal = true, non-modal false
+    */
+    void buildInformationBox(const QString &message, bool modal=false);
+
+    /**
     * @brief Clears cookie jar
     *
     */
@@ -136,14 +145,6 @@ public:
     bool showEnableAutomaticUpdateLocationDialog();
 
     /**
-    * @brief Show Maemo information box with message.
-    *
-    * @param message Information message
-    * @param modal Modal = true, non-modal false
-    */
-    void showMaemoInformationBox(const QString &message, bool modal=false);
-
-    /**
     * @brief Gets the username from member variable for saving purposes
     *
     * @return QString Username
@@ -179,9 +180,8 @@ public slots:
     * @brief Public slot to intercept signal when old cerdentials are invalid or credentials
     *        doesn't exist yet
     *
-    * @param url Login page url
     */
-    void startLoginProcess(const QUrl &url);
+    void startLoginProcess();
 
     /**
     * @brief Toggle progress indicator.
@@ -252,14 +252,41 @@ private:
     void grabZoomKeys(bool grab);
 
     /**
+    * @brief Queues dialog/information box
+    *
+    * @param dialog Dialog to be added into queue
+    */
+    void queueDialog(QDialog *dialog);
+
+    /**
       * @brief Set own location crosshair visibility
       *
       * @param visible
       */
     void setOwnLocationCrosshairVisibility(bool visible);
 
+    /**
+    * @brief Shows queued error information box
+    *
+    */
+    void showErrorInformationBox();
+
+    /**
+    * @brief Shows queued information box
+    *
+    * @fn showInformationBox
+    */
+    void showInformationBox();
+
 private slots:
     /**
+    * @brief Slot to intercept signal when dialog/information note is processed
+    *
+    * @param status Status of the dialog
+    */
+    void dialogFinished(int status);
+
+    /**
     * @brief Slot for drawing the fullscreen toggle button
     *
     * @param size Size of the screen
@@ -282,6 +309,13 @@ private slots:
     void drawOwnLocationCrosshair(int width, int height);
 
     /**
+    * @brief Slot to intercept signal when error dialog/information note is processed
+    *
+    * @param status Status of the dialog
+    */
+    void errorDialogFinished(int status);
+
+    /**
     * @brief Slot for gps timeout.
     *
     * Called when request timeout occurs.
@@ -320,6 +354,13 @@ private slots:
     */
     void toggleFullScreen();
 
+    /**
+    * @brief Slot to intercept signal from webview's networkaccessmanager
+    *
+    * @param reply Network reply (contains errors)
+    */
+    void webViewRequestFinished(QNetworkReply* reply);
+
 /*******************************************************************************
  * SIGNALS
  ******************************************************************************/
@@ -419,11 +460,25 @@ signals:
     void maxZoomLevelReached();
 
     /**
+    * @brief Signal that informs that user's message/location failed to update on Situare server
+    *        This signal is originally sended from SituareService with name error
+    *        Signal is renamed on MainWindow
+    */
+    void messageSendingFailed(const QString &error);
+
+    /**
       * @brief Forwarding signal from MapEngine to MapView
       */
     void minZoomLevelReached();
 
     /**
+    * @brief Signal that used to inform user that his message/location update tp Situare server
+    *        was failed.
+    *        This signal is originally sended from UserInfo
+    */
+    void notificateUpdateFailing(const QString &message);
+
+    /**
     * @brief Signal for refreshing user data.
     *
     */
@@ -465,6 +520,12 @@ signals:
     void updateCredentials(const QUrl &url);
 
     /**
+    * @brief Signals when updateLocation request finished successfully
+    *
+    */
+    void updateWasSuccessful();
+
+    /**
     * @brief MapView has finished zooming
     */
     void viewZoomFinished();
@@ -496,6 +557,7 @@ signals:
  ******************************************************************************/
 private:
     bool m_drawOwnLocationCrosshair;        ///< Flag for making ownLocationCrosshair visible or not
+    bool m_errorShown;                      ///< Indicates if error dialog/note is shown
     bool m_loggedIn;                        ///< Indicates login state
     bool m_refresh;                         ///< Indicates when webpage is refreshed
 
@@ -510,6 +572,9 @@ private:
     QLabel *m_osmLicense;                   ///< Label for Open Street Map license
     QLabel *m_ownLocationCrosshair;         ///< Label that show ownLocationCrosshair
 
+    QList<QDialog *> m_error_queue;         ///< QList type error dialog queue
+    QList<QDialog *> m_queue;               ///< QList type dialog queue
+
     QMenu *m_viewMenu;                      ///< Object that hold the view menu items
 
     QString m_email;                        ///< Placeholder for email
@@ -528,6 +593,7 @@ private:
     ZoomButtonPanel *m_zoomButtonPanel;     ///< Instance of zoom button panel
 
     SettingsDialog *m_settingsDialog;       ///< Settings dialog
+
 };
 
 #endif // MAINWINDOW_H