mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
Add setting to edit instance on double click
Assisted-by: OpenAI Codex Signed-off-by: Sameer <sameer.adnan@proton.me>
This commit is contained in:
parent
bf8d1ca1f8
commit
675a80b7db
4 changed files with 26 additions and 0 deletions
|
|
@ -801,6 +801,7 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
|
|||
// Instance
|
||||
m_settings->registerSetting("InstSortMode", "Name");
|
||||
m_settings->registerSetting("InstRenamingMode", "AskEverytime");
|
||||
m_settings->registerSetting("OpenEditWindowOnInstanceDoubleClick", false);
|
||||
m_settings->registerSetting("SelectedInstance", QString());
|
||||
|
||||
// Window state and geometry
|
||||
|
|
|
|||
|
|
@ -1617,6 +1617,17 @@ void MainWindow::on_actionLaunchInstance_triggered()
|
|||
|
||||
void MainWindow::activateInstance(BaseInstance* instance)
|
||||
{
|
||||
if (APPLICATION->settings()->get("OpenEditWindowOnInstanceDoubleClick").toBool()) {
|
||||
if (instance->canEdit()) {
|
||||
APPLICATION->showInstanceWindow(instance);
|
||||
} else {
|
||||
CustomMessageBox::selectable(
|
||||
this, tr("Instance not editable"),
|
||||
tr("This instance is not editable. It may be broken, invalid, or too old. Check logs for details."), QMessageBox::Critical)
|
||||
->show();
|
||||
}
|
||||
return;
|
||||
}
|
||||
APPLICATION->launch(instance);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -241,6 +241,8 @@ void LauncherPage::applySettings()
|
|||
s->set("InstRenamingMode", "MetadataOnly");
|
||||
}
|
||||
|
||||
s->set("OpenEditWindowOnInstanceDoubleClick", ui->openEditWindowOnInstanceDoubleClickCheckBox->isChecked());
|
||||
|
||||
// Mods
|
||||
s->set("ModMetadataDisabled", !ui->metadataEnableBtn->isChecked());
|
||||
s->set("ModDependenciesDisabled", !ui->dependenciesEnableBtn->isChecked());
|
||||
|
|
@ -286,6 +288,8 @@ void LauncherPage::loadSettings()
|
|||
ui->sortByNameBtn->setChecked(true);
|
||||
}
|
||||
|
||||
ui->openEditWindowOnInstanceDoubleClickCheckBox->setChecked(s->get("OpenEditWindowOnInstanceDoubleClick").toBool());
|
||||
|
||||
QString renamingMode = s->get("InstRenamingMode").toString();
|
||||
ui->askToRenameDirBtn->setChecked(renamingMode == "AskEverytime");
|
||||
ui->alwaysRenameDirBtn->setChecked(renamingMode == "PhysicalDir");
|
||||
|
|
|
|||
|
|
@ -162,6 +162,16 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="openEditWindowOnInstanceDoubleClickCheckBox">
|
||||
<property name="toolTip">
|
||||
<string>Opens the edit instance window on double-clicking an instance instead of running the instance.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Open edit window on Instance double-click</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue