summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-05-25 08:21:35 +0200
committerPetr Mrázek <peterix@gmail.com>2015-05-25 08:21:35 +0200
commit8fb5d4add3cbbd5a4c1d4cd32ddab67fda458afa (patch)
tree6bc748a8977b3411dc805344c6f5417779b174b0 /application
parent185ff238c202f3db20f013cd18cfbd99c9878e8e (diff)
downloadMultiMC-8fb5d4add3cbbd5a4c1d4cd32ddab67fda458afa.tar
MultiMC-8fb5d4add3cbbd5a4c1d4cd32ddab67fda458afa.tar.gz
MultiMC-8fb5d4add3cbbd5a4c1d4cd32ddab67fda458afa.tar.lz
MultiMC-8fb5d4add3cbbd5a4c1d4cd32ddab67fda458afa.tar.xz
MultiMC-8fb5d4add3cbbd5a4c1d4cd32ddab67fda458afa.zip
GH-1003 add some save locking for dialog pages that deal with settings
Diffstat (limited to 'application')
-rw-r--r--application/pagedialog/PageDialog.cpp3
-rw-r--r--application/pages/InstanceSettingsPage.cpp2
-rw-r--r--application/pages/global/ExternalToolsPage.cpp3
-rw-r--r--application/pages/global/JavaPage.cpp3
-rw-r--r--application/pages/global/MinecraftPage.cpp2
-rw-r--r--application/pages/global/MultiMCPage.cpp3
-rw-r--r--application/pages/global/ProxyPage.cpp2
7 files changed, 18 insertions, 0 deletions
diff --git a/application/pagedialog/PageDialog.cpp b/application/pagedialog/PageDialog.cpp
index a930789e..c2b480cf 100644
--- a/application/pagedialog/PageDialog.cpp
+++ b/application/pagedialog/PageDialog.cpp
@@ -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);
}
}
diff --git a/application/pages/InstanceSettingsPage.cpp b/application/pages/InstanceSettingsPage.cpp
index 3dc79688..296de379 100644
--- a/application/pages/InstanceSettingsPage.cpp
+++ b/application/pages/InstanceSettingsPage.cpp
@@ -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);
diff --git a/application/pages/global/ExternalToolsPage.cpp b/application/pages/global/ExternalToolsPage.cpp
index 426432a0..66d91a46 100644
--- a/application/pages/global/ExternalToolsPage.cpp
+++ b/application/pages/global/ExternalToolsPage.cpp
@@ -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());
diff --git a/application/pages/global/JavaPage.cpp b/application/pages/global/JavaPage.cpp
index d201bb2f..474d73d6 100644
--- a/application/pages/global/JavaPage.cpp
+++ b/application/pages/global/JavaPage.cpp
@@ -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());
diff --git a/application/pages/global/MinecraftPage.cpp b/application/pages/global/MinecraftPage.cpp
index 57f40ae6..c08f9140 100644
--- a/application/pages/global/MinecraftPage.cpp
+++ b/application/pages/global/MinecraftPage.cpp
@@ -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());
diff --git a/application/pages/global/MultiMCPage.cpp b/application/pages/global/MultiMCPage.cpp
index 348d08ae..1517b6e9 100644
--- a/application/pages/global/MultiMCPage.cpp
+++ b/application/pages/global/MultiMCPage.cpp
@@ -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());
diff --git a/application/pages/global/ProxyPage.cpp b/application/pages/global/ProxyPage.cpp
index f18f7049..f998fb4b 100644
--- a/application/pages/global/ProxyPage.cpp
+++ b/application/pages/global/ProxyPage.cpp
@@ -57,6 +57,8 @@ void ProxyPage::applySettings()
{
auto s = MMC->settings();
+ SettingsObject::Lock lock(s);
+
// Proxy
QString proxyType = "None";
if (ui->proxyDefaultBtn->isChecked())