mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-25 21:41:04 +00:00
Making "start default character at" field enabled or disabled by the previous checkbox
This commit is contained in:
parent
da74ca5ce0
commit
082e166fae
@ -177,28 +177,6 @@ void Launcher::SettingsPage::on_browseButton_clicked()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Launcher::SettingsPage::on_runScriptAfterStartupBrowseButton_clicked()
|
|
||||||
{
|
|
||||||
QString scriptFile = QFileDialog::getOpenFileName(
|
|
||||||
this,
|
|
||||||
QObject::tr("Select script file"),
|
|
||||||
QDir::currentPath(),
|
|
||||||
QString(tr("Text file (*.txt)")));
|
|
||||||
|
|
||||||
|
|
||||||
if (scriptFile.isEmpty())
|
|
||||||
return;
|
|
||||||
|
|
||||||
QFileInfo info(scriptFile);
|
|
||||||
|
|
||||||
if (!info.exists() || !info.isReadable())
|
|
||||||
return;
|
|
||||||
|
|
||||||
const QString path(QDir::toNativeSeparators(info.absoluteFilePath()));
|
|
||||||
|
|
||||||
runScriptAfterStartupField->setText(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Launcher::SettingsPage::wizardStarted()
|
void Launcher::SettingsPage::wizardStarted()
|
||||||
{
|
{
|
||||||
mMain->hide(); // Hide the launcher
|
mMain->hide(); // Hide the launcher
|
||||||
@ -269,6 +247,33 @@ void Launcher::SettingsPage::updateOkButton(const QString &text)
|
|||||||
: mProfileDialog->setOkButtonEnabled(true);
|
: mProfileDialog->setOkButtonEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Launcher::SettingsPage::on_skipMenuCheckBox_stateChanged(int state) {
|
||||||
|
startDefaultCharacterAtLabel->setEnabled(state == Qt::Checked);
|
||||||
|
startDefaultCharacterAtField->setEnabled(state == Qt::Checked);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Launcher::SettingsPage::on_runScriptAfterStartupBrowseButton_clicked()
|
||||||
|
{
|
||||||
|
QString scriptFile = QFileDialog::getOpenFileName(
|
||||||
|
this,
|
||||||
|
QObject::tr("Select script file"),
|
||||||
|
QDir::currentPath(),
|
||||||
|
QString(tr("Text file (*.txt)")));
|
||||||
|
|
||||||
|
|
||||||
|
if (scriptFile.isEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
QFileInfo info(scriptFile);
|
||||||
|
|
||||||
|
if (!info.exists() || !info.isReadable())
|
||||||
|
return;
|
||||||
|
|
||||||
|
const QString path(QDir::toNativeSeparators(info.absoluteFilePath()));
|
||||||
|
|
||||||
|
runScriptAfterStartupField->setText(path);
|
||||||
|
}
|
||||||
|
|
||||||
void Launcher::SettingsPage::saveSettings()
|
void Launcher::SettingsPage::saveSettings()
|
||||||
{
|
{
|
||||||
QString language(languageComboBox->currentText());
|
QString language(languageComboBox->currentText());
|
||||||
@ -307,8 +312,12 @@ bool Launcher::SettingsPage::loadSettings()
|
|||||||
languageComboBox->setCurrentIndex(index);
|
languageComboBox->setCurrentIndex(index);
|
||||||
|
|
||||||
// Testing
|
// Testing
|
||||||
if (mGameSettings.value("skip-menu").toInt() == 1)
|
bool skipMenu = mGameSettings.value("skip-menu").toInt() == Qt::Checked;
|
||||||
|
if (skipMenu) {
|
||||||
skipMenuCheckBox->setCheckState(Qt::Checked);
|
skipMenuCheckBox->setCheckState(Qt::Checked);
|
||||||
|
}
|
||||||
|
startDefaultCharacterAtLabel->setEnabled(skipMenu);
|
||||||
|
startDefaultCharacterAtField->setEnabled(skipMenu);
|
||||||
|
|
||||||
startDefaultCharacterAtField->setText(mGameSettings.value("start"));
|
startDefaultCharacterAtField->setText(mGameSettings.value("start"));
|
||||||
runScriptAfterStartupField->setText(mGameSettings.value("script-run"));
|
runScriptAfterStartupField->setText(mGameSettings.value("script-run"));
|
||||||
|
@ -38,7 +38,6 @@ namespace Launcher
|
|||||||
void on_wizardButton_clicked();
|
void on_wizardButton_clicked();
|
||||||
void on_importerButton_clicked();
|
void on_importerButton_clicked();
|
||||||
void on_browseButton_clicked();
|
void on_browseButton_clicked();
|
||||||
void on_runScriptAfterStartupBrowseButton_clicked();
|
|
||||||
|
|
||||||
void wizardStarted();
|
void wizardStarted();
|
||||||
void wizardFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
void wizardFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
||||||
@ -48,6 +47,9 @@ namespace Launcher
|
|||||||
|
|
||||||
void updateOkButton(const QString &text);
|
void updateOkButton(const QString &text);
|
||||||
|
|
||||||
|
void on_skipMenuCheckBox_stateChanged(int state);
|
||||||
|
void on_runScriptAfterStartupBrowseButton_clicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Process::ProcessInvoker *mWizardInvoker;
|
Process::ProcessInvoker *mWizardInvoker;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user