diff ui/mainwindow.h @ 1227:a1e990947172

(issue38) Add long time error handling. A Long Time Error is an error that will be shown to the user if it happened at least seven times with an interval of at least a day between occurances. After one success a long time error will be reset.
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 24 Sep 2014 15:12:40 +0200
parents 6594e8e63a25
children 206eb5006c56
line wrap: on
line diff
--- a/ui/mainwindow.h	Wed Sep 24 15:05:53 2014 +0200
+++ b/ui/mainwindow.h	Wed Sep 24 15:12:40 2014 +0200
@@ -61,6 +61,19 @@
         TransferError,
         NothingChanged
     };
+
+    /**
+     * @enum LongTimeErrors
+     * @brief Errors that should be stored and only shown after some time has elapsed.
+     */
+    enum LongTimeErrors {
+        lteInvalidSoftware, /*! The downloaded Software was invalid. */
+        lteInvalidCertificate, /*! The SSL certificate of the download server was wrong. */
+        lteInvalidList, /*! The downloaded Certificate List was invalid. */
+        lteNoConnection
+    };
+
+    /** @brief accessor for the current state. */
     CurrentState getState() {return mCurState;}
     void setState(CurrentState state) {mCurState = state;}
 
@@ -181,6 +194,18 @@
     void changesChanged(const QString& cnt);
 
 private:
+    /** @brief Get a installer file name that can be shown to a user.
+     *
+     * This copys the real file to a temporary location with a user
+     * visible localized file name. Does error Handling.
+     *
+     * @param [in] realFileName The original file name.
+     *
+     * @returns a null string in case on errors. The new filename
+     * otherwise.
+     */
+    QString getPrettyInstallerName(QString realFileName);
+
     /** @brief the combined number of changes made in all lists */
     int changeCount();
 
@@ -206,6 +231,23 @@
      */
     void verifySWData();
 
+    /** @brief note an long time error in the settings and show a message.
+     *
+     * Saves a software verify error in the settings and notifies the
+     * user if necessary.
+     *
+     * @param [in] lte The error to handle.
+     * @param [in] reset weather or not the error count should be reset.
+     *
+     **/
+    void handleLTE(LongTimeErrors lte, bool reset = false);
+
+    /** @brief note a verify error in the settings and show a message
+     *
+     * Saves a software verify error in the settings and notifies the
+     * user if necessary.*/
+    void swVerifyError();
+
     void createTrayIcon();
     void createActions();
     void loadCertificateList();

http://wald.intevation.org/projects/trustbridge/