From ff6bb332ebd302cf8e059149064f9897de355548 Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 16 May 2016 14:49:50 +0200 Subject: [PATCH] Changed: Moved createDefaultProfile --- .../ryzom_installer/src/operationdialog.cpp | 78 ++++++++++--------- 1 file changed, 42 insertions(+), 36 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp index 0c57bcef1..7281daf88 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp @@ -371,6 +371,48 @@ void COperationDialog::cleanFiles() CFilesCleaner cleaner(this); cleaner.setDirectory(config->getInstallationDirectory() + "/" + server.id); cleaner.exec(); + + emit done(); +} + +bool COperationDialog::createDefaultProfile() +{ + CConfigFile *config = CConfigFile::getInstance(); + + CServer server = config->getServer(config->getDefaultServerIndex()); + + m_currentOperation = QApplication::tr("Create default profile"); + m_currentOperationProgressFormat = QApplication::tr("Deleting %1..."); + + CProfile profile; + + profile.id = "0"; + profile.executable = config->getClientFullPath(); + profile.name = QString("Ryzom (%1)").arg(server.name); + profile.server = server.id; + profile.comments = "Default profile created by Ryzom Installer"; + +#ifdef Q_OS_WIN32 +// C:\Users\Public\Desktop + profile.desktopShortcut = QFile::exists(QStandardPaths::writableLocation(QStandardPaths::DesktopLocation) + "/Ryzom.lnk"); +#endif + + // TODO + // profile.menuShortcut + + config->addProfile(profile); + config->save(); + + emit done(); + + return true; +} + +bool COperationDialog::createDefaultShortcuts() +{ + emit done(); + + return true; } void COperationDialog::operationPrepare() @@ -414,39 +456,3 @@ bool COperationDialog::operationShouldStop() return m_aborting; } - -bool COperationDialog::createDefaultProfile() -{ - CConfigFile *config = CConfigFile::getInstance(); - - CServer server = config->getServer(config->getDefaultServerIndex()); - - CProfile profile; - - profile.id = 0; - profile.executable = config->getClientFullPath(); - profile.name = QString("Ryzom (%1)").arg(server.name); - profile.server = server.id; - profile.comments = "Default profile created by Ryzom Installer"; - -#ifdef Q_OS_WIN32 - profile.desktopShortcut = QFile::exists(QStandardPaths::writableLocation(QStandardPaths::DesktopLocation) + "/Ryzom.lnk"); -#endif - - // TODO - // profile.menuShortcut - - config->addProfile(profile); - config->save(); - - onDone(); - - return true; -} - -bool COperationDialog::createDefaultShortcuts() -{ - onDone(); - - return true; -}