comparison 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
comparison
equal deleted inserted replaced
1226:e401680b0cbd 1227:a1e990947172
59 NewSoftwareAvailable, 59 NewSoftwareAvailable,
60 DownloadingSW, 60 DownloadingSW,
61 TransferError, 61 TransferError,
62 NothingChanged 62 NothingChanged
63 }; 63 };
64
65 /**
66 * @enum LongTimeErrors
67 * @brief Errors that should be stored and only shown after some time has elapsed.
68 */
69 enum LongTimeErrors {
70 lteInvalidSoftware, /*! The downloaded Software was invalid. */
71 lteInvalidCertificate, /*! The SSL certificate of the download server was wrong. */
72 lteInvalidList, /*! The downloaded Certificate List was invalid. */
73 lteNoConnection
74 };
75
76 /** @brief accessor for the current state. */
64 CurrentState getState() {return mCurState;} 77 CurrentState getState() {return mCurState;}
65 void setState(CurrentState state) {mCurState = state;} 78 void setState(CurrentState state) {mCurState = state;}
66 79
67 private slots: 80 private slots:
68 void showMessage(); 81 void showMessage();
179 signals: 192 signals:
180 /** @brief emits the changecount as a string when it changes */ 193 /** @brief emits the changecount as a string when it changes */
181 void changesChanged(const QString& cnt); 194 void changesChanged(const QString& cnt);
182 195
183 private: 196 private:
197 /** @brief Get a installer file name that can be shown to a user.
198 *
199 * This copys the real file to a temporary location with a user
200 * visible localized file name. Does error Handling.
201 *
202 * @param [in] realFileName The original file name.
203 *
204 * @returns a null string in case on errors. The new filename
205 * otherwise.
206 */
207 QString getPrettyInstallerName(QString realFileName);
208
184 /** @brief the combined number of changes made in all lists */ 209 /** @brief the combined number of changes made in all lists */
185 int changeCount(); 210 int changeCount();
186 211
187 /** @brief use this to set the change count */ 212 /** @brief use this to set the change count */
188 void setChangeCount(int cnt); 213 void setChangeCount(int cnt);
203 * FileNames where the underlying files can change. This 228 * FileNames where the underlying files can change. This
204 * is just meant to check if the downloaded data was somehow 229 * is just meant to check if the downloaded data was somehow
205 * removed or corrupted. 230 * removed or corrupted.
206 */ 231 */
207 void verifySWData(); 232 void verifySWData();
233
234 /** @brief note an long time error in the settings and show a message.
235 *
236 * Saves a software verify error in the settings and notifies the
237 * user if necessary.
238 *
239 * @param [in] lte The error to handle.
240 * @param [in] reset weather or not the error count should be reset.
241 *
242 **/
243 void handleLTE(LongTimeErrors lte, bool reset = false);
244
245 /** @brief note a verify error in the settings and show a message
246 *
247 * Saves a software verify error in the settings and notifies the
248 * user if necessary.*/
249 void swVerifyError();
208 250
209 void createTrayIcon(); 251 void createTrayIcon();
210 void createActions(); 252 void createActions();
211 void loadCertificateList(); 253 void loadCertificateList();
212 254

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