86 explicit CFrmUpdater(QVector<QUrl> urls = QVector<QUrl>(), QWidget *parent =
nullptr);
89 int SetVersion(
const QString &szVersion);
96 int SetTitle(QImage icon = QImage(),
const QString &szTitle = QString());
103 int GenerateUpdateXml();
105 int GenerateUpdateXml(QCommandLineParser &parser);
111 int GenerateUpdateJson();
119 int GenerateUpdateJson(QCommandLineParser &parser);
126 int SetInstallAutoStartup(
bool bAutoStart =
true);
132 int SetUpdateCallback(pUpdateCallback pCb);
136 void slotDownloadError(
int nErr,
const QString szError);
137 void slotDownloadFileFinished(
const QString szFile);
138 void slotDownloadProgress(qint64 bytesReceived, qint64 bytesTotal);
141 void slotButtonClickd(
int id);
143 void slotDownloadFile();
144 virtual void slotCheckConfigFile();
145 void slotDownloadSetupFile();
147 void slotStateFinished();
149 void on_pbOK_clicked();
150 void on_pbClose_clicked();
151 void slotShowWindow(QSystemTrayIcon::ActivationReason reason);
156 void sigDownLoadRedire();
160 int CompareVersion(
const QString &newVersion,
const QString ¤tVersion);
161 int InitStateMachine();
163 int CheckRedirectConfigFile();
164 int CheckUpdateConfigFile();
165 bool CheckPrompt(
const QString &szVersion);
166 QString InstallScript(
const QString szDownLoadFile,
167 const QString szApplicationName);
168 Q_INVOKABLE
int Execute(
const QString szFile);
172 bool m_InstallAutoStartupType;
174 QSystemTrayIcon m_TrayIcon;
176 QButtonGroup m_ButtonGroup;
178 QString m_szCurrentVersion;
180 QFile m_DownloadFile;
182 QVector<QUrl> m_Urls;
184 QSharedPointer<RabbitCommon::CDownload> m_Download;
187 QStateMachine* m_StateMachine;
188 QState *m_pStateDownloadSetupFile;
190 enum class CONFIG_TYPE{
198 QString szMinUpdateVersion;
199 QString szInfomation;
207 QString szSystemMinVersion;
208 QString szArchitecture;
209 QString szArchitectureMinVersion;
217 QString szMinUpdateVersion;
218 QVector<CONFIG_FILE> files;
223 QVector<CONFIG_FILE> files;
228 int GetRedirectFromFile(
const QString& szFile, QVector<CONFIG_REDIRECT> &conf);
229 int GetConfigFromFile(
const QString& szFile,
CONFIG_INFO &conf);
230 int GetConfigFromCommandLine(QCommandLineParser &parser,
234 int GenerateUpdateXmlFile(
const QString &szFile,
237 int GenerateJsonFile(
const QString &szFile,
241 pUpdateCallback m_pcbUpdate;
245 virtual void showEvent(QShowEvent *event)
override;
247 void on_cbPrompt_clicked(
bool checked);
248 void on_cbHomePage_clicked(
bool checked);
250#if defined(HAVE_TEST)