mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-09-14 00:49:09 +02:00
refs #1748 added command line switch "-1" to enforce first-time-run behavior
This commit is contained in:
@@ -170,7 +170,7 @@ FWBSettings::~FWBSettings()
|
||||
* On Windows default working dir is set to
|
||||
* "Documents and settings/USERNAME/Firewalls"
|
||||
*/
|
||||
void FWBSettings::init()
|
||||
void FWBSettings::init(bool force_first_time_run)
|
||||
{
|
||||
bool ok=false;
|
||||
|
||||
@@ -192,10 +192,14 @@ void FWBSettings::init()
|
||||
qsrand(time(NULL));
|
||||
uuid_settings->setValue(appGUID, QUuid::createUuid().toString());
|
||||
first_run = true;
|
||||
suppressReminderAboutStandardLib(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (force_first_time_run) first_run = true;
|
||||
|
||||
if (first_run)
|
||||
suppressReminderAboutStandardLib(false);
|
||||
|
||||
/*
|
||||
* I am seeing two particular uuids a lot in the logs, both coming
|
||||
* from thousands of different instances all over the world. I
|
||||
|
||||
@@ -70,7 +70,7 @@ class FWBSettings : public QSettings {
|
||||
|
||||
static QString getApplicationNameForSettings() { return "FirewallBuilder4.1"; }
|
||||
|
||||
void init();
|
||||
void init(bool force_first_time_run=false);
|
||||
void save();
|
||||
|
||||
bool isFirstRun() { return first_run; }
|
||||
|
||||
+9
-2
@@ -112,6 +112,8 @@ int main( int argc, char *argv[] )
|
||||
fwbdebug = 0;
|
||||
safemode = false;
|
||||
|
||||
bool force_first_time_run_flag = false;
|
||||
|
||||
ssh_wrapper(argc, argv);
|
||||
|
||||
// can not use "-p" for command line printing because
|
||||
@@ -119,7 +121,7 @@ int main( int argc, char *argv[] )
|
||||
// started via Finder.
|
||||
|
||||
int c;
|
||||
while ((c = getopt (argc , argv , "hvf:o:P:dxgr")) != EOF )
|
||||
while ((c = getopt (argc , argv , "1hvf:o:P:dxgr")) != EOF )
|
||||
switch (c) {
|
||||
case 'h':
|
||||
usage();
|
||||
@@ -148,6 +150,11 @@ int main( int argc, char *argv[] )
|
||||
case 'P':
|
||||
cli_print = true ;
|
||||
cli_print_fwname = optarg;
|
||||
break;
|
||||
|
||||
case '1':
|
||||
force_first_time_run_flag = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( (argc-1)==optind)
|
||||
@@ -170,7 +177,7 @@ int main( int argc, char *argv[] )
|
||||
|
||||
if (fwbdebug) qDebug("Reading settings ...");
|
||||
st = new FWBSettings();
|
||||
st->init();
|
||||
st->init(force_first_time_run_flag);
|
||||
if (fwbdebug) qDebug("done");
|
||||
|
||||
wfl = new UserWorkflow();
|
||||
|
||||
Reference in New Issue
Block a user