OSDN Git Service

Updated Monkey's Audio binary to v4.11 (2013-01-20), including STDERR flush fix.
[lamexp/LameXP.git] / src / Dialog_Update.h
index 5958594..eae3e0d 100644 (file)
@@ -1,6 +1,6 @@
 ///////////////////////////////////////////////////////////////////////////////
 // LameXP - Audio Encoder Front-End
-// Copyright (C) 2004-2010 LoRd_MuldeR <MuldeR2@GMX.de>
+// Copyright (C) 2004-2013 LoRd_MuldeR <MuldeR2@GMX.de>
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
 
 #pragma once
 
-#include "..\tmp\UIC_UpdateDialog.h"
-
 #include <QDialog>
 
-class UpdateDialog : public QDialog, private Ui::UpdateDialog
+class UpdateInfo;
+class SettingsModel;
+class QMovie;
+
+//UIC forward declartion
+namespace Ui {
+       class UpdateDialog;
+}
+
+//UpdateDialog class
+class UpdateDialog : public QDialog
 {
        Q_OBJECT
 
 public:
-       UpdateDialog(QWidget *parent = 0);
+       UpdateDialog(SettingsModel *settings, QWidget *parent = 0);
        ~UpdateDialog(void);
 
+       bool getSuccess(void) { return m_success; }
+       bool updateReadyToInstall(void) { return m_updateReadyToInstall; }
+
 private slots:
-       void updateCompleted(void);
+       void updateInit(void);
+       void checkForUpdates(void);
+       void linkActivated(const QString &link);
+       void applyUpdate(void);
+       void logButtonClicked(void);
+       void progressBarValueChanged(int value);
 
 protected:
-       void showEvent(QShowEvent *event);
+       virtual void showEvent(QShowEvent *event);
+       virtual void closeEvent(QCloseEvent *event);
+       virtual void keyPressEvent(QKeyEvent *e);
+       virtual bool winEvent(MSG *message, long *result);
+       virtual bool event(QEvent *e);
 
+       const bool m_betaUpdates;
 
 private:
-       bool m_clipboardUsed;
+       Ui::UpdateDialog *ui; //for Qt UIC
+
+       bool tryUpdateMirror(UpdateInfo *updateInfo, const QString &url);
+       bool getFile(const QString &url, const QString &outFile, unsigned int maxRedir = 5, bool *httpOk = NULL);
+       bool checkSignature(const QString &file, const QString &signature);
+       bool parseVersionInfo(const QString &file, UpdateInfo *updateInfo);
+       void testKnownWebSites(void);
+
+       UpdateInfo *m_updateInfo;
+       QStringList *m_logFile;
+       SettingsModel *m_settings;
+       QMovie *m_animator;
+       
+       const QString m_binaryWGet;
+       const QString m_binaryGnuPG;
+       const QString m_binaryUpdater;
+       const QString m_binaryKeys;
+       unsigned long m_updaterProcess;
+
+       bool m_success;
+       bool m_updateReadyToInstall;
+       bool m_firstShow;
 };