mirror of
https://github.com/lubosz/overte.git
synced 2025-08-12 08:31:16 +02:00
Fix bug when enter is pressed and add uninstall progress
This commit is contained in:
parent
9f110cac13
commit
c5156780ca
3 changed files with 15 additions and 7 deletions
|
@ -258,7 +258,9 @@ afx_msg void CLauncherDlg::OnNextClicked() {
|
||||||
startProcess();
|
startProcess();
|
||||||
} else if (_drawStep == DrawStep::DrawError) {
|
} else if (_drawStep == DrawStep::DrawError) {
|
||||||
theApp._manager.restartLauncher();
|
theApp._manager.restartLauncher();
|
||||||
} else {
|
} else if (_drawStep == DrawStep::DrawLoginLogin ||
|
||||||
|
_drawStep == DrawStep::DrawLoginErrorCred ||
|
||||||
|
_drawStep == DrawStep::DrawLoginErrorOrg) {
|
||||||
CString token;
|
CString token;
|
||||||
CString username, password, orgname;
|
CString username, password, orgname;
|
||||||
m_orgname.GetWindowTextW(orgname);
|
m_orgname.GetWindowTextW(orgname);
|
||||||
|
@ -686,6 +688,8 @@ void CLauncherDlg::OnTimer(UINT_PTR nIDEvent) {
|
||||||
theApp._manager.addToLog(_T("Starting login"));
|
theApp._manager.addToLog(_T("Starting login"));
|
||||||
setDrawDialog(DrawStep::DrawLoginLogin);
|
setDrawDialog(DrawStep::DrawLoginLogin);
|
||||||
}
|
}
|
||||||
|
} else if (theApp._manager.needsUninstall()) {
|
||||||
|
theApp._manager.updateProgress(LauncherManager::ProcessType::Uninstall, (float)_splashStep/100);
|
||||||
}
|
}
|
||||||
_splashStep++;
|
_splashStep++;
|
||||||
} else if (theApp._manager.shouldShutDown()) {
|
} else if (theApp._manager.shouldShutDown()) {
|
||||||
|
|
|
@ -152,21 +152,24 @@ BOOL LauncherManager::restartLauncher() {
|
||||||
|
|
||||||
void LauncherManager::updateProgress(ProcessType processType, float progress) {
|
void LauncherManager::updateProgress(ProcessType processType, float progress) {
|
||||||
switch (processType) {
|
switch (processType) {
|
||||||
case LauncherManager::DownloadContent:
|
case ProcessType::Uninstall:
|
||||||
|
_progress = progress;
|
||||||
|
break;
|
||||||
|
case ProcessType::DownloadContent:
|
||||||
_progress = DOWNLOAD_CONTENT_INSTALL_WEIGHT * progress;
|
_progress = DOWNLOAD_CONTENT_INSTALL_WEIGHT * progress;
|
||||||
break;
|
break;
|
||||||
case LauncherManager::UnzipContent:
|
case ProcessType::UnzipContent:
|
||||||
_progress = DOWNLOAD_CONTENT_INSTALL_WEIGHT +
|
_progress = DOWNLOAD_CONTENT_INSTALL_WEIGHT +
|
||||||
EXTRACT_CONTENT_INSTALL_WEIGHT * progress;
|
EXTRACT_CONTENT_INSTALL_WEIGHT * progress;
|
||||||
break;
|
break;
|
||||||
case LauncherManager::DownloadApplication:
|
case ProcessType::DownloadApplication:
|
||||||
_progress = !_shouldUpdate ?
|
_progress = !_shouldUpdate ?
|
||||||
(DOWNLOAD_CONTENT_INSTALL_WEIGHT +
|
(DOWNLOAD_CONTENT_INSTALL_WEIGHT +
|
||||||
EXTRACT_CONTENT_INSTALL_WEIGHT +
|
EXTRACT_CONTENT_INSTALL_WEIGHT +
|
||||||
DOWNLOAD_APPLICATION_INSTALL_WEIGHT * progress) :
|
DOWNLOAD_APPLICATION_INSTALL_WEIGHT * progress) :
|
||||||
DOWNLOAD_APPLICATION_UPDATE_WEIGHT * progress;
|
DOWNLOAD_APPLICATION_UPDATE_WEIGHT * progress;
|
||||||
break;
|
break;
|
||||||
case LauncherManager::UnzipApplication:
|
case ProcessType::UnzipApplication:
|
||||||
_progress = !_shouldUpdate ?
|
_progress = !_shouldUpdate ?
|
||||||
(DOWNLOAD_CONTENT_INSTALL_WEIGHT +
|
(DOWNLOAD_CONTENT_INSTALL_WEIGHT +
|
||||||
EXTRACT_CONTENT_INSTALL_WEIGHT +
|
EXTRACT_CONTENT_INSTALL_WEIGHT +
|
||||||
|
|
|
@ -52,7 +52,8 @@ public:
|
||||||
DownloadContent,
|
DownloadContent,
|
||||||
DownloadApplication,
|
DownloadApplication,
|
||||||
UnzipContent,
|
UnzipContent,
|
||||||
UnzipApplication
|
UnzipApplication,
|
||||||
|
Uninstall
|
||||||
};
|
};
|
||||||
LauncherManager();
|
LauncherManager();
|
||||||
~LauncherManager();
|
~LauncherManager();
|
||||||
|
@ -104,9 +105,9 @@ public:
|
||||||
void onZipExtracted(ProcessType type, int size);
|
void onZipExtracted(ProcessType type, int size);
|
||||||
void onFileDownloaded(ProcessType type);
|
void onFileDownloaded(ProcessType type);
|
||||||
float getProgress() { return _progress; }
|
float getProgress() { return _progress; }
|
||||||
|
void updateProgress(ProcessType processType, float progress);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateProgress(ProcessType processType, float progress);
|
|
||||||
ProcessType _currentProcess { ProcessType::DownloadApplication };
|
ProcessType _currentProcess { ProcessType::DownloadApplication };
|
||||||
CString _latestApplicationURL;
|
CString _latestApplicationURL;
|
||||||
CString _latestVersion;
|
CString _latestVersion;
|
||||||
|
|
Loading…
Reference in a new issue