File tree Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ class BitcoinApplication: public QApplication
202
202
void createPaymentServer ();
203
203
#endif
204
204
// / Create options model
205
- void createOptionsModel ();
205
+ void createOptionsModel (bool resetSettings );
206
206
// / Create main window
207
207
void createWindow (const NetworkStyle *networkStyle);
208
208
// / Create splash screen
@@ -352,9 +352,9 @@ void BitcoinApplication::createPaymentServer()
352
352
}
353
353
#endif
354
354
355
- void BitcoinApplication::createOptionsModel ()
355
+ void BitcoinApplication::createOptionsModel (bool resetSettings )
356
356
{
357
- optionsModel = new OptionsModel ();
357
+ optionsModel = new OptionsModel (NULL , resetSettings );
358
358
}
359
359
360
360
void BitcoinApplication::createWindow (const NetworkStyle *networkStyle)
@@ -645,7 +645,7 @@ int main(int argc, char *argv[])
645
645
qInstallMessageHandler (DebugMessageHandler);
646
646
#endif
647
647
// Load GUI settings from QSettings
648
- app.createOptionsModel ();
648
+ app.createOptionsModel (mapArgs. count ( " -resetguisettings " ) != 0 );
649
649
650
650
// Subscribe to global signals from core
651
651
uiInterface.InitMessage .connect (InitMessage);
Original file line number Diff line number Diff line change 26
26
#include < QSettings>
27
27
#include < QStringList>
28
28
29
- OptionsModel::OptionsModel (QObject *parent) :
29
+ OptionsModel::OptionsModel (QObject *parent, bool resetSettings ) :
30
30
QAbstractListModel(parent)
31
31
{
32
- Init ();
32
+ Init (resetSettings );
33
33
}
34
34
35
35
void OptionsModel::addOverriddenOption (const std::string &option)
@@ -38,8 +38,11 @@ void OptionsModel::addOverriddenOption(const std::string &option)
38
38
}
39
39
40
40
// Writes all missing QSettings with their default values
41
- void OptionsModel::Init ()
41
+ void OptionsModel::Init (bool resetSettings )
42
42
{
43
+ if (resetSettings)
44
+ Reset ();
45
+
43
46
QSettings settings;
44
47
45
48
// Ensure restart flag is unset on client startup
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ class OptionsModel : public QAbstractListModel
24
24
Q_OBJECT
25
25
26
26
public:
27
- explicit OptionsModel (QObject *parent = 0 );
27
+ explicit OptionsModel (QObject *parent = 0 , bool resetSettings = false );
28
28
29
29
enum OptionID {
30
30
StartAtStartup, // bool
@@ -48,7 +48,7 @@ class OptionsModel : public QAbstractListModel
48
48
OptionIDRowCount,
49
49
};
50
50
51
- void Init ();
51
+ void Init (bool resetSettings = false );
52
52
void Reset ();
53
53
54
54
int rowCount (const QModelIndex & parent = QModelIndex()) const ;
You can’t perform that action at this time.
0 commit comments