Some minor changes, implemented suggestions

pull/136/head
pvdk 11 years ago
parent ceb66d0790
commit e8170adde5

@ -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>("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"));
}

@ -2,6 +2,7 @@
#include <QDebug>
#include <QFileDialog>
#include <QMessageBox>
#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("<html><head/><body><p><b>The destination directory is not empty</b></p> \
<p>An existing Morrowind installation is present in the specified location.</p> \
<p>Please specify a different location, or go back and select the location as an existing installation.</p></body></html>"));
msgBox.exec();
return false;
}
return true;
}
void Wizard::InstallationTargetPage::on_browseButton_clicked()
{
QString selectedPath = QFileDialog::getExistingDirectory(

@ -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();

@ -37,6 +37,8 @@ Wizard::UnshieldWorker::UnshieldWorker(QObject *parent) :
mMorrowindDone = false;
mTribunalDone = false;
mBloodmoonDone = false;
qRegisterMetaType<Wizard::Component>("Wizard::Component");
}
Wizard::UnshieldWorker::~UnshieldWorker()

@ -20,8 +20,6 @@ namespace Wizard
Component_Bloodmoon
};
//Q_DECLARE_METATYPE(Wizard::Component)
class UnshieldWorker : public QObject
{
Q_OBJECT

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>513</width>
<height>328</height>
<width>511</width>
<height>326</height>
</rect>
</property>
<property name="windowTitle">
@ -43,7 +43,7 @@
<item>
<widget class="QCheckBox" name="addonsCheckBox">
<property name="text">
<string>Import previously selected add-ons (creates a new Content List in the launcher)</string>
<string>Import add-on and plugin selection (creates a new Content List in the launcher)</string>
</property>
</widget>
</item>

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>398</width>
<height>298</height>
<width>396</width>
<height>296</height>
</rect>
</property>
<property name="windowTitle">
@ -26,7 +26,7 @@
<string notr="true">font-weight:bold;</string>
</property>
<property name="text">
<string>Install to a new location</string>
<string>Install Morrowind to a new location</string>
</property>
<property name="checked">
<bool>true</bool>
@ -94,7 +94,7 @@
<string notr="true">font-weight:bold</string>
</property>
<property name="text">
<string>Select an existing installation</string>
<string>Select an existing Morrowind installation</string>
</property>
</widget>
</item>
@ -149,8 +149,6 @@
</item>
</layout>
</widget>
<resources>
<include location="../../wizard/wizard.qrc"/>
</resources>
<resources/>
<connections/>
</ui>

Loading…
Cancel
Save