Skip to content

Commit 9fb62da

Browse files
committed
Merge pull request #569 from crowning-/v0.12.1.x
Window positions not reset
2 parents ae1ceaa + 0af61bd commit 9fb62da

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

src/qt/dash.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,12 @@ BitcoinApplication::~BitcoinApplication()
359359
delete paymentServer;
360360
paymentServer = 0;
361361
#endif
362+
// Delete Qt-settings if user clicked on "Reset Options"
363+
QSettings settings;
364+
if(optionsModel->resetSettings){
365+
settings.clear();
366+
settings.sync();
367+
}
362368
delete optionsModel;
363369
optionsModel = 0;
364370
}

src/qt/optionsmodel.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ void OptionsModel::addOverriddenOption(const std::string &option)
4141
// Writes all missing QSettings with their default values
4242
void OptionsModel::Init()
4343
{
44+
resetSettings = false;
4445
QSettings settings;
4546

4647
// Ensure restart flag is unset on client startup
@@ -151,6 +152,7 @@ void OptionsModel::Reset()
151152

152153
// Remove all entries from our QSettings object
153154
settings.clear();
155+
resetSettings = true; // Needed in dash.cpp during shotdown to also remove the window positions
154156

155157
// default setting for OptionsModel::StartAtStartup - disabled
156158
if (GUIUtil::GetStartOnSystemStartup())

src/qt/optionsmodel.h

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class OptionsModel : public QAbstractListModel
7070
/* Restart flag helper */
7171
void setRestartRequired(bool fRequired);
7272
bool isRestartRequired();
73+
bool resetSettings;
7374

7475
private:
7576
/* Qt-only settings */

0 commit comments

Comments
 (0)