GH-1003 add some save locking for dialog pages that deal with settings
This commit is contained in:
parent
185ff238c2
commit
8fb5d4add3
@ -54,9 +54,12 @@ PageDialog::PageDialog(BasePageProviderPtr pageProvider, QString defaultId, QWid
|
||||
|
||||
void PageDialog::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
qDebug() << "Paged dialog close requested";
|
||||
if (m_container->requestClose(event))
|
||||
{
|
||||
qDebug() << "Paged dialog close approved";
|
||||
MMC->settings()->set("PagedGeometry", saveGeometry().toBase64());
|
||||
qDebug() << "Paged dialog geometry saved";
|
||||
QDialog::closeEvent(event);
|
||||
}
|
||||
}
|
||||
|
@ -37,6 +37,8 @@ bool InstanceSettingsPage::apply()
|
||||
|
||||
void InstanceSettingsPage::applySettings()
|
||||
{
|
||||
SettingsObject::Lock lock(m_settings);
|
||||
|
||||
// Console
|
||||
bool console = ui->consoleSettingsBox->isChecked();
|
||||
m_settings->set("OverrideConsole", console);
|
||||
|
@ -61,6 +61,9 @@ void ExternalToolsPage::loadSettings()
|
||||
void ExternalToolsPage::applySettings()
|
||||
{
|
||||
auto s = MMC->settings();
|
||||
|
||||
SettingsObject::Lock lock(s);
|
||||
|
||||
s->set("JProfilerPath", ui->jprofilerPathEdit->text());
|
||||
s->set("JVisualVMPath", ui->jvisualvmPathEdit->text());
|
||||
s->set("MCEditPath", ui->mceditPathEdit->text());
|
||||
|
@ -58,6 +58,9 @@ bool JavaPage::apply()
|
||||
void JavaPage::applySettings()
|
||||
{
|
||||
auto s = MMC->settings();
|
||||
|
||||
SettingsObject::Lock lock(s);
|
||||
|
||||
// Memory
|
||||
s->set("MinMemAlloc", ui->minMemSpinBox->value());
|
||||
s->set("MaxMemAlloc", ui->maxMemSpinBox->value());
|
||||
|
@ -62,6 +62,8 @@ void MinecraftPage::applySettings()
|
||||
{
|
||||
auto s = MMC->settings();
|
||||
|
||||
SettingsObject::Lock lock(s);
|
||||
|
||||
// Window Size
|
||||
s->set("LaunchMaximized", ui->maximizedCheckBox->isChecked());
|
||||
s->set("MinecraftWinWidth", ui->windowWidthSpinBox->value());
|
||||
|
@ -247,6 +247,9 @@ void MultiMCPage::refreshUpdateChannelDesc()
|
||||
void MultiMCPage::applySettings()
|
||||
{
|
||||
auto s = MMC->settings();
|
||||
|
||||
SettingsObject::Lock lock(s);
|
||||
|
||||
// Language
|
||||
s->set("Language",
|
||||
ui->languageBox->itemData(ui->languageBox->currentIndex()).toLocale().bcp47Name());
|
||||
|
@ -57,6 +57,8 @@ void ProxyPage::applySettings()
|
||||
{
|
||||
auto s = MMC->settings();
|
||||
|
||||
SettingsObject::Lock lock(s);
|
||||
|
||||
// Proxy
|
||||
QString proxyType = "None";
|
||||
if (ui->proxyDefaultBtn->isChecked())
|
||||
|
Loading…
Reference in New Issue
Block a user