OSCAR-code/UpdaterWindow.h

64 lines
1.3 KiB
C
Raw Normal View History

#ifndef UPDATEWINDOW_H
#define UPDATEWINDOW_H
#include <QSystemTrayIcon>
#include <QNetworkAccessManager>
#include <QTableWidgetItem>
#include <QMenu>
#include <QMainWindow>
#include "version.h"
#include "updateparser.h"
namespace Ui {
class UpdaterWindow;
}
2011-12-17 06:59:40 +00:00
enum RequestMode { RM_None, RM_CheckUpdates, RM_GetFile };
class UpdaterWindow : public QMainWindow
{
Q_OBJECT
public:
explicit UpdaterWindow(QWidget *parent = 0);
~UpdaterWindow();
void checkForUpdates();
void ParseUpdateXML(QIODevice * dev);
protected slots:
void replyFinished(QNetworkReply * reply);
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal);
void dataReceived();
void requestFile();
private slots:
void on_CloseButton_clicked();
void on_upgradeButton_clicked();
void upgradeNext();
void on_FinishedButton_clicked();
private:
UpdateParser updateparser;
Ui::UpdaterWindow *ui;
QSystemTrayIcon *systray;
QMenu *systraymenu;
RequestMode requestmode;
QTime dltime;
QString needQtVersion;
Update *update;
Release *release;
QFile file;
QNetworkAccessManager *netmanager;
QNetworkReply * reply;
QList<Update *> updates;
int current_row;
bool success;
};
#endif // UPDATEWINDOW_H