Support for a startup configuration

The --config <configuration> (-c for short) command line option can be
used  to  select  an  existing  configuration  at  start  up.  If  the
configuration does not exist the last configuration used is selected.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7567 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Bill Somerville
2017-02-17 12:32:47 +00:00
parent 75d371ebd9
commit b4ea0194f1
3 changed files with 142 additions and 114 deletions
+9 -2
View File
@@ -110,7 +110,7 @@ int main(int argc, char *argv[])
#if QT_VERSION >= 0x050200
QCommandLineParser parser;
parser.setApplicationDescription ("\nJT65A & JT9 Weak Signal Communications Program.");
parser.setApplicationDescription ("\nJT65, JT9, JT4, MSK144, QRA64, ISCAT & WSPR Weak Signal Communications Program.");
auto help_option = parser.addHelpOption ();
auto version_option = parser.addVersionOption ();
@@ -120,6 +120,12 @@ int main(int argc, char *argv[])
, a.translate ("main", "rig-name"));
parser.addOption (rig_option);
// support for start up configuration
QCommandLineOption cfg_option (QStringList {} << "c" << "config"
, a.translate ("main", "Where <configuration> is an existing one.")
, a.translate ("main", "configuration"));
parser.addOption (cfg_option);
QCommandLineOption test_option (QStringList {} << "test-mode"
, a.translate ("main", "Writable files in test location. Use with caution, for testing only."));
parser.addOption (test_option);
@@ -168,8 +174,9 @@ int main(int argc, char *argv[])
multiple = true;
}
// now we have the application name we can open the settings
MultiSettings multi_settings;
MultiSettings multi_settings {parser.value (cfg_option)};
// find the temporary files path
QDir temp_dir {QStandardPaths::writableLocation (QStandardPaths::TempLocation)};