diff --git a/apps/wizard/installationpage.cpp b/apps/wizard/installationpage.cpp index e838a19c1..efa6880be 100644 --- a/apps/wizard/installationpage.cpp +++ b/apps/wizard/installationpage.cpp @@ -32,12 +32,9 @@ void Wizard::InstallationPage::initializePage() // That way installing all three components would yield 300% // When one component is done the bar will be filled by 33% - if (field("installation.new").toBool() == true) - { + if (field("installation.new").toBool() == true) { installProgressBar->setMaximum((components.count() * 100)); - } - else - { + } else { if (components.contains(QLatin1String("Tribunal")) && !mWizard->mInstallations[path]->hasTribunal) installProgressBar->setMaximum(100); @@ -59,8 +56,6 @@ void Wizard::InstallationPage::startInstallation() mUnshield = new UnshieldWorker(); mUnshield->moveToThread(thread); - qRegisterMetaType("Wizard::Component"); - connect(thread, SIGNAL(started()), mUnshield, SLOT(extract())); @@ -125,11 +120,9 @@ void Wizard::InstallationPage::startInstallation() if (language == QLatin1String("Polish")) { mUnshield->setIniCodec(QTextCodec::codecForName("windows-1250")); - } - else if (language == QLatin1String("Russian")) { + } else if (language == QLatin1String("Russian")) { mUnshield->setIniCodec(QTextCodec::codecForName("windows-1251")); - } - else { + } else { mUnshield->setIniCodec(QTextCodec::codecForName("windows-1252")); } diff --git a/apps/wizard/installationtargetpage.cpp b/apps/wizard/installationtargetpage.cpp index 900a978cf..306e7221c 100644 --- a/apps/wizard/installationtargetpage.cpp +++ b/apps/wizard/installationtargetpage.cpp @@ -2,6 +2,7 @@ #include #include +#include #include "mainwizard.hpp" @@ -29,6 +30,27 @@ void Wizard::InstallationTargetPage::initializePage() targetLineEdit->setText(QDir::toNativeSeparators(dir.absolutePath())); } +bool Wizard::InstallationTargetPage::validatePage() +{ + QString path(field("installation.path").toString()); + + qDebug() << "Validating path: " << path; + + if (mWizard->findFiles(QLatin1String("Morrowind"), path)) { + QMessageBox msgBox; + msgBox.setWindowTitle(tr("Destination not empty")); + msgBox.setIcon(QMessageBox::Warning); + msgBox.setStandardButtons(QMessageBox::Ok); + msgBox.setText(tr("

The destination directory is not empty

\ +

An existing Morrowind installation is present in the specified location.

\ +

Please specify a different location, or go back and select the location as an existing installation.

")); + msgBox.exec(); + return false; + } + + return true; +} + void Wizard::InstallationTargetPage::on_browseButton_clicked() { QString selectedPath = QFileDialog::getExistingDirectory( diff --git a/apps/wizard/installationtargetpage.hpp b/apps/wizard/installationtargetpage.hpp index f6d28b013..0711c1c05 100644 --- a/apps/wizard/installationtargetpage.hpp +++ b/apps/wizard/installationtargetpage.hpp @@ -21,6 +21,7 @@ namespace Wizard InstallationTargetPage(MainWizard *wizard, const Files::ConfigurationManager &cfg); int nextId() const; + virtual bool validatePage(); private slots: void on_browseButton_clicked(); diff --git a/apps/wizard/unshield/unshieldworker.cpp b/apps/wizard/unshield/unshieldworker.cpp index d7cda05a0..02e50a7e3 100644 --- a/apps/wizard/unshield/unshieldworker.cpp +++ b/apps/wizard/unshield/unshieldworker.cpp @@ -37,6 +37,8 @@ Wizard::UnshieldWorker::UnshieldWorker(QObject *parent) : mMorrowindDone = false; mTribunalDone = false; mBloodmoonDone = false; + + qRegisterMetaType("Wizard::Component"); } Wizard::UnshieldWorker::~UnshieldWorker() diff --git a/apps/wizard/unshield/unshieldworker.hpp b/apps/wizard/unshield/unshieldworker.hpp index 501daaf30..d110851f4 100644 --- a/apps/wizard/unshield/unshieldworker.hpp +++ b/apps/wizard/unshield/unshieldworker.hpp @@ -20,8 +20,6 @@ namespace Wizard Component_Bloodmoon }; - //Q_DECLARE_METATYPE(Wizard::Component) - class UnshieldWorker : public QObject { Q_OBJECT diff --git a/files/ui/wizard/importpage.ui b/files/ui/wizard/importpage.ui index 21037f3e8..5b078efca 100644 --- a/files/ui/wizard/importpage.ui +++ b/files/ui/wizard/importpage.ui @@ -6,8 +6,8 @@ 0 0 - 513 - 328 + 511 + 326 @@ -43,7 +43,7 @@ - Import previously selected add-ons (creates a new Content List in the launcher) + Import add-on and plugin selection (creates a new Content List in the launcher) diff --git a/files/ui/wizard/methodselectionpage.ui b/files/ui/wizard/methodselectionpage.ui index e77349f5c..122ef754e 100644 --- a/files/ui/wizard/methodselectionpage.ui +++ b/files/ui/wizard/methodselectionpage.ui @@ -6,8 +6,8 @@ 0 0 - 398 - 298 + 396 + 296 @@ -26,7 +26,7 @@ font-weight:bold; - Install to a new location + Install Morrowind to a new location true @@ -94,7 +94,7 @@ font-weight:bold - Select an existing installation + Select an existing Morrowind installation @@ -149,8 +149,6 @@ - - - +