refs #1748 added command line switch "-1" to enforce first-time-run behavior

This commit is contained in:
Vadim Kurland
2010-09-29 03:55:25 +00:00
parent de7ba0f3ca
commit f4f303cbc2
4 changed files with 17 additions and 6 deletions
+1 -1
View File
@@ -1 +1 @@
#define BUILD_NUM 3278
#define BUILD_NUM 3279
+6 -2
View File
@@ -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
+1 -1
View File
@@ -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
View File
@@ -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();