Mercurial > trustbridge
comparison ui/mainwindow.h @ 1228:206eb5006c56
Improve mainwindow documentation
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Wed, 24 Sep 2014 15:13:11 +0200 |
parents | a1e990947172 |
children | dc1941e04373 |
comparison
equal
deleted
inserted
replaced
1227:a1e990947172 | 1228:206eb5006c56 |
---|---|
48 * | 48 * |
49 * @param[in] trayMode set the tray mode | 49 * @param[in] trayMode set the tray mode |
50 * */ | 50 * */ |
51 MainWindow(bool trayMode); | 51 MainWindow(bool trayMode); |
52 | 52 |
53 /**@brief set the current message to be shown | |
54 * | |
55 * The message will be shown at intervals in the system tray | |
56 * or as a messagebox if no stystemtray is available. | |
57 * | |
58 * @param [in] message The message to show. | |
59 */ | |
53 void setMessage(const QString message) {mCurMessage = message;} | 60 void setMessage(const QString message) {mCurMessage = message;} |
61 /**@brief accessor for the current message. | |
62 * | |
63 * @returns the currently shown message.*/ | |
54 QString getMessage() {return mCurMessage;} | 64 QString getMessage() {return mCurMessage;} |
55 | 65 |
66 /** | |
67 * @enum CurrentState | |
68 * @brief The internal state of the application | |
69 */ | |
56 enum CurrentState { | 70 enum CurrentState { |
57 BeforeDownload, | 71 BeforeDownload, /*! Initial state before a connection is tried. */ |
58 NewListAvailable, | 72 NewListAvailable, /*! A new certificate list is available. */ |
59 NewSoftwareAvailable, | 73 NewSoftwareAvailable, /*! A new Software is avaialable. */ |
60 DownloadingSW, | 74 DownloadingSW, /*! Download in progress. */ |
61 TransferError, | 75 TransferError, /*! An error happened on the last connection. */ |
62 NothingChanged | 76 NothingChanged /*! Update was susccessfull but nothing new is available. */ |
63 }; | 77 }; |
64 | 78 |
65 /** | 79 /** |
66 * @enum LongTimeErrors | 80 * @enum LongTimeErrors |
67 * @brief Errors that should be stored and only shown after some time has elapsed. | 81 * @brief Errors that should be stored and only shown after some time has elapsed. |
73 lteNoConnection | 87 lteNoConnection |
74 }; | 88 }; |
75 | 89 |
76 /** @brief accessor for the current state. */ | 90 /** @brief accessor for the current state. */ |
77 CurrentState getState() {return mCurState;} | 91 CurrentState getState() {return mCurState;} |
92 /** @brief set the current state. */ | |
78 void setState(CurrentState state) {mCurState = state;} | 93 void setState(CurrentState state) {mCurState = state;} |
79 | 94 |
80 private slots: | 95 private slots: |
96 /** @brief Shows the current message to the user. */ | |
81 void showMessage(); | 97 void showMessage(); |
98 /** @brief User has clicked on the message notification. */ | |
82 void iconActivated(QSystemTrayIcon::ActivationReason reason); | 99 void iconActivated(QSystemTrayIcon::ActivationReason reason); |
100 /** @brief Check if new updates are available. | |
101 * | |
102 * @param[in] downloadSW wether or not new software should be downloaded. | |
103 */ | |
83 void checkUpdates(bool downloadSW = false); | 104 void checkUpdates(bool downloadSW = false); |
105 /**@brief parse a new certificate list and update the UI*/ | |
84 void handleNewList(const QString& fileName, const QDateTime& modDate); | 106 void handleNewList(const QString& fileName, const QDateTime& modDate); |
107 /**@brief handle a Software update, update state and inform the user */ | |
85 void handleNewSW(const QString& fileName, const QDateTime& modDate); | 108 void handleNewSW(const QString& fileName, const QDateTime& modDate); |
109 /**@brief an error occured while downloading.*/ | |
86 void downloaderError(const QString &message, SSLConnection::ErrorCode error); | 110 void downloaderError(const QString &message, SSLConnection::ErrorCode error); |
87 /** @brief Trigger the appropiate action depending on the state */ | 111 /** @brief Trigger the appropiate action depending on the state */ |
88 void messageClicked(); | 112 void messageClicked(); |
113 /** @brief An error occured during certificate installation .*/ | |
89 void installerError(const QString& errMsg); | 114 void installerError(const QString& errMsg); |
115 /** @brief Certificate installation was successful. */ | |
90 void installerSuccess(); | 116 void installerSuccess(); |
117 /** @brief Install the currently selected certificates */ | |
91 void installCerts(); | 118 void installCerts(); |
119 /** @brief Handle a toggle action in the manual certificate list */ | |
92 void toggleInManual(bool state, const Certificate &cert); | 120 void toggleInManual(bool state, const Certificate &cert); |
121 /** @brief Remove a certificate from the manual list. */ | |
93 void removeFromManual(bool state, const Certificate &cert); | 122 void removeFromManual(bool state, const Certificate &cert); |
94 | 123 |
95 void togglePages(int button); | 124 void togglePages(int button); |
96 void toggleUpdatesNew(); | 125 void toggleUpdatesNew(); |
97 void toggleUpdatesRemove(); | 126 void toggleUpdatesRemove(); |