From 7951abefe229cf68f467c18c3a58c2011829143c Mon Sep 17 00:00:00 2001 From: James Turner Date: Tue, 30 May 2017 10:02:30 +0100 Subject: [PATCH] Auto-select built-in FGdata when possible. As spotted by Thorsten, reduce user annoyance by asking about FGData when the built-in data is acceptable. (Advanced users can use the launcher or other options to change FGdata as normal). --- src/GUI/SetupRootDialog.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/GUI/SetupRootDialog.cxx b/src/GUI/SetupRootDialog.cxx index 7d7613254..14a159f25 100644 --- a/src/GUI/SetupRootDialog.cxx +++ b/src/GUI/SetupRootDialog.cxx @@ -109,8 +109,15 @@ SGPath SetupRootDialog::restoreUserSelectedRoot() if (validatePath(path) && validateVersion(path)) { return SGPath::fromUtf8(path.toStdString()); } else { - // we have an existing path but it's invalid. Let's ask the - // user what they want + // we have an existing path but it's invalid. + // let's see if the default root is acceptable, in which case we will + // switch to it. (This gives a more friendly upgrade experience). + if (defaultRootAcceptable()) { + return std::string(); // use the default path + } + + // okay, we don't have an acceptable FG_DATA anywhere we can find, we + // have to ask the user what they want to do. bool ok = runDialog(VersionCheckFailed); Q_ASSERT(ok); // run dialog either exit()s or sets fg_root, so this