diff ui/mainwindow.h @ 16:225a5ec20dad

Use QSettings and manage downloader from mainwindow.
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 19 Feb 2014 10:45:29 +0000
parents cf88cc432b9d
children c12825a651ed
line wrap: on
line diff
--- a/ui/mainwindow.h	Wed Feb 19 10:45:06 2014 +0000
+++ b/ui/mainwindow.h	Wed Feb 19 10:45:29 2014 +0000
@@ -3,6 +3,9 @@
 
 #include <QSystemTrayIcon>
 #include <QDialog>
+#include <QSettings>
+
+#include "downloader.h"
 class QMenu;
 class QAction;
 
@@ -16,22 +19,41 @@
     void setMessage(const QString message) {mCurMessage = message;}
     QString getMessage() {return mCurMessage;}
 
+    enum CurrentState {
+        BeforeDownload,
+        NewListAvailable,
+        NewSoftwareAvailable,
+        TransferError
+    };
+
+    CurrentState getState() {return mCurState;}
+    void setState(CurrentState state) {mCurState = state;}
+
 private slots:
     void showMessage();
     void iconActivated(QSystemTrayIcon::ActivationReason reason);
-    void manualCheck();
+    void checkUpdates();
+    void handleNewList(const QString& fileName, const QDateTime& modDate);
+    void handleNewSW(const QString& fileName, const QDateTime& modDate);
+    void downloaderError(const QString &message, Downloader::ErrorCode error);
 
 private:
+    void verifyAvailableData();
     void createTrayIcon();
     void createActions();
 
     QString mCurMessage;
+    QString mInstalledSWVersion;
+    QString mInstalledListVersion;
+
+    QSettings mSettings(QSettings::IniFormat);
 
     QSystemTrayIcon *mTrayIcon;
 
     QMenu *mTrayMenu;
     QAction *mCheckUpdates;
     QAction *mQuitAction;
+    CurrentState mCurState;
 };
 
 #endif // MAINWINDOW_H

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