From 4284a1d409187b5bc10cc87be6f7e00cc752edc5 Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 16 May 2016 14:49:18 +0200 Subject: [PATCH] Changed: downloadData and downloadClient methods --- .../ryzom_installer/src/operationdialog.cpp | 32 +++++++++++++++++-- .../ryzom_installer/src/operationdialog.h | 2 ++ 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp index ef9984e6b..0c57bcef1 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp @@ -97,7 +97,7 @@ void COperationDialog::processNextStep() break; case CConfigFile::DownloadData: - m_downloader->prepareFile(config->expandVariables(server.dataDownloadUrl), config->getInstallationDirectory() + "/" + config->expandVariables(server.dataDownloadFilename) + ".part"); + downloadData(); break; case CConfigFile::ExtractDownloadedData: @@ -105,7 +105,7 @@ void COperationDialog::processNextStep() break; case CConfigFile::DownloadClient: - m_downloader->prepareFile(config->expandVariables(server.clientDownloadUrl), config->getInstallationDirectory() + "/" + config->expandVariables(server.clientDownloadFilename) + ".part"); + downloadClient(); break; case CConfigFile::ExtractDownloadedClient: @@ -248,7 +248,33 @@ void COperationDialog::onProgressFail(const QString &error) void COperationDialog::onDone() { - processNextStep(); + if (!operationShouldStop()) processNextStep(); +} + +void COperationDialog::downloadData() +{ + CConfigFile *config = CConfigFile::getInstance(); + + // default server + const CServer &server = config->getServer(); + + m_currentOperation = QApplication::tr("Download data required for server %1").arg(server.name); + m_currentOperationProgressFormat = QApplication::tr("Downloading %1..."); + + m_downloader->prepareFile(config->expandVariables(server.dataDownloadUrl), config->getInstallationDirectory() + "/" + config->expandVariables(server.dataDownloadFilename) + ".part"); +} + +void COperationDialog::downloadClient() +{ + CConfigFile *config = CConfigFile::getInstance(); + + // default server + const CServer &server = config->getServer(); + + m_currentOperation = QApplication::tr("Download client required for server %1").arg(server.name); + m_currentOperationProgressFormat = QApplication::tr("Downloading %1..."); + + m_downloader->prepareFile(config->expandVariables(server.clientDownloadUrl), config->getInstallationDirectory() + "/" + config->expandVariables(server.clientDownloadFilename) + ".part"); } void COperationDialog::copyServerFiles() diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.h b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.h index b16f90edb..39ab5437d 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.h +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.h @@ -82,6 +82,8 @@ protected: void processNextStep(); // operations + void downloadData(); + void downloadClient(); void copyServerFiles(); void copyProfileFiles(); void extractBnpClient();