Add ModpackUpdatePromptDisabled setting
When creating an instance of a modpack that's already associated with another instance, the user gets asked if they want to update that instance instead. This commit introduces a setting to suppress the prompt and directly create the new instance. Signed-off-by: Kationor <n96211028@gmail.com>
This commit is contained in:
parent
fc445078cd
commit
9b172278f8
@ -662,6 +662,7 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
|
|||||||
// Minecraft mods
|
// Minecraft mods
|
||||||
m_settings->registerSetting("ModMetadataDisabled", false);
|
m_settings->registerSetting("ModMetadataDisabled", false);
|
||||||
m_settings->registerSetting("ModDependenciesDisabled", false);
|
m_settings->registerSetting("ModDependenciesDisabled", false);
|
||||||
|
m_settings->registerSetting("ModpackUpdatePromptDisabled", false);
|
||||||
|
|
||||||
// Minecraft offline player name
|
// Minecraft offline player name
|
||||||
m_settings->registerSetting("LastOfflinePlayerName", "");
|
m_settings->registerSetting("LastOfflinePlayerName", "");
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#include "InstanceTask.h"
|
#include "InstanceTask.h"
|
||||||
|
|
||||||
|
#include "Application.h"
|
||||||
|
#include "settings/SettingsObject.h"
|
||||||
#include "ui/dialogs/CustomMessageBox.h"
|
#include "ui/dialogs/CustomMessageBox.h"
|
||||||
|
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
@ -22,6 +24,9 @@ InstanceNameChange askForChangingInstanceName(QWidget* parent, const QString& ol
|
|||||||
|
|
||||||
ShouldUpdate askIfShouldUpdate(QWidget* parent, QString original_version_name)
|
ShouldUpdate askIfShouldUpdate(QWidget* parent, QString original_version_name)
|
||||||
{
|
{
|
||||||
|
if (APPLICATION->settings()->get("ModpackUpdatePromptDisabled").toBool())
|
||||||
|
return ShouldUpdate::SkipUpdating;
|
||||||
|
|
||||||
auto info = CustomMessageBox::selectable(
|
auto info = CustomMessageBox::selectable(
|
||||||
parent, QObject::tr("Similar modpack was found!"),
|
parent, QObject::tr("Similar modpack was found!"),
|
||||||
QObject::tr(
|
QObject::tr(
|
||||||
|
@ -241,6 +241,7 @@ void LauncherPage::applySettings()
|
|||||||
// Mods
|
// Mods
|
||||||
s->set("ModMetadataDisabled", ui->metadataDisableBtn->isChecked());
|
s->set("ModMetadataDisabled", ui->metadataDisableBtn->isChecked());
|
||||||
s->set("ModDependenciesDisabled", ui->dependenciesDisableBtn->isChecked());
|
s->set("ModDependenciesDisabled", ui->dependenciesDisableBtn->isChecked());
|
||||||
|
s->set("ModpackUpdatePromptDisabled", ui->modpackUpdatePromptDisableBtn->isChecked());
|
||||||
}
|
}
|
||||||
void LauncherPage::loadSettings()
|
void LauncherPage::loadSettings()
|
||||||
{
|
{
|
||||||
@ -303,6 +304,7 @@ void LauncherPage::loadSettings()
|
|||||||
ui->metadataDisableBtn->setChecked(s->get("ModMetadataDisabled").toBool());
|
ui->metadataDisableBtn->setChecked(s->get("ModMetadataDisabled").toBool());
|
||||||
ui->metadataWarningLabel->setHidden(!ui->metadataDisableBtn->isChecked());
|
ui->metadataWarningLabel->setHidden(!ui->metadataDisableBtn->isChecked());
|
||||||
ui->dependenciesDisableBtn->setChecked(s->get("ModDependenciesDisabled").toBool());
|
ui->dependenciesDisableBtn->setChecked(s->get("ModDependenciesDisabled").toBool());
|
||||||
|
ui->modpackUpdatePromptDisableBtn->setChecked(s->get("ModpackUpdatePromptDisabled").toBool());
|
||||||
}
|
}
|
||||||
|
|
||||||
void LauncherPage::refreshFontPreview()
|
void LauncherPage::refreshFontPreview()
|
||||||
|
@ -243,6 +243,16 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="modpackUpdatePromptDisableBtn">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>When creating a new modpack instance, do not suggest updating existing instances.</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Always create new modpack instance</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
Reference in New Issue
Block a user