From 694701c4902e1b5a415a6a9d65ded65c7fff87d7 Mon Sep 17 00:00:00 2001 From: Giacomo Tazzari Date: Tue, 29 Jul 2014 23:56:11 +0200 Subject: [PATCH 1/2] On startup, sets the "Force Mining" client option to match the settings loaded by the GUI --- alethzero/MainWin.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 0226ac35d..1fbaf5e76 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -531,6 +531,7 @@ void Main::readSettings() ui->forceAddress->setText(s.value("forceAddress", "").toString()); ui->usePast->setChecked(s.value("usePast", true).toBool()); ui->forceMining->setChecked(s.value("forceMining", false).toBool()); + on_forceMining_triggered(); ui->paranoia->setChecked(s.value("paranoia", false).toBool()); ui->showAll->setChecked(s.value("showAll", false).toBool()); ui->showAllAccounts->setChecked(s.value("showAllAccounts", false).toBool()); From 59a858f45d26a380e423f421eb4bc61af889c08b Mon Sep 17 00:00:00 2001 From: Giacomo Tazzari Date: Wed, 30 Jul 2014 00:13:11 +0200 Subject: [PATCH 2/2] Allow MainWin::readSettings() to skip geometry restoration when killing the blockchain (it messes up widgets position when in full screen) --- alethzero/MainWin.cpp | 7 ++++--- alethzero/MainWin.h | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 1fbaf5e76..a384f2fcb 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -504,11 +504,12 @@ void Main::writeSettings() s.setValue("windowState", saveState()); } -void Main::readSettings() +void Main::readSettings(bool _skipGeometry) { QSettings s("ethereum", "alethzero"); - restoreGeometry(s.value("geometry").toByteArray()); + if (!_skipGeometry) + restoreGeometry(s.value("geometry").toByteArray()); restoreState(s.value("windowState").toByteArray()); m_myKeys.clear(); @@ -1352,7 +1353,7 @@ void Main::on_killBlockchain_triggered() m_client.reset(); m_client.reset(new Client("AlethZero", Address(), string(), true)); m_ethereum->setClient(m_client.get()); - readSettings(); + readSettings(true); installWatches(); refreshAll(); } diff --git a/alethzero/MainWin.h b/alethzero/MainWin.h index 1098e3e1e..ac3d442d6 100644 --- a/alethzero/MainWin.h +++ b/alethzero/MainWin.h @@ -157,7 +157,8 @@ private: void alterDebugStateGroup(bool _enable) const; void updateFee(); - void readSettings(); + void readSettings(bool _skipGeometry); + void readSettings() { readSettings(false); } void writeSettings(); bool isCreation() const;