diff options
author | Sjors Provoost <sjors@sprovoost.nl> | 2019-08-24 22:34:59 +0200 |
---|---|---|
committer | Sjors Provoost <sjors@sprovoost.nl> | 2019-08-24 22:39:47 +0200 |
commit | 1bbc49d2078ee53488e214d00eb47462687b05c5 (patch) | |
tree | b871a8813df5495f9aac952e2722619ab64fce99 /src | |
parent | 1957103786f97135f35ababc97efa1b481865eb0 (diff) |
[gui] intro: inform caller if intro was shown
Diffstat (limited to 'src')
-rw-r--r-- | src/qt/bitcoin.cpp | 5 | ||||
-rw-r--r-- | src/qt/intro.cpp | 5 | ||||
-rw-r--r-- | src/qt/intro.h | 2 |
3 files changed, 8 insertions, 4 deletions
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index f2e62040ae..2592efc491 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -491,8 +491,9 @@ int GuiMain(int argc, char* argv[]) /// 5. Now that settings and translations are available, ask user for data directory // User language is set up: pick a data directory - if (!Intro::pickDataDirectory(*node)) - return EXIT_SUCCESS; + bool did_show_intro = false; + // Gracefully exit if the user cancels + if (!Intro::showIfNeeded(*node, did_show_intro)) return EXIT_SUCCESS; /// 6. Determine availability of data directory and parse bitcoin.conf /// - Do not call GetDataDir(true) before this step finishes diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp index 102e37e471..0a18561109 100644 --- a/src/qt/intro.cpp +++ b/src/qt/intro.cpp @@ -180,8 +180,10 @@ void Intro::setDataDirectory(const QString &dataDir) } } -bool Intro::pickDataDirectory(interfaces::Node& node) +bool Intro::showIfNeeded(interfaces::Node& node, bool& did_show_intro) { + did_show_intro = false; + QSettings settings; /* If data directory provided on command line, no need to look at settings or show a picking dialog */ @@ -205,6 +207,7 @@ bool Intro::pickDataDirectory(interfaces::Node& node) Intro intro(0, node.getAssumedBlockchainSize(), node.getAssumedChainStateSize()); intro.setDataDirectory(dataDir); intro.setWindowIcon(QIcon(":icons/bitcoin")); + did_show_intro = true; while(true) { diff --git a/src/qt/intro.h b/src/qt/intro.h index c3b26808d4..be8d6e34ad 100644 --- a/src/qt/intro.h +++ b/src/qt/intro.h @@ -46,7 +46,7 @@ public: * @note do NOT call global GetDataDir() before calling this function, this * will cause the wrong path to be cached. */ - static bool pickDataDirectory(interfaces::Node& node); + static bool showIfNeeded(interfaces::Node& node, bool& did_show_intro); Q_SIGNALS: void requestCheck(); |