mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
settings: Add resetSettings() method
Allows the GUI to clear settings.json file and save settings.json.bak file when GUI "Reset Options" button is pressed or -resetguisettings command line option is used. (GUI code already backs up and resets the "guisettings.ini" file this way, so this just makes the same behavior possible for "settings.json")
This commit is contained in:
parent
77fabffef4
commit
f9fdcec7e9
4 changed files with 22 additions and 6 deletions
|
|
@ -144,6 +144,14 @@ public:
|
|||
}
|
||||
});
|
||||
}
|
||||
void resetSettings() override
|
||||
{
|
||||
gArgs.WriteSettingsFile(/*errors=*/nullptr, /*backup=*/true);
|
||||
gArgs.LockSettings([&](util::Settings& settings) {
|
||||
settings.rw_settings.clear();
|
||||
});
|
||||
gArgs.WriteSettingsFile();
|
||||
}
|
||||
void mapPort(bool use_upnp, bool use_natpmp) override { StartMapPort(use_upnp, use_natpmp); }
|
||||
bool getProxy(Network net, Proxy& proxy_info) override { return GetProxy(net, proxy_info); }
|
||||
size_t getNodeCount(ConnectionDirection flags) override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue