2010-11-27 19:41:58 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// LameXP - Audio Encoder Front-End
|
2015-01-01 18:06:21 +01:00
|
|
|
// Copyright (C) 2004-2015 LoRd_MuldeR <MuldeR2@GMX.de>
|
2010-11-27 19:41:58 +01:00
|
|
|
//
|
|
|
|
// 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
|
2013-10-23 20:56:57 +02:00
|
|
|
// (at your option) any later version, but always including the *additional*
|
|
|
|
// restrictions defined in the "License.txt" file.
|
2010-11-27 19:41:58 +01:00
|
|
|
//
|
|
|
|
// 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 <QDialog>
|
|
|
|
|
2010-11-29 20:36:27 +01:00
|
|
|
class SettingsModel;
|
2011-03-24 15:37:49 +01:00
|
|
|
class QMovie;
|
2014-11-24 19:33:12 +01:00
|
|
|
|
|
|
|
//MUtils forward declaration
|
|
|
|
namespace MUtils
|
|
|
|
{
|
|
|
|
class UpdateChecker;
|
2014-12-18 22:49:37 +01:00
|
|
|
class Taskbar7;
|
2014-11-24 19:33:12 +01:00
|
|
|
}
|
2010-11-28 22:18:07 +01:00
|
|
|
|
2012-12-09 22:39:17 +01:00
|
|
|
//UIC forward declartion
|
2014-12-18 22:49:37 +01:00
|
|
|
namespace Ui
|
|
|
|
{
|
2012-12-09 22:39:17 +01:00
|
|
|
class UpdateDialog;
|
|
|
|
}
|
|
|
|
|
|
|
|
//UpdateDialog class
|
|
|
|
class UpdateDialog : public QDialog
|
2010-11-27 19:41:58 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2014-12-18 22:49:37 +01:00
|
|
|
UpdateDialog(const SettingsModel *const settings, QWidget *parent = 0);
|
2010-11-27 19:41:58 +01:00
|
|
|
~UpdateDialog(void);
|
|
|
|
|
2010-11-29 20:36:27 +01:00
|
|
|
bool getSuccess(void) { return m_success; }
|
2011-02-18 00:53:36 +01:00
|
|
|
bool updateReadyToInstall(void) { return m_updateReadyToInstall; }
|
2010-11-29 20:36:27 +01:00
|
|
|
|
2010-11-27 19:41:58 +01:00
|
|
|
private slots:
|
2010-11-28 22:18:07 +01:00
|
|
|
void updateInit(void);
|
|
|
|
void checkForUpdates(void);
|
|
|
|
void linkActivated(const QString &link);
|
|
|
|
void applyUpdate(void);
|
2010-11-29 20:36:27 +01:00
|
|
|
void logButtonClicked(void);
|
2011-02-25 13:40:45 +01:00
|
|
|
void progressBarValueChanged(int value);
|
2010-11-27 19:41:58 +01:00
|
|
|
|
2013-11-17 21:53:28 +01:00
|
|
|
void threadStatusChanged(const int status);
|
|
|
|
void threadProgressChanged(const int progress);
|
|
|
|
void threadMessageLogged(const QString &message);
|
|
|
|
void threadFinished(void);
|
|
|
|
|
2010-11-27 19:41:58 +01:00
|
|
|
protected:
|
2012-01-24 02:46:29 +01:00
|
|
|
virtual void showEvent(QShowEvent *event);
|
|
|
|
virtual void closeEvent(QCloseEvent *event);
|
|
|
|
virtual void keyPressEvent(QKeyEvent *e);
|
|
|
|
virtual bool event(QEvent *e);
|
2010-11-27 19:41:58 +01:00
|
|
|
|
2011-05-03 14:28:06 +02:00
|
|
|
const bool m_betaUpdates;
|
|
|
|
|
2010-11-27 19:41:58 +01:00
|
|
|
private:
|
2014-12-18 22:49:37 +01:00
|
|
|
Ui::UpdateDialog *const ui; //for Qt UIC
|
|
|
|
const SettingsModel *const m_settings;
|
2012-12-09 22:39:17 +01:00
|
|
|
|
2013-11-29 01:18:36 +01:00
|
|
|
const QString m_binaryWGet;
|
|
|
|
const QString m_binaryGnuPG;
|
|
|
|
const QString m_binaryKeys;
|
2013-11-17 21:53:28 +01:00
|
|
|
const QString m_binaryUpdater;
|
2010-11-28 22:18:07 +01:00
|
|
|
|
2014-12-18 22:49:37 +01:00
|
|
|
QScopedPointer<MUtils::Taskbar7> m_taskbar;
|
|
|
|
QScopedPointer<MUtils::UpdateChecker> m_thread;
|
|
|
|
QScopedPointer<QStringList> m_logFile;
|
|
|
|
QScopedPointer<QMovie> m_animator;
|
2013-11-17 21:53:28 +01:00
|
|
|
|
2012-01-24 02:46:29 +01:00
|
|
|
unsigned long m_updaterProcess;
|
2010-11-29 20:36:27 +01:00
|
|
|
|
|
|
|
bool m_success;
|
2011-02-18 00:53:36 +01:00
|
|
|
bool m_updateReadyToInstall;
|
2012-04-11 00:44:40 +02:00
|
|
|
bool m_firstShow;
|
2013-11-17 21:53:28 +01:00
|
|
|
|
|
|
|
void testKnownHosts(void);
|
|
|
|
|
2010-11-27 19:41:58 +01:00
|
|
|
};
|