From f3a6422626bb2860971393bd0f50d4b2f6a07543 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 14 May 2016 18:52:09 +0200 Subject: [PATCH] Changed: New done() signal to go to next step --HG-- branch : feature-ryzom-installer --- .../client/ryzom_installer/src/archive.cpp | 4 ++++ .../client/ryzom_installer/src/archive.h | 3 +++ .../client/ryzom_installer/src/mainwindow.cpp | 21 +++++++++++++++++-- .../client/ryzom_installer/src/mainwindow.h | 4 ++++ 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/archive.cpp b/code/ryzom/tools/client/ryzom_installer/src/archive.cpp index 5d32a4c39..8ae958e7e 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/archive.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/archive.cpp @@ -460,6 +460,7 @@ bool CArchive::copyFiles(const FilesToCopy &files) } emit extractSuccess(totalSize); + emit done(); return true; } @@ -619,6 +620,7 @@ bool CArchive::extract7z() { case SZ_OK: emit extractSuccess(totalUncompressed); + emit done(); return true; case SZ_ERROR_INTERRUPTED: @@ -720,6 +722,7 @@ bool CArchive::extractZip() } emit extractSuccess(totalSize); + emit done(); return true; } @@ -744,6 +747,7 @@ bool CArchive::progress(const std::string &filename, uint32 currentSize, uint32 if (currentSize == totalSize) { emit extractSuccess((qint64)totalSize); + emit done(); } return true; diff --git a/code/ryzom/tools/client/ryzom_installer/src/archive.h b/code/ryzom/tools/client/ryzom_installer/src/archive.h index 202ad664f..a442056e1 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/archive.h +++ b/code/ryzom/tools/client/ryzom_installer/src/archive.h @@ -61,6 +61,9 @@ signals: // emitted when an error occurs void extractFail(const QString &error); + // emitted when done and should process next step + void done(); + protected: struct FileToCopy diff --git a/code/ryzom/tools/client/ryzom_installer/src/mainwindow.cpp b/code/ryzom/tools/client/ryzom_installer/src/mainwindow.cpp index 452d78237..f8d6b6ed6 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/mainwindow.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/mainwindow.cpp @@ -68,6 +68,7 @@ CMainWindow::CMainWindow():QMainWindow(), m_archive(NULL), m_statusLabel(NULL) connect(m_archive, SIGNAL(extractProgress(qint64, QString)), SLOT(onExtractProgress(qint64, QString))); connect(m_archive, SIGNAL(extractSuccess(qint64)), SLOT(onExtractSuccess(qint64))); connect(m_archive, SIGNAL(extractFail(QString)), SLOT(onExtractFail(QString))); + connect(m_archive, SIGNAL(done()), SLOT(onDone())); connect(actionProfiles, SIGNAL(triggered()), SLOT(onProfiles())); @@ -122,6 +123,7 @@ void CMainWindow::processNextStep() case CConfigFile::ExtractDownloadedClient: displayProgressBar(); + // TODO break; case CConfigFile::CopyServerFiles: @@ -145,11 +147,15 @@ void CMainWindow::processNextStep() break; case CConfigFile::CreateProfile: - displayProgressBar(); + hideProgressBar(); + config->createDefaultProfile(); + onDone(); break; case CConfigFile::CreateShortcuts: - displayProgressBar(); + hideProgressBar(); + config->createDefaultShortcuts(); + onDone(); break; default: @@ -170,6 +176,15 @@ void CMainWindow::displayProgressBar() stopButton->setVisible(false); } +void CMainWindow::hideProgressBar() +{ + downloadFrame->setVisible(false); + configurationFrame->setVisible(false); + + resumeButton->setVisible(false); + stopButton->setVisible(false); +} + void CMainWindow::displayConfigurationsChoices() { downloadFrame->setVisible(false); @@ -421,6 +436,8 @@ void CMainWindow::onExtractSuccess(qint64 total) stopButton->setVisible(false); } +void CMainWindow::onDone() +{ processNextStep(); } diff --git a/code/ryzom/tools/client/ryzom_installer/src/mainwindow.h b/code/ryzom/tools/client/ryzom_installer/src/mainwindow.h index 707d7efcf..aa2be5659 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/mainwindow.h +++ b/code/ryzom/tools/client/ryzom_installer/src/mainwindow.h @@ -66,6 +66,8 @@ public slots: void onExtractSuccess(qint64 total); void onExtractFail(const QString &error); + void onDone(); + protected: void showEvent(QShowEvent *e); void closeEvent(QCloseEvent *e); @@ -73,6 +75,8 @@ protected: void processNextStep(); void displayProgressBar(); + void hideProgressBar(); + void displayConfigurationsChoices(); QWinTaskbarButton *m_button;