Updated changelog.
[LameXP.git] / src / Dialog_Update.h
blobc1fc17639a2de994a9252c5933bd90bbf59601af
1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2023 LoRd_MuldeR <MuldeR2@GMX.de>
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU GENERAL PUBLIC LICENSE as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version; always including the non-optional
9 // LAMEXP GNU GENERAL PUBLIC LICENSE ADDENDUM. See "License.txt" file!
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this program; if not, write to the Free Software Foundation, Inc.,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 // http://www.gnu.org/licenses/gpl-2.0.txt
21 ///////////////////////////////////////////////////////////////////////////////
23 #pragma once
25 #include <QDialog>
27 class SettingsModel;
28 class QMovie;
30 //MUtils forward declaration
31 namespace MUtils
33 class UpdateChecker;
34 class Taskbar7;
37 //UIC forward declartion
38 namespace Ui
40 class UpdateDialog;
43 //UpdateDialog class
44 class UpdateDialog : public QDialog
46 Q_OBJECT
48 public:
49 UpdateDialog(const SettingsModel *const settings, QWidget *parent = 0);
50 ~UpdateDialog(void);
52 bool getSuccess(void) { return m_success; }
53 bool updateReadyToInstall(void) { return m_updateReadyToInstall; }
54 bool haveNewVersion(void) { return m_haveNewVersion; }
56 private slots:
57 void updateInit(void);
58 void checkForUpdates(void);
59 void linkActivated(const QString &link);
60 void applyUpdate(void);
61 void logButtonClicked(void);
62 void progressBarValueChanged(int value);
64 void threadStatusChanged(const int status);
65 void threadProgressChanged(const int progress);
66 void threadMessageLogged(const QString &message);
67 void threadFinished(void);
69 protected:
70 virtual void showEvent(QShowEvent *event);
71 virtual void closeEvent(QCloseEvent *event);
72 virtual void keyPressEvent(QKeyEvent *e);
73 virtual bool event(QEvent *e);
75 const bool m_betaUpdates;
77 private:
78 Ui::UpdateDialog *const ui; //for Qt UIC
79 const SettingsModel *const m_settings;
81 const QString m_binaryUpdater;
82 const QString m_binaryCurl;
83 const QString m_binaryVerify;
85 QScopedPointer<MUtils::Taskbar7> m_taskbar;
86 QScopedPointer<MUtils::UpdateChecker> m_thread;
87 QScopedPointer<QStringList> m_logFile;
88 QScopedPointer<QMovie> m_animator;
90 QScopedPointer<QIcon> m_iconTransmitting;
91 QScopedPointer<QIcon> m_iconFailure;
92 QScopedPointer<QIcon> m_iconUpdateAvailable;
93 QScopedPointer<QIcon> m_iconNoUpdates;
94 QScopedPointer<QIcon> m_iconNewVersionOlder;
95 QScopedPointer<QIcon> m_iconVersionError;
96 QScopedPointer<QIcon> m_iconNetworkError;
97 QScopedPointer<QIcon> m_iconServerError;
99 unsigned long m_updaterProcess;
101 bool m_success;
102 bool m_haveNewVersion;
103 bool m_updateReadyToInstall;
104 bool m_firstShow;
106 void testKnownHosts(void);