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)
|
void PageDialog::closeEvent(QCloseEvent *event)
|
||||||
{
|
{
|
||||||
|
qDebug() << "Paged dialog close requested";
|
||||||
if (m_container->requestClose(event))
|
if (m_container->requestClose(event))
|
||||||
{
|
{
|
||||||
|
qDebug() << "Paged dialog close approved";
|
||||||
MMC->settings()->set("PagedGeometry", saveGeometry().toBase64());
|
MMC->settings()->set("PagedGeometry", saveGeometry().toBase64());
|
||||||
|
qDebug() << "Paged dialog geometry saved";
|
||||||
QDialog::closeEvent(event);
|
QDialog::closeEvent(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,8 @@ bool InstanceSettingsPage::apply()
|
|||||||
|
|
||||||
void InstanceSettingsPage::applySettings()
|
void InstanceSettingsPage::applySettings()
|
||||||
{
|
{
|
||||||
|
SettingsObject::Lock lock(m_settings);
|
||||||
|
|
||||||
// Console
|
// Console
|
||||||
bool console = ui->consoleSettingsBox->isChecked();
|
bool console = ui->consoleSettingsBox->isChecked();
|
||||||
m_settings->set("OverrideConsole", console);
|
m_settings->set("OverrideConsole", console);
|
||||||
|
@ -61,6 +61,9 @@ void ExternalToolsPage::loadSettings()
|
|||||||
void ExternalToolsPage::applySettings()
|
void ExternalToolsPage::applySettings()
|
||||||
{
|
{
|
||||||
auto s = MMC->settings();
|
auto s = MMC->settings();
|
||||||
|
|
||||||
|
SettingsObject::Lock lock(s);
|
||||||
|
|
||||||
s->set("JProfilerPath", ui->jprofilerPathEdit->text());
|
s->set("JProfilerPath", ui->jprofilerPathEdit->text());
|
||||||
s->set("JVisualVMPath", ui->jvisualvmPathEdit->text());
|
s->set("JVisualVMPath", ui->jvisualvmPathEdit->text());
|
||||||
s->set("MCEditPath", ui->mceditPathEdit->text());
|
s->set("MCEditPath", ui->mceditPathEdit->text());
|
||||||
|
@ -58,6 +58,9 @@ bool JavaPage::apply()
|
|||||||
void JavaPage::applySettings()
|
void JavaPage::applySettings()
|
||||||
{
|
{
|
||||||
auto s = MMC->settings();
|
auto s = MMC->settings();
|
||||||
|
|
||||||
|
SettingsObject::Lock lock(s);
|
||||||
|
|
||||||
// Memory
|
// Memory
|
||||||
s->set("MinMemAlloc", ui->minMemSpinBox->value());
|
s->set("MinMemAlloc", ui->minMemSpinBox->value());
|
||||||
s->set("MaxMemAlloc", ui->maxMemSpinBox->value());
|
s->set("MaxMemAlloc", ui->maxMemSpinBox->value());
|
||||||
|
@ -62,6 +62,8 @@ void MinecraftPage::applySettings()
|
|||||||
{
|
{
|
||||||
auto s = MMC->settings();
|
auto s = MMC->settings();
|
||||||
|
|
||||||
|
SettingsObject::Lock lock(s);
|
||||||
|
|
||||||
// Window Size
|
// Window Size
|
||||||
s->set("LaunchMaximized", ui->maximizedCheckBox->isChecked());
|
s->set("LaunchMaximized", ui->maximizedCheckBox->isChecked());
|
||||||
s->set("MinecraftWinWidth", ui->windowWidthSpinBox->value());
|
s->set("MinecraftWinWidth", ui->windowWidthSpinBox->value());
|
||||||
|
@ -247,6 +247,9 @@ void MultiMCPage::refreshUpdateChannelDesc()
|
|||||||
void MultiMCPage::applySettings()
|
void MultiMCPage::applySettings()
|
||||||
{
|
{
|
||||||
auto s = MMC->settings();
|
auto s = MMC->settings();
|
||||||
|
|
||||||
|
SettingsObject::Lock lock(s);
|
||||||
|
|
||||||
// Language
|
// Language
|
||||||
s->set("Language",
|
s->set("Language",
|
||||||
ui->languageBox->itemData(ui->languageBox->currentIndex()).toLocale().bcp47Name());
|
ui->languageBox->itemData(ui->languageBox->currentIndex()).toLocale().bcp47Name());
|
||||||
|
@ -57,6 +57,8 @@ void ProxyPage::applySettings()
|
|||||||
{
|
{
|
||||||
auto s = MMC->settings();
|
auto s = MMC->settings();
|
||||||
|
|
||||||
|
SettingsObject::Lock lock(s);
|
||||||
|
|
||||||
// Proxy
|
// Proxy
|
||||||
QString proxyType = "None";
|
QString proxyType = "None";
|
||||||
if (ui->proxyDefaultBtn->isChecked())
|
if (ui->proxyDefaultBtn->isChecked())
|
||||||
|
Loading…
Reference in New Issue
Block a user