![]() |
RabbitCommon v2.3.3
|
Updater. More...
#include <FrmUpdater.h>
Classes | |
struct | CONFIG_FILE |
struct | CONFIG_INFO |
struct | CONFIG_REDIRECT |
struct | CONFIG_VERSION |
Signals | |
void | sigError () |
void | sigFinished () |
void | sigDownLoadRedire () |
Public Member Functions | |
CFrmUpdater (QVector< QUrl > urls=QVector< QUrl >(), QWidget *parent=nullptr) | |
CFrmUpdater. | |
int | SetVersion (const QString &szVersion) |
int | SetTitle (QImage icon=QImage(), const QString &szTitle=QString()) |
SetTitle. | |
Q_DECL_DEPRECATED int | GenerateUpdateXml () |
Update XML file used only to generate programs. | |
Q_DECL_DEPRECATED int | GenerateUpdateXml (QCommandLineParser &parser) |
int | GenerateUpdateJson () |
Generate update json configure file. | |
int | GenerateUpdateJson (QCommandLineParser &parser) |
Generate update json configure file. | |
int | SetInstallAutoStartup (bool bAutoStart=true) |
Set install and automation startup. | |
Protected Slots | |
void | slotDownloadError (int nErr, const QString szError) |
void | slotDownloadFileFinished (const QString szFile) |
void | slotDownloadProgress (qint64 bytesReceived, qint64 bytesTotal) |
void | slotButtonClickd (int id) |
void | slotCheck () |
void | slotDownloadFile () |
virtual void | slotCheckConfigFile () |
void | slotDownloadSetupFile () |
void | slotUpdate () |
void | slotStateFinished () |
void | on_pbOK_clicked () |
void | on_pbClose_clicked () |
void | slotShowWindow (QSystemTrayIcon::ActivationReason reason) |
Protected Member Functions | |
virtual void | showEvent (QShowEvent *event) override |
Private Types | |
enum class | CONFIG_TYPE { VERSION , FILE , VERSION_FILE } |
Private Slots | |
void | on_cbPrompt_clicked (bool checked) |
void | on_cbHomePage_clicked (bool checked) |
Private Member Functions | |
CFrmUpdater (QWidget *parent) | |
int | CompareVersion (const QString &newVersion, const QString ¤tVersion) |
CFrmUpdater::CompareVersion. | |
int | InitStateMachine () |
Initialization state machine. | |
bool | IsDownLoad () |
Check file is exist. | |
int | CheckRedirectConfigFile () |
检查重定向配置文件 | |
int | CheckUpdateConfigFile () |
检查更新配置文件 | |
bool | CheckPrompt (const QString &szVersion) |
QString | InstallScript (const QString szDownLoadFile, const QString szApplicationName) |
int | GetRedirectFromFile (const QString &szFile, QVector< CONFIG_REDIRECT > &conf) |
Get redirect configure from file. | |
int | GetConfigFromFile (const QString &szFile, CONFIG_INFO &conf) |
json 格式: | |
int | GetConfigFromCommandLine (QCommandLineParser &parser, QString &szFile, CONFIG_INFO &info, CONFIG_TYPE &type) |
Get configure from command-line. | |
int | GenerateUpdateXmlFile (const QString &szFile, const CONFIG_INFO &info, CONFIG_TYPE &type) |
int | GenerateJsonFile (const QString &szFile, const CONFIG_INFO &info, CONFIG_TYPE type) |
Generate Json File. | |
Private Attributes | |
Ui::CFrmUpdater * | ui |
bool | m_InstallAutoStartupType |
QSystemTrayIcon | m_TrayIcon |
QButtonGroup | m_ButtonGroup |
QString | m_szCurrentVersion |
QFile | m_DownloadFile |
bool | m_bDownload |
QVector< QUrl > | m_Urls |
QSharedPointer< RabbitCommon::CDownload > | m_Download |
QStateMachine * | m_StateMachine |
QState * | m_pStateDownloadSetupFile |
struct CFrmUpdater::CONFIG_INFO | m_Info |
CONFIG_FILE | m_ConfigFile |
Updater.
Definition at line 74 of file FrmUpdater.h.
|
strongprivate |
Definition at line 181 of file FrmUpdater.h.
|
explicit |
urls | 重定向配置文件或下载配置文件的下载地址 |
parent |
Definition at line 112 of file FrmUpdater.cpp.
|
overridevirtual |
Definition at line 134 of file FrmUpdater.cpp.
|
private |
Definition at line 1703 of file FrmUpdater.cpp.
|
private |
检查重定向配置文件
重定向配置文件格式:
json format:
Definition at line 444 of file FrmUpdater.cpp.
|
private |
检查更新配置文件
旧的 xml 格式:
Definition at line 584 of file FrmUpdater.cpp.
|
private |
newVersion | |
currentVersion |
Definition at line 1166 of file FrmUpdater.cpp.
|
private |
Generate Json File.
szFile | |
info | |
type |
Definition at line 1305 of file FrmUpdater.cpp.
int CFrmUpdater::GenerateUpdateJson | ( | ) |
Generate update json configure file.
Definition at line 1278 of file FrmUpdater.cpp.
int CFrmUpdater::GenerateUpdateJson | ( | QCommandLineParser & | parser | ) |
Generate update json configure file.
parser | QCommandLineParser |
Definition at line 1286 of file FrmUpdater.cpp.
int CFrmUpdater::GenerateUpdateXml | ( | ) |
Update XML file used only to generate programs.
Definition at line 1463 of file FrmUpdater.cpp.
int CFrmUpdater::GenerateUpdateXml | ( | QCommandLineParser & | parser | ) |
Definition at line 1471 of file FrmUpdater.cpp.
|
private |
Definition at line 1365 of file FrmUpdater.cpp.
|
private |
Get configure from command-line.
parser | |
szFile | |
info | |
type |
Definition at line 1491 of file FrmUpdater.cpp.
|
private |
json 格式:
os | architecture | platform |
---|---|---|
windows | "i386",x86_64 | mingw,cygwin |
linux | x86,x86_64 | |
android | armv7, arm64_v8a, x86,x86_64 | |
macos | x86,x86_64 |
Definition at line 818 of file FrmUpdater.cpp.
|
private |
Get redirect configure from file.
szFile | File name |
conf | Redirect configure |
Definition at line 698 of file FrmUpdater.cpp.
|
private |
Initialization state machine.
Definition at line 196 of file FrmUpdater.cpp.
|
private |
Definition at line 1119 of file FrmUpdater.cpp.
|
private |
|
privateslot |
Definition at line 1724 of file FrmUpdater.cpp.
|
privateslot |
Definition at line 1717 of file FrmUpdater.cpp.
|
protectedslot |
Definition at line 1257 of file FrmUpdater.cpp.
|
protectedslot |
Definition at line 1247 of file FrmUpdater.cpp.
int CFrmUpdater::SetInstallAutoStartup | ( | bool | bAutoStart = true | ) |
Set install and automation startup.
bAutoStart |
Definition at line 1731 of file FrmUpdater.cpp.
int CFrmUpdater::SetTitle | ( | QImage | icon = QImage() , |
const QString & | szTitle = QString() |
||
) |
SetTitle.
icon | |
szTitle | default is qApp->applicationDisplayName() |
Definition at line 253 of file FrmUpdater.cpp.
int CFrmUpdater::SetVersion | ( | const QString & | szVersion | ) |
Definition at line 267 of file FrmUpdater.cpp.
|
overrideprotectedvirtual |
Definition at line 1685 of file FrmUpdater.cpp.
|
protectedslot |
Definition at line 1272 of file FrmUpdater.cpp.
|
protectedslot |
Definition at line 282 of file FrmUpdater.cpp.
|
protectedvirtualslot |
Definition at line 408 of file FrmUpdater.cpp.
|
protectedslot |
Definition at line 310 of file FrmUpdater.cpp.
|
protectedslot |
Definition at line 386 of file FrmUpdater.cpp.
|
protectedslot |
Definition at line 323 of file FrmUpdater.cpp.
|
protectedslot |
Definition at line 363 of file FrmUpdater.cpp.
|
protectedslot |
Definition at line 891 of file FrmUpdater.cpp.
|
protectedslot |
Definition at line 1692 of file FrmUpdater.cpp.
|
protectedslot |
Definition at line 275 of file FrmUpdater.cpp.
|
protectedslot |
Definition at line 905 of file FrmUpdater.cpp.
|
private |
Definition at line 172 of file FrmUpdater.h.
|
private |
Definition at line 167 of file FrmUpdater.h.
|
private |
Definition at line 217 of file FrmUpdater.h.
|
private |
Definition at line 175 of file FrmUpdater.h.
|
private |
Definition at line 171 of file FrmUpdater.h.
|
private |
Definition at line 163 of file FrmUpdater.h.
|
private |
Definition at line 179 of file FrmUpdater.h.
|
private |
Definition at line 178 of file FrmUpdater.h.
|
private |
Definition at line 169 of file FrmUpdater.h.
|
private |
Definition at line 165 of file FrmUpdater.h.
|
private |
Definition at line 173 of file FrmUpdater.h.
|
private |
Definition at line 162 of file FrmUpdater.h.