mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 02:03:11 +02:00
Add cmd line opt to disable settings reset popup
This commit is contained in:
parent
cc16dc07df
commit
1403fad04e
3 changed files with 10 additions and 3 deletions
|
@ -389,7 +389,10 @@ bool setupEssentials(int& argc, char** argv) {
|
||||||
|
|
||||||
Setting::preInit();
|
Setting::preInit();
|
||||||
|
|
||||||
bool previousSessionCrashed = CrashHandler::checkForResetSettings();
|
|
||||||
|
static const auto SUPPRESS_SETTINGS_RESET = "--suppress-settings-reset";
|
||||||
|
bool suppressPrompt = cmdOptionExists(argc, const_cast<const char**>(argv), SUPPRESS_SETTINGS_RESET);
|
||||||
|
bool previousSessionCrashed = CrashHandler::checkForResetSettings(suppressPrompt);
|
||||||
CrashHandler::writeRunningMarkerFiler();
|
CrashHandler::writeRunningMarkerFiler();
|
||||||
qAddPostRoutine(CrashHandler::deleteRunningMarkerFile);
|
qAddPostRoutine(CrashHandler::deleteRunningMarkerFile);
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
static const QString RUNNING_MARKER_FILENAME = "Interface.running";
|
static const QString RUNNING_MARKER_FILENAME = "Interface.running";
|
||||||
|
|
||||||
bool CrashHandler::checkForResetSettings() {
|
bool CrashHandler::checkForResetSettings(bool suppressPrompt) {
|
||||||
QSettings::setDefaultFormat(QSettings::IniFormat);
|
QSettings::setDefaultFormat(QSettings::IniFormat);
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
settings.beginGroup("Developer");
|
settings.beginGroup("Developer");
|
||||||
|
@ -42,6 +42,10 @@ bool CrashHandler::checkForResetSettings() {
|
||||||
QFile runningMarkerFile(runningMarkerFilePath());
|
QFile runningMarkerFile(runningMarkerFilePath());
|
||||||
bool wasLikelyCrash = runningMarkerFile.exists();
|
bool wasLikelyCrash = runningMarkerFile.exists();
|
||||||
|
|
||||||
|
if (suppressPrompt) {
|
||||||
|
return wasLikelyCrash;
|
||||||
|
}
|
||||||
|
|
||||||
if (wasLikelyCrash || askToResetSettings) {
|
if (wasLikelyCrash || askToResetSettings) {
|
||||||
if (displaySettingsResetOnCrash || askToResetSettings) {
|
if (displaySettingsResetOnCrash || askToResetSettings) {
|
||||||
Action action = promptUserForAction(wasLikelyCrash);
|
Action action = promptUserForAction(wasLikelyCrash);
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
class CrashHandler {
|
class CrashHandler {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static bool checkForResetSettings();
|
static bool checkForResetSettings(bool suppressPrompt = false);
|
||||||
|
|
||||||
static void writeRunningMarkerFiler();
|
static void writeRunningMarkerFiler();
|
||||||
static void deleteRunningMarkerFile();
|
static void deleteRunningMarkerFile();
|
||||||
|
|
Loading…
Reference in a new issue