mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-03 13:13:23 +00:00
Remove the "browse to existing installation" button, now replaced by the wizard
Clean up some debug spam
This commit is contained in:
parent
e11bec1a37
commit
1e06f69d9e
@ -388,27 +388,14 @@ bool Launcher::MainDialog::setupGameSettings()
|
|||||||
msgBox.setIcon(QMessageBox::Warning);
|
msgBox.setIcon(QMessageBox::Warning);
|
||||||
msgBox.setStandardButtons(QMessageBox::Cancel);
|
msgBox.setStandardButtons(QMessageBox::Cancel);
|
||||||
msgBox.setText(tr("<br><b>Could not find the Data Files location</b><br><br> \
|
msgBox.setText(tr("<br><b>Could not find the Data Files location</b><br><br> \
|
||||||
The directory containing the data files was not found.<br><br> \
|
The directory containing the data files was not found."));
|
||||||
Press \"Browse...\" to specify the location manually.<br>"));
|
|
||||||
|
|
||||||
QAbstractButton *browseButton =
|
|
||||||
msgBox.addButton(tr("Browse..."), QMessageBox::ActionRole);
|
|
||||||
|
|
||||||
QAbstractButton *wizardButton =
|
QAbstractButton *wizardButton =
|
||||||
msgBox.addButton(tr("Run &Installation Wizard..."), QMessageBox::ActionRole);
|
msgBox.addButton(tr("Run &Installation Wizard..."), QMessageBox::ActionRole);
|
||||||
|
|
||||||
msgBox.exec();
|
msgBox.exec();
|
||||||
|
|
||||||
QString selectedFile;
|
if (msgBox.clickedButton() == wizardButton)
|
||||||
if (msgBox.clickedButton() == browseButton)
|
|
||||||
{
|
|
||||||
selectedFile = QFileDialog::getOpenFileName(
|
|
||||||
this,
|
|
||||||
tr("Select master file"),
|
|
||||||
QDir::currentPath(),
|
|
||||||
tr("Morrowind master file (*.esm)"));
|
|
||||||
}
|
|
||||||
else if (msgBox.clickedButton() == wizardButton)
|
|
||||||
{
|
{
|
||||||
if (!mWizardInvoker->startProcess(QLatin1String("openmw-wizard"), false)) {
|
if (!mWizardInvoker->startProcess(QLatin1String("openmw-wizard"), false)) {
|
||||||
return false;
|
return false;
|
||||||
@ -416,15 +403,6 @@ bool Launcher::MainDialog::setupGameSettings()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectedFile.isEmpty())
|
|
||||||
return false; // Cancel was clicked
|
|
||||||
|
|
||||||
QFileInfo info(selectedFile);
|
|
||||||
|
|
||||||
// Add the new dir to the settings file and to the data dir container
|
|
||||||
mGameSettings.setMultiValue(QString("data"), info.absolutePath());
|
|
||||||
mGameSettings.addDataDir(info.absolutePath());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -610,14 +588,12 @@ bool Launcher::MainDialog::writeSettings()
|
|||||||
|
|
||||||
void Launcher::MainDialog::closeEvent(QCloseEvent *event)
|
void Launcher::MainDialog::closeEvent(QCloseEvent *event)
|
||||||
{
|
{
|
||||||
qDebug() << "close event!";
|
|
||||||
writeSettings();
|
writeSettings();
|
||||||
event->accept();
|
event->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Launcher::MainDialog::wizardStarted()
|
void Launcher::MainDialog::wizardStarted()
|
||||||
{
|
{
|
||||||
qDebug() << "wizard started!";
|
|
||||||
hide();
|
hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,13 +174,11 @@ void Launcher::SettingsPage::wizardStarted()
|
|||||||
{
|
{
|
||||||
mMain->hide(); // Hide the launcher
|
mMain->hide(); // Hide the launcher
|
||||||
|
|
||||||
qDebug() << "wizard started!";
|
|
||||||
wizardButton->setEnabled(false);
|
wizardButton->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Launcher::SettingsPage::wizardFinished(int exitCode, QProcess::ExitStatus exitStatus)
|
void Launcher::SettingsPage::wizardFinished(int exitCode, QProcess::ExitStatus exitStatus)
|
||||||
{
|
{
|
||||||
qDebug() << "wizard finished!";
|
|
||||||
if (exitCode != 0 || exitStatus == QProcess::CrashExit)
|
if (exitCode != 0 || exitStatus == QProcess::CrashExit)
|
||||||
return qApp->quit();
|
return qApp->quit();
|
||||||
|
|
||||||
@ -192,13 +190,11 @@ void Launcher::SettingsPage::wizardFinished(int exitCode, QProcess::ExitStatus e
|
|||||||
|
|
||||||
void Launcher::SettingsPage::importerStarted()
|
void Launcher::SettingsPage::importerStarted()
|
||||||
{
|
{
|
||||||
qDebug() << "importer started!";
|
|
||||||
importerButton->setEnabled(false);
|
importerButton->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Launcher::SettingsPage::importerFinished(int exitCode, QProcess::ExitStatus exitStatus)
|
void Launcher::SettingsPage::importerFinished(int exitCode, QProcess::ExitStatus exitStatus)
|
||||||
{
|
{
|
||||||
qDebug() << "importer finished!";
|
|
||||||
if (exitCode != 0 || exitStatus == QProcess::CrashExit)
|
if (exitCode != 0 || exitStatus == QProcess::CrashExit)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -33,7 +33,6 @@ QStringList Wizard::IniSettings::findKeys(const QString &text)
|
|||||||
|
|
||||||
bool Wizard::IniSettings::readFile(QTextStream &stream)
|
bool Wizard::IniSettings::readFile(QTextStream &stream)
|
||||||
{
|
{
|
||||||
qDebug() << "readFile called!";
|
|
||||||
// Look for a square bracket, "'\\["
|
// Look for a square bracket, "'\\["
|
||||||
// that has one or more "not nothing" in it, "([^]]+)"
|
// that has one or more "not nothing" in it, "([^]]+)"
|
||||||
// and is closed with a square bracket, "\\]"
|
// and is closed with a square bracket, "\\]"
|
||||||
@ -66,7 +65,6 @@ bool Wizard::IniSettings::readFile(QTextStream &stream)
|
|||||||
if (!currentSection.isEmpty())
|
if (!currentSection.isEmpty())
|
||||||
key = currentSection + QLatin1Char('/') + key;
|
key = currentSection + QLatin1Char('/') + key;
|
||||||
|
|
||||||
//qDebug() << "adding: " << key << value;
|
|
||||||
mSettings[key] = QVariant(value);
|
mSettings[key] = QVariant(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -204,7 +202,6 @@ bool Wizard::IniSettings::parseInx(const QString &path)
|
|||||||
const QString key(array.mid(section.length() + 3, lenght));
|
const QString key(array.mid(section.length() + 3, lenght));
|
||||||
|
|
||||||
QString value(array.mid(section.length() + key.length() + 6));
|
QString value(array.mid(section.length() + key.length() + 6));
|
||||||
//qDebug() << section << key << value;
|
|
||||||
|
|
||||||
// Add the value
|
// Add the value
|
||||||
setValue(section + QLatin1Char('/') + key, QVariant(value));
|
setValue(section + QLatin1Char('/') + key, QVariant(value));
|
||||||
|
@ -58,8 +58,6 @@ Wizard::InstallationPage::InstallationPage(QWidget *parent) :
|
|||||||
|
|
||||||
Wizard::InstallationPage::~InstallationPage()
|
Wizard::InstallationPage::~InstallationPage()
|
||||||
{
|
{
|
||||||
qDebug() << "stop!";
|
|
||||||
|
|
||||||
if (mThread->isRunning()) {
|
if (mThread->isRunning()) {
|
||||||
mUnshield->stopWorker();
|
mUnshield->stopWorker();
|
||||||
mThread->wait();
|
mThread->wait();
|
||||||
|
@ -331,12 +331,10 @@ void Wizard::MainWizard::setupPages()
|
|||||||
|
|
||||||
void Wizard::MainWizard::importerStarted()
|
void Wizard::MainWizard::importerStarted()
|
||||||
{
|
{
|
||||||
qDebug() << "importer started!";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Wizard::MainWizard::importerFinished(int exitCode, QProcess::ExitStatus exitStatus)
|
void Wizard::MainWizard::importerFinished(int exitCode, QProcess::ExitStatus exitStatus)
|
||||||
{
|
{
|
||||||
qDebug() << "importer finished!";
|
|
||||||
if (exitCode != 0 || exitStatus == QProcess::CrashExit)
|
if (exitCode != 0 || exitStatus == QProcess::CrashExit)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user