LameXP/src/Dialog_Update.h

78 lines
2.3 KiB
C
Raw Normal View History

///////////////////////////////////////////////////////////////////////////////
// LameXP - Audio Encoder Front-End
2011-01-01 17:04:25 +01:00
// Copyright (C) 2004-2011 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
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
// http://www.gnu.org/licenses/gpl-2.0.txt
///////////////////////////////////////////////////////////////////////////////
#pragma once
#include "..\tmp\UIC_UpdateDialog.h"
#include <QDialog>
2010-11-28 22:18:07 +01:00
class UpdateInfo;
class SettingsModel;
class QMovie;
2010-11-28 22:18:07 +01:00
class UpdateDialog : public QDialog, private Ui::UpdateDialog
{
Q_OBJECT
public:
UpdateDialog(SettingsModel *settings, QWidget *parent = 0);
~UpdateDialog(void);
bool getSuccess(void) { return m_success; }
bool updateReadyToInstall(void) { return m_updateReadyToInstall; }
private slots:
2010-11-28 22:18:07 +01:00
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);
2010-11-28 22:18:07 +01:00
void closeEvent(QCloseEvent *event);
2010-12-08 20:52:18 +01:00
void keyPressEvent(QKeyEvent *e);
bool winEvent(MSG *message, long *result);
const bool m_betaUpdates;
private:
2010-11-28 22:18:07 +01:00
bool tryUpdateMirror(UpdateInfo *updateInfo, const QString &url);
bool getFile(const QString &url, const QString &outFile, unsigned int maxRedir = 5);
2010-11-28 22:18:07 +01:00
bool checkSignature(const QString &file, const QString &signature);
bool parseVersionInfo(const QString &file, UpdateInfo *updateInfo);
UpdateInfo *m_updateInfo;
QStringList *m_logFile;
SettingsModel *m_settings;
QMovie *m_animator;
2010-11-28 22:18:07 +01:00
const QString m_binaryWGet;
const QString m_binaryGnuPG;
const QString m_binaryUpdater;
const QString m_binaryKeys;
bool m_success;
bool m_updateReadyToInstall;
};