79 explicit CFrmUpdater(QVector<QUrl> urls = QVector<QUrl>(), QWidget *parent =
nullptr);
82 int SetVersion(
const QString &szVersion);
89 int SetTitle(QImage icon = QImage(),
const QString &szTitle = QString());
96 int GenerateUpdateXml();
98 int GenerateUpdateXml(QCommandLineParser &parser);
104 int GenerateUpdateJson();
112 int GenerateUpdateJson(QCommandLineParser &parser);
119 int SetInstallAutoStartup(
bool bAutoStart =
true);
123 void slotDownloadError(
int nErr,
const QString szError);
124 void slotDownloadFileFinished(
const QString szFile);
125 void slotDownloadProgress(qint64 bytesReceived, qint64 bytesTotal);
128 void slotButtonClickd(
int id);
130 void slotDownloadFile();
131 virtual void slotCheckConfigFile();
132 void slotDownloadSetupFile();
134 void slotStateFinished();
136 void on_pbOK_clicked();
137 void on_pbClose_clicked();
138 void slotShowWindow(QSystemTrayIcon::ActivationReason reason);
143 void sigDownLoadRedire();
147 int CompareVersion(
const QString &newVersion,
const QString ¤tVersion);
148 int InitStateMachine();
150 int CheckRedirectConfigFile();
151 int CheckUpdateConfigFile();
152 bool CheckPrompt(
const QString &szVersion);
153 QString InstallScript(
const QString szDownLoadFile,
154 const QString szApplicationName);
158 bool m_InstallAutoStartupType;
160 QSystemTrayIcon m_TrayIcon;
162 QButtonGroup m_ButtonGroup;
164 QString m_szCurrentVersion;
166 QFile m_DownloadFile;
168 QVector<QUrl> m_Urls;
170 QSharedPointer<RabbitCommon::CDownload> m_Download;
173 QStateMachine m_StateMachine;
174 QState *m_pStateDownloadSetupFile;
176 enum class CONFIG_TYPE{
184 QString szMinUpdateVersion;
185 QString szInfomation;
193 QString szSystemMinVersion;
194 QString szArchitecture;
195 QString szArchitectureMinVersion;
203 QString szMinUpdateVersion;
204 QVector<CONFIG_FILE> files;
209 QVector<CONFIG_FILE> files;
214 int GetRedirectFromFile(
const QString& szFile, QVector<CONFIG_REDIRECT> &conf);
215 int GetConfigFromFile(
const QString& szFile,
CONFIG_INFO &conf);
216 int GetConfigFromCommandLine(QCommandLineParser &parser,
220 int GenerateUpdateXmlFile(
const QString &szFile,
223 int GenerateJsonFile(
const QString &szFile,
229 virtual void showEvent(QShowEvent *event)
override;
231 void on_cbPrompt_clicked(
bool checked);
232 void on_cbHomePage_clicked(
bool checked);
234#if defined(HAVE_TEST)