changeset 1228:206eb5006c56

Improve mainwindow documentation
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 24 Sep 2014 15:13:11 +0200
parents a1e990947172
children 6154d554b3af f6c59dc378e2
files ui/mainwindow.h
diffstat 1 files changed, 35 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/ui/mainwindow.h	Wed Sep 24 15:12:40 2014 +0200
+++ b/ui/mainwindow.h	Wed Sep 24 15:13:11 2014 +0200
@@ -50,16 +50,30 @@
      * */
     MainWindow(bool trayMode);
 
+    /**@brief set the current message to be shown
+     *
+     * The message will be shown at intervals in the system tray
+     * or as a messagebox if no stystemtray is available.
+     *
+     * @param [in] message The message to show.
+     */
     void setMessage(const QString message) {mCurMessage = message;}
+    /**@brief accessor for the current message.
+     *
+     * @returns the currently shown message.*/
     QString getMessage() {return mCurMessage;}
 
+    /**
+     * @enum CurrentState
+     * @brief The internal state of the application
+     */
     enum CurrentState {
-        BeforeDownload,
-        NewListAvailable,
-        NewSoftwareAvailable,
-        DownloadingSW,
-        TransferError,
-        NothingChanged
+        BeforeDownload, /*! Initial state before a connection is tried. */
+        NewListAvailable, /*! A new certificate list is available. */
+        NewSoftwareAvailable, /*! A new Software is avaialable. */
+        DownloadingSW, /*! Download in progress. */
+        TransferError, /*! An error happened on the last connection. */
+        NothingChanged /*! Update was susccessfull but nothing new is available. */
     };
 
     /**
@@ -75,21 +89,36 @@
 
     /** @brief accessor for the current state. */
     CurrentState getState() {return mCurState;}
+    /** @brief set the current state. */
     void setState(CurrentState state) {mCurState = state;}
 
 private slots:
+    /** @brief Shows the current message to the user. */
     void showMessage();
+    /** @brief User has clicked on the message notification. */
     void iconActivated(QSystemTrayIcon::ActivationReason reason);
+    /** @brief Check if new updates are available.
+     *
+     * @param[in] downloadSW wether or not new software should be downloaded.
+     */
     void checkUpdates(bool downloadSW = false);
+    /**@brief parse a new certificate list and update the UI*/
     void handleNewList(const QString& fileName, const QDateTime& modDate);
+    /**@brief handle a Software update, update state and inform the user */
     void handleNewSW(const QString& fileName, const QDateTime& modDate);
+    /**@brief an error occured while downloading.*/
     void downloaderError(const QString &message, SSLConnection::ErrorCode error);
     /** @brief Trigger the appropiate action depending on the state */
     void messageClicked();
+    /** @brief An error occured during certificate installation .*/
     void installerError(const QString& errMsg);
+    /** @brief Certificate installation was successful. */
     void installerSuccess();
+    /** @brief Install the currently selected certificates */
     void installCerts();
+    /** @brief Handle a toggle action in the manual certificate list */
     void toggleInManual(bool state, const Certificate &cert);
+    /** @brief Remove a certificate from the manual list. */
     void removeFromManual(bool state, const Certificate &cert);
 
     void togglePages(int button);

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