Message box on start if FG-home is read-only
If running with the launcher, and FG-home is read-only, show a warning to the user, since this is probably a surprise to them. (In non-launcher mode we don’t show the box, since it’s more likely to be an intentional duplicate launch)
This commit is contained in:
parent
1681b92c31
commit
08a877cb8e
1 changed files with 10 additions and 2 deletions
|
@ -465,7 +465,8 @@ int fgMainInit( int argc, char **argv )
|
|||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (!fgGetBool("/sim/fghome-readonly")) {
|
||||
const bool readOnlyFGHome = fgGetBool("/sim/fghome-readonly");
|
||||
if (!readOnlyFGHome) {
|
||||
// now home is initialised, we can log to a file inside it
|
||||
logToHome();
|
||||
}
|
||||
|
@ -490,7 +491,7 @@ int fgMainInit( int argc, char **argv )
|
|||
upper_case_property("/sim/tower/airport-id");
|
||||
upper_case_property("/autopilot/route-manager/input");
|
||||
|
||||
// check if the launcher is reuested, since it affects config file parsing
|
||||
// check if the launcher is requested, since it affects config file parsing
|
||||
bool showLauncher = flightgear::Options::checkForArg(argc, argv, "launcher");
|
||||
// an Info.plist bundle can't define command line arguments, but it can set
|
||||
// environment variables. This avoids needed a wrapper shell-script on OS-X.
|
||||
|
@ -502,6 +503,13 @@ int fgMainInit( int argc, char **argv )
|
|||
flightgear::Options::sharedInstance()->setShouldLoadDefaultConfig(false);
|
||||
}
|
||||
|
||||
if (showLauncher && readOnlyFGHome) {
|
||||
// this is perhaps not what the user wanted, let's inform them
|
||||
flightgear::modalMessageBox("Multiple copies of FlightGear",
|
||||
"Another copy of FlightGear is already running on this computer, "
|
||||
"so this copy will run in read-only mode.");
|
||||
}
|
||||
|
||||
// Load the configuration parameters. (Command line options
|
||||
// override config file options. Config file options override
|
||||
// defaults.)
|
||||
|
|
Loading…
Add table
Reference in a new issue