mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-03-23 19:57:21 +01:00
build 3594; removed UserWorkflow and all calls to assemble and send user workflow report
This commit is contained in:
parent
24d8a8db3f
commit
15565ade5d
2
VERSION
2
VERSION
@ -7,7 +7,7 @@ FWB_MICRO_VERSION=2
|
||||
# build number is like "nano" version number. I am incrementing build
|
||||
# number during development cycle
|
||||
#
|
||||
BUILD_NUM="3593"
|
||||
BUILD_NUM="3594"
|
||||
|
||||
VERSION="$FWB_MAJOR_VERSION.$FWB_MINOR_VERSION.$FWB_MICRO_VERSION.$BUILD_NUM"
|
||||
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
#define VERSION "5.0.2.3593"
|
||||
#define VERSION "5.0.2.3594"
|
||||
#define GENERATION "5.0"
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
|
||||
%define name fwbuilder
|
||||
%define version 5.0.2.3593
|
||||
%define version 5.0.2.3594
|
||||
%define release 1
|
||||
|
||||
%if "%_vendor" == "MandrakeSoft"
|
||||
|
||||
@ -4,6 +4,6 @@ Replaces: fwbuilder (<=4.1.1-1), fwbuilder-common, fwbuilder-bsd, fwbuilder-linu
|
||||
Priority: extra
|
||||
Section: checkinstall
|
||||
Maintainer: vadim@fwbuilder.org
|
||||
Version: 5.0.2.3593-1
|
||||
Version: 5.0.2.3594-1
|
||||
Depends: libqt4-gui (>= 4.4.0), libqt4-network (>= 4.4.0), libxml2, libxslt1.1, libsnmp | libsnmp15
|
||||
Description: Firewall Builder GUI and policy compilers
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
|
||||
%define name fwbuilder
|
||||
%define version 5.0.2.3593
|
||||
%define version 5.0.2.3594
|
||||
%define release 1
|
||||
|
||||
%if "%_vendor" == "MandrakeSoft"
|
||||
|
||||
@ -104,7 +104,6 @@ extern int errno;
|
||||
#include "FWWindow.h"
|
||||
#include "FWBSettings.h"
|
||||
#include "FWBApplication.h"
|
||||
#include "UserWorkflow.h"
|
||||
|
||||
#include <QStringList>
|
||||
#include <QFile>
|
||||
@ -117,7 +116,6 @@ using namespace std;
|
||||
FWWindow *mw = NULL;
|
||||
FWBSettings *st = NULL;
|
||||
FWBApplication *app = NULL;
|
||||
UserWorkflow *wfl;
|
||||
int sig = FWB_SIG;
|
||||
|
||||
string cmd_str = "";
|
||||
|
||||
@ -62,7 +62,6 @@
|
||||
#include "findDialog.h"
|
||||
#include "ProjectPanel.h"
|
||||
#include "RCS.h"
|
||||
#include "UserWorkflow.h"
|
||||
|
||||
#include "fwbuilder/FWObject.h"
|
||||
#include "fwbuilder/Tools.h"
|
||||
@ -94,7 +93,6 @@ bool auto_load_from_rcs_head_revision = false;
|
||||
FWBApplication *app = NULL;
|
||||
FWWindow *mw = NULL;
|
||||
FWBSettings *st = NULL;
|
||||
UserWorkflow *wfl = NULL;
|
||||
int fwbdebug = 0;
|
||||
bool safemode = false;
|
||||
bool cli_print = false;
|
||||
@ -185,11 +183,9 @@ int main( int argc, char *argv[] )
|
||||
FWObject::setDataDir(st->getDataDir().toUtf8().constData());
|
||||
if (fwbdebug) qDebug("done");
|
||||
|
||||
wfl = new UserWorkflow();
|
||||
|
||||
QPixmapCache::setCacheLimit(4096);
|
||||
|
||||
INIT2;
|
||||
// INIT2;
|
||||
|
||||
string full_res_path = Constants::getResourcesFilePath();
|
||||
|
||||
|
||||
@ -82,7 +82,6 @@
|
||||
#include "fwbuilder/Logger.h"
|
||||
|
||||
#include "FWBSettings.h"
|
||||
#include "UserWorkflow.h"
|
||||
#include "ObjectManipulator.h"
|
||||
#include "FWWindow.h"
|
||||
#include "networkZoneManager.h"
|
||||
@ -852,8 +851,6 @@ void DiscoveryDruid::startConfigImport()
|
||||
thread->setTargetWidget(this);
|
||||
thread->start();
|
||||
|
||||
wfl->registerFlag(UserWorkflow::IMPORT, true);
|
||||
|
||||
} else
|
||||
{
|
||||
QMessageBox::critical(this, tr("Discovery error"),
|
||||
|
||||
@ -25,7 +25,6 @@
|
||||
|
||||
|
||||
#include "global.h"
|
||||
#include "UserWorkflow.h"
|
||||
#include "FWBSettings.h"
|
||||
#include "FWBApplication.h"
|
||||
#include "FWWindow.h"
|
||||
@ -48,7 +47,6 @@ void FWBApplication::quit()
|
||||
|
||||
if (st->getCheckUpdates())
|
||||
{
|
||||
wfl->report();
|
||||
QTimer::singleShot(100, this, SLOT(delayedQuit()));
|
||||
} else
|
||||
delayedQuit();
|
||||
@ -58,13 +56,6 @@ void FWBApplication::delayedQuit()
|
||||
{
|
||||
if (fwbdebug) qDebug() << "FWBApplication::delayedQuit()";
|
||||
|
||||
if (timeout < 20 && wfl->reportInProgress())
|
||||
{
|
||||
timeout++;
|
||||
QTimer::singleShot(100, this, SLOT(delayedQuit()));
|
||||
return;
|
||||
}
|
||||
|
||||
QApplication::quit();
|
||||
}
|
||||
|
||||
|
||||
@ -601,16 +601,6 @@ void FWBSettings::setShowUndoPanel(bool f) {setValue(showUndoPanel, f);}
|
||||
bool FWBSettings::getIconsWithText() { return value(iconsWithText).toBool(); }
|
||||
void FWBSettings::setIconsWithText(bool f) {setValue(iconsWithText, f);}
|
||||
|
||||
QByteArray FWBSettings::getUserWorkflowFlags()
|
||||
{
|
||||
return value(userWorkflowFlags).toByteArray();
|
||||
}
|
||||
|
||||
void FWBSettings::setUserWorkflowFlags(const QByteArray &f)
|
||||
{
|
||||
setValue(userWorkflowFlags, f);
|
||||
}
|
||||
|
||||
bool FWBSettings::haveScreenPosition(const QString &wname)
|
||||
{
|
||||
QString val = value(QString(screenPositionSetpath)+wname ).toString();
|
||||
|
||||
@ -267,9 +267,6 @@ class FWBSettings : public QSettings
|
||||
bool getShowUndoPanel();
|
||||
void setShowUndoPanel(bool);
|
||||
|
||||
QByteArray getUserWorkflowFlags();
|
||||
void setUserWorkflowFlags(const QByteArray &);
|
||||
|
||||
bool getIconsWithText();
|
||||
void setIconsWithText(bool f);
|
||||
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
#include "FWWindow.h"
|
||||
#include "FWCmdRule.h"
|
||||
#include "FindObjectWidget.h"
|
||||
#include "UserWorkflow.h"
|
||||
|
||||
#include "events.h"
|
||||
|
||||
@ -75,7 +74,6 @@ void FWCmdRule::notify()
|
||||
|
||||
void FWCmdRule::redo()
|
||||
{
|
||||
wfl->registerFlag(UserWorkflow::RULE_MOD, true);
|
||||
RuleSetModel* md = getRuleSetModel();
|
||||
redoOnModel(md);
|
||||
notify();
|
||||
@ -115,7 +113,6 @@ FWCmdRuleInsert::~FWCmdRuleInsert()
|
||||
|
||||
void FWCmdRuleInsert::redoOnModel(RuleSetModel *md)
|
||||
{
|
||||
wfl->registerFlag(UserWorkflow::RULE_MOD, true);
|
||||
if (insertedRule == 0) {
|
||||
if (ruleToInsert == 0)
|
||||
{
|
||||
@ -217,7 +214,6 @@ FWCmdRuleDelete::~FWCmdRuleDelete()
|
||||
|
||||
void FWCmdRuleDelete::redoOnModel(RuleSetModel *md)
|
||||
{
|
||||
wfl->registerFlag(UserWorkflow::RULE_MOD, true);
|
||||
if (fwbdebug)
|
||||
qDebug() << "FWCmdRuleDelete::redoOnModel(RuleSetModel *md)";
|
||||
foreach(Rule* rule, rulesToDelete)
|
||||
@ -278,8 +274,6 @@ void FWCmdRuleColor::redoOnModel(RuleSetModel *md)
|
||||
{
|
||||
QModelIndexList indexes;
|
||||
|
||||
wfl->registerFlag(UserWorkflow::RULE_MOD, true);
|
||||
|
||||
foreach(int ruleId, oldColors.keys())
|
||||
{
|
||||
Rule* rule = Rule::cast(getObject(ruleId));
|
||||
@ -322,7 +316,6 @@ FWCmdRuleMove::FWCmdRuleMove(ProjectPanel *project, RuleSet* ruleset,
|
||||
|
||||
void FWCmdRuleMove::redoOnModel(RuleSetModel *md)
|
||||
{
|
||||
wfl->registerFlag(UserWorkflow::RULE_MOD, true);
|
||||
move(md, direction);
|
||||
}
|
||||
|
||||
@ -371,7 +364,6 @@ FWCmdRuleRenameGroup::FWCmdRuleRenameGroup(
|
||||
|
||||
void FWCmdRuleRenameGroup::redoOnModel(RuleSetModel *md)
|
||||
{
|
||||
wfl->registerFlag(UserWorkflow::RULE_MOD, true);
|
||||
QModelIndex grp = md->index(oldName);
|
||||
md->renameGroup(grp, newName);
|
||||
}
|
||||
@ -397,7 +389,6 @@ FWCmdRuleRemoveFromGroup::FWCmdRuleRemoveFromGroup(
|
||||
|
||||
void FWCmdRuleRemoveFromGroup::redoOnModel(RuleSetModel *md)
|
||||
{
|
||||
wfl->registerFlag(UserWorkflow::RULE_MOD, true);
|
||||
QModelIndex group = md->index(groupName);
|
||||
QModelIndex first = md->index(firstRule, 0);
|
||||
QModelIndex last = md->index(lastRule, 0);
|
||||
@ -443,7 +434,6 @@ FWCmdRuleNewGroup::FWCmdRuleNewGroup(
|
||||
|
||||
void FWCmdRuleNewGroup::redoOnModel(RuleSetModel *md)
|
||||
{
|
||||
wfl->registerFlag(UserWorkflow::RULE_MOD, true);
|
||||
QModelIndex first = md->index(firstRule, 0);
|
||||
QModelIndex last = md->index(lastRule, 0);
|
||||
QModelIndex index = md->createNewGroup(groupName, first.row(), last.row());
|
||||
@ -475,7 +465,6 @@ FWCmdRuleAddToGroup::FWCmdRuleAddToGroup(
|
||||
|
||||
void FWCmdRuleAddToGroup::redoOnModel(RuleSetModel *md)
|
||||
{
|
||||
wfl->registerFlag(UserWorkflow::RULE_MOD, true);
|
||||
QModelIndex first = md->index(firstRule, 0);
|
||||
QModelIndex last = md->index(lastRule, 0);
|
||||
|
||||
@ -515,7 +504,6 @@ void FWCmdRuleChange::selectAffectedRule()
|
||||
|
||||
void FWCmdRuleChange::redo()
|
||||
{
|
||||
wfl->registerFlag(UserWorkflow::RULE_MOD, true);
|
||||
prepareRuleSetView();
|
||||
FWCmdChange::redo();
|
||||
selectAffectedRule();
|
||||
@ -670,8 +658,6 @@ FWCmdRuleNegateRE::FWCmdRuleNegateRE(
|
||||
|
||||
void FWCmdRuleNegateRE::redo()
|
||||
{
|
||||
wfl->registerFlag(UserWorkflow::RULE_MOD, true);
|
||||
|
||||
prepareRuleSetView();
|
||||
RuleElement* ruleElement = RuleElement::cast(getObject());
|
||||
ruleElement->toggleNeg();
|
||||
|
||||
@ -42,7 +42,6 @@
|
||||
#include "FWObjectClipboard.h"
|
||||
#include "FWBTree.h"
|
||||
#include "FWBSettings.h"
|
||||
#include "UserWorkflow.h"
|
||||
#include "FWObjectPropertiesFactory.h"
|
||||
#include "upgradePredicate.h"
|
||||
#include "ObjConflictResolutionDialog.h"
|
||||
@ -613,7 +612,6 @@ void FWWindow::showIntroDialog()
|
||||
|
||||
if (msg_box.clickedButton() == watch_button)
|
||||
{
|
||||
wfl->registerFlag(UserWorkflow::INTRO_TUTOTIAL, true);
|
||||
int ab_group = st->getABTestingGroup();
|
||||
QString url("http://www.fwbuilder.org/4.0/quick_start_guide_%1.html");
|
||||
QDesktopServices::openUrl(QUrl(url.arg(ab_group), QUrl::StrictMode));
|
||||
|
||||
@ -35,7 +35,6 @@
|
||||
#include "FirewallInstaller.h"
|
||||
#include "SSHSession.h"
|
||||
#include "SSHUnx.h"
|
||||
#include "UserWorkflow.h"
|
||||
#include "instDialog.h"
|
||||
|
||||
#include "fwbuilder/Resources.h"
|
||||
@ -536,8 +535,6 @@ void FirewallInstaller::runJobs()
|
||||
instJob current_job = job_list.front();
|
||||
job_list.pop_front();
|
||||
|
||||
wfl->registerFlag(UserWorkflow::INSTALL_RAN, true);
|
||||
|
||||
switch (current_job.job)
|
||||
{
|
||||
case COPY_FILE:
|
||||
|
||||
@ -38,7 +38,6 @@
|
||||
#include "ProjectPanel.h"
|
||||
#include "HttpGet.h"
|
||||
#include "RuleSetView.h"
|
||||
#include "UserWorkflow.h"
|
||||
|
||||
#include "fwbuilder/Resources.h"
|
||||
|
||||
@ -551,14 +550,9 @@ void PrefsDialog::accept()
|
||||
|
||||
st->setCheckUpdatesProxy(m_dialog->checkUpdatesProxy->text());
|
||||
|
||||
wfl->registerFlag(UserWorkflow::USING_HTTP_PROXY,
|
||||
!st->getCheckUpdatesProxy().isEmpty());
|
||||
|
||||
// annoyingly, widget shotTip has the name opposite to its meaning.
|
||||
// When it is checked, we do not show tip of the day.
|
||||
|
||||
wfl->registerFlag(UserWorkflow::TIP_OF_THE_DAY_DISABLED,
|
||||
m_dialog->showTips->isChecked());
|
||||
st->setBool("UI/NoStartTip", m_dialog->showTips->isChecked());
|
||||
|
||||
st->setSSHPath( m_dialog->sshPath->text() );
|
||||
@ -567,28 +561,6 @@ void PrefsDialog::accept()
|
||||
|
||||
st->setBool("Environment/RememberSshPassEnabled", m_dialog->rememberSshPass->isChecked());
|
||||
|
||||
wfl->registerFlag(UserWorkflow::SSH_CONFIGURED,
|
||||
!m_dialog->sshPath->text().isEmpty() &&
|
||||
!m_dialog->scpPath->text().isEmpty());
|
||||
|
||||
|
||||
if (m_dialog->checkUpdates->isChecked())
|
||||
{
|
||||
wfl->registerFlag(UserWorkflow::UPDATE_CHECKS_DISABLED, false);
|
||||
} else
|
||||
{
|
||||
wfl->registerFlag(UserWorkflow::UPDATE_CHECKS_DISABLED, true);
|
||||
|
||||
if (st->getCheckUpdates())
|
||||
{
|
||||
// update checking was enabled but the user disabled it in
|
||||
// this preferences dialog session. Run last closing
|
||||
// report before disabling both update check and closing
|
||||
// report.
|
||||
wfl->report();
|
||||
}
|
||||
}
|
||||
|
||||
st->setCheckUpdates(m_dialog->checkUpdates->isChecked());
|
||||
|
||||
for (int row=0; row < m_dialog->enabled_platforms->rowCount(); ++row)
|
||||
|
||||
@ -39,7 +39,6 @@
|
||||
#include "fwbuilder/RuleElement.h"
|
||||
|
||||
#include "FWBSettings.h"
|
||||
#include "UserWorkflow.h"
|
||||
#include "FWBTree.h"
|
||||
#include "FWObjectPropertiesFactory.h"
|
||||
#include "FWWindow.h"
|
||||
@ -704,8 +703,6 @@ void ProjectPanel::compileThis()
|
||||
// see comment in FWWindow::compile()
|
||||
if (db()->isDirty()) return;
|
||||
|
||||
wfl->registerFlag(UserWorkflow::COMPILE, true);
|
||||
|
||||
set<Firewall*> fw;
|
||||
Firewall *f = Firewall::cast(visibleRuleSet->getParent());
|
||||
if (f)
|
||||
@ -723,8 +720,6 @@ void ProjectPanel::installThis()
|
||||
// see comment in FWWindow::compile()
|
||||
if (db()->isDirty()) return;
|
||||
|
||||
wfl->registerFlag(UserWorkflow::INSTALL, true);
|
||||
|
||||
set<Firewall*> fw;
|
||||
Firewall *f = Firewall::cast(visibleRuleSet->getParent());
|
||||
if (f)
|
||||
@ -794,7 +789,6 @@ void ProjectPanel::compile()
|
||||
if (db()->isDirty()) return;
|
||||
|
||||
//fileSave();
|
||||
wfl->registerFlag(UserWorkflow::COMPILE, true);
|
||||
mainW->compile();
|
||||
}
|
||||
|
||||
@ -809,7 +803,6 @@ void ProjectPanel::compile(set<Firewall*> vf)
|
||||
if (db()->isDirty()) return;
|
||||
|
||||
//fileSave();
|
||||
wfl->registerFlag(UserWorkflow::COMPILE, true);
|
||||
mainW->compile(vf);
|
||||
}
|
||||
|
||||
@ -819,7 +812,6 @@ void ProjectPanel::install(set<Firewall*> vf)
|
||||
// see comment in FWWindow::compile()
|
||||
if (db()->isDirty()) return;
|
||||
|
||||
wfl->registerFlag(UserWorkflow::INSTALL, true);
|
||||
mainW->install(vf);
|
||||
}
|
||||
|
||||
@ -829,7 +821,6 @@ void ProjectPanel::install()
|
||||
// see comment in FWWindow::compile()
|
||||
if (db()->isDirty()) return;
|
||||
|
||||
wfl->registerFlag(UserWorkflow::INSTALL, true);
|
||||
mainW->install();
|
||||
}
|
||||
|
||||
|
||||
@ -32,7 +32,6 @@
|
||||
#include "FWBSettings.h"
|
||||
#include "FWWindow.h"
|
||||
#include "Help.h"
|
||||
#include "UserWorkflow.h"
|
||||
|
||||
#include "fwbuilder/Constants.h"
|
||||
|
||||
@ -231,7 +230,6 @@ void StartTipDialog::prevTip()
|
||||
|
||||
void StartTipDialog::showGettingStartedTutorial()
|
||||
{
|
||||
wfl->registerFlag(UserWorkflow::INTRO_TUTOTIAL, true);
|
||||
int ab_group = st->getABTestingGroup();
|
||||
QString url("http://www.fwbuilder.org/4.0/quick_start_guide_%1.html");
|
||||
QDesktopServices::openUrl(QUrl(url.arg(ab_group), QUrl::StrictMode));
|
||||
|
||||
@ -27,7 +27,6 @@
|
||||
|
||||
#include "TutorialDialog.h"
|
||||
#include "ui_TutorialDialog.h"
|
||||
#include "UserWorkflow.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QFile>
|
||||
@ -82,7 +81,6 @@ void TutorialDialog::initializeTutorial(QString tutorial)
|
||||
currentPage = 0;
|
||||
showPage(currentPage);
|
||||
|
||||
wfl->registerTutorialViewing(tutorial);
|
||||
}
|
||||
|
||||
TutorialDialog::~TutorialDialog()
|
||||
|
||||
@ -1,175 +0,0 @@
|
||||
/*
|
||||
|
||||
Firewall Builder
|
||||
|
||||
Copyright (C) 2010 NetCitadel, LLC
|
||||
|
||||
Author: Vadim Kurland vadim@fwbuilder.org
|
||||
|
||||
$Id$
|
||||
|
||||
This program is free software which we release under the GNU General Public
|
||||
License. You may redistribute and/or modify this program under the terms
|
||||
of that license as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
To get a copy of the GNU General Public License, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
*/
|
||||
|
||||
#include "global.h"
|
||||
|
||||
#include "UserWorkflow.h"
|
||||
#include "FWBSettings.h"
|
||||
#include "HttpGet.h"
|
||||
|
||||
#include <QtDebug>
|
||||
#include <QTimer>
|
||||
#include <QDataStream>
|
||||
|
||||
|
||||
/*
|
||||
* Create object UserWorkflow only after FWBSettings object has been
|
||||
* created and initialized.
|
||||
*/
|
||||
UserWorkflow::UserWorkflow()
|
||||
{
|
||||
assert(st != NULL);
|
||||
start_timestamp = QDateTime::currentDateTime();
|
||||
report_query = NULL;
|
||||
|
||||
QDataStream str(st->getUserWorkflowFlags());
|
||||
str.setVersion(QDataStream::Qt_4_0);
|
||||
str >> flags;
|
||||
|
||||
if (fwbdebug)
|
||||
qDebug() << "UserWorkflow flags initialization:" << flagsToQueryString(0);
|
||||
|
||||
// what if the user disabled tip of the day before they upgraded
|
||||
// to the version with UserWorkflow ? Or re-enabled version update
|
||||
// check ?
|
||||
|
||||
registerFlag(TIP_OF_THE_DAY_DISABLED, st->getBool("UI/NoStartTip"));
|
||||
registerFlag(UPDATE_CHECKS_DISABLED, !st->getCheckUpdates());
|
||||
|
||||
registerFlag(UserWorkflow::SSH_CONFIGURED,
|
||||
!st->getSCPPath().isEmpty() && !st->getSCPPath().isEmpty());
|
||||
}
|
||||
|
||||
UserWorkflow::~UserWorkflow()
|
||||
{
|
||||
if (report_query != NULL) delete report_query;
|
||||
}
|
||||
|
||||
void UserWorkflow::registerFlag(enum workflowFlags e, quint32 f)
|
||||
{
|
||||
if (fwbdebug)
|
||||
qDebug() << "UserWorkflow::registerFlag(" << e << "," << f << ")";
|
||||
flags.insert(e, f);
|
||||
|
||||
QByteArray buffer;
|
||||
QDataStream str(&buffer, QIODevice::WriteOnly);
|
||||
str.setVersion(QDataStream::Qt_4_0);
|
||||
str << flags;
|
||||
|
||||
st->setUserWorkflowFlags(buffer);
|
||||
}
|
||||
|
||||
void UserWorkflow::registerTutorialViewing(const QString &tutorial_name)
|
||||
{
|
||||
if (tutorial_name == "getting_started")
|
||||
registerFlag(UserWorkflow::GETTING_STARTED_TUTOTIAL, true);
|
||||
}
|
||||
|
||||
QString UserWorkflow::flagsToQueryString(int session_duration)
|
||||
{
|
||||
// query string of flags has the format uc=0&gs=1&ft=0 ...
|
||||
// each flag is a two-characters variable with a value of 0 or 1
|
||||
QStringList fl;
|
||||
fl << QString("ab=%1").arg(st->getABTestingGroup());
|
||||
fl << QString("co=%1").arg(flags.value(COMPILE));
|
||||
fl << QString("fn=%1").arg(flags.value(NEW_FW_NO_TEMPLATE));
|
||||
fl << QString("ft=%1").arg(flags.value(NEW_FW_WITH_TEMPLATE));
|
||||
fl << QString("gs=%1").arg(flags.value(GETTING_STARTED_TUTOTIAL));
|
||||
fl << QString("im=%1").arg(flags.value(IMPORT));
|
||||
fl << QString("in=%1").arg(flags.value(INSTALL));
|
||||
fl << QString("ir=%1").arg(flags.value(INSTALL_RAN));
|
||||
fl << QString("is=%1").arg(flags.value(INSTALL_SUCCESS));
|
||||
fl << QString("it=%1").arg(flags.value(INTRO_TUTOTIAL));
|
||||
fl << QString("pr=%1").arg(flags.value(USING_HTTP_PROXY));
|
||||
fl << QString("rm=%1").arg(flags.value(RULE_MOD));
|
||||
fl << QString("sc=%1").arg(flags.value(SSH_CONFIGURED));
|
||||
fl << QString("sd=%1").arg(session_duration);
|
||||
fl << QString("ti=%1").arg(flags.value(TIP_OF_THE_DAY_DISABLED));
|
||||
fl << QString("uc=%1").arg(flags.value(UPDATE_CHECKS_DISABLED));
|
||||
return fl.join("&");
|
||||
}
|
||||
|
||||
void UserWorkflow::report()
|
||||
{
|
||||
uint elapsed_time = QDateTime::currentDateTime().toTime_t() -
|
||||
start_timestamp.toTime_t();
|
||||
|
||||
// Note that QTime::elapsed() wraps to zero after ~24hr. If
|
||||
// program stayed open for over 24 hr, it would return incorrect
|
||||
// session duration.
|
||||
|
||||
if (fwbdebug)
|
||||
{
|
||||
QByteArray buffer;
|
||||
QDataStream str(&buffer, QIODevice::WriteOnly);
|
||||
str.setVersion(QDataStream::Qt_4_0);
|
||||
str << flags;
|
||||
|
||||
qDebug() << "UserWorkflow::report():" << flagsToQueryString(elapsed_time);
|
||||
qDebug() << "Session:" << elapsed_time << "sec";
|
||||
}
|
||||
|
||||
report_query = new HttpGet();
|
||||
connect(report_query, SIGNAL(done(const QString&)),
|
||||
this, SLOT(reportDone(const QString&)));
|
||||
|
||||
QString report_url = CLOSING_REPORT_URL;
|
||||
|
||||
// Use env variable FWBUILDER_CLOSING_REPORT_URL to override url to test
|
||||
// e.g. export FWBUILDER_CLOSING_REPORT_URL="file://$(pwd)/report_%1"
|
||||
//
|
||||
char* report_override_url = getenv("FWBUILDER_CLOSING_REPORT_URL");
|
||||
if (report_override_url != NULL)
|
||||
report_url = QString(report_override_url);
|
||||
|
||||
// closing report url has three parameters:
|
||||
// %1 = version
|
||||
// %2 = uuid
|
||||
// %3 = a query string of flags in the format uc=0&gs=1&ft=0 ...
|
||||
// each flag is a two-characters variable with a value of 0 or 1
|
||||
|
||||
QString url = QString(report_url)
|
||||
.arg(VERSION).arg(st->getAppGUID()).arg(flagsToQueryString(elapsed_time));
|
||||
|
||||
// start http query
|
||||
if (!report_query->get(url) && fwbdebug)
|
||||
{
|
||||
qDebug() << "HttpGet error: " << report_query->getLastError();
|
||||
qDebug() << "Url: " << url;
|
||||
}
|
||||
|
||||
if (fwbdebug) qDebug() << "Request launched";
|
||||
}
|
||||
|
||||
void UserWorkflow::reportDone(const QString& resp)
|
||||
{
|
||||
if (fwbdebug) qDebug() << "UserWorkflow::reportDone" << resp;
|
||||
|
||||
disconnect(report_query, SIGNAL(done(const QString&)),
|
||||
this, SLOT(reportDone(const QString&)));
|
||||
// we ignore server response for the closing reports.
|
||||
if (report_query != NULL) report_query->deleteLater();
|
||||
report_query = NULL;
|
||||
}
|
||||
@ -1,114 +0,0 @@
|
||||
/*
|
||||
|
||||
Firewall Builder
|
||||
|
||||
Copyright (C) 2010 NetCitadel, LLC
|
||||
|
||||
Author: Vadim Kurland vadim@fwbuilder.org
|
||||
|
||||
$Id$
|
||||
|
||||
This program is free software which we release under the GNU General Public
|
||||
License. You may redistribute and/or modify this program under the terms
|
||||
of that license as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
To get a copy of the GNU General Public License, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __USERWORKFLOW_H_
|
||||
#define __USERWORKFLOW_H_
|
||||
|
||||
#include <QObject>
|
||||
#include <QDateTime>
|
||||
#include <QHash>
|
||||
|
||||
#include "HttpGet.h"
|
||||
|
||||
/*
|
||||
* We track certain events in the new user workflow to optimize user
|
||||
* experience. This helps us understand things such as if "Getting
|
||||
* Started" tutorial helps convert users that just experiment with the
|
||||
* program into active users. We would like to know at what point
|
||||
* users abandon the program after they launch it for the first
|
||||
* time. We keep a boolean flag for each event in the settings (to
|
||||
* make it presistent) and report combination of the flags when the
|
||||
* GUI is closed.
|
||||
*
|
||||
* To report workflow statistics, the program connects to our web
|
||||
* server when user closes the program. If update checking is disabled
|
||||
* in the global preferences, this closing report is disabled as
|
||||
* well.
|
||||
*
|
||||
* Connection sends the following data to the server:
|
||||
*
|
||||
* version, uuid and a combination of bit flags of the following (each
|
||||
* flag is set once when corresponding even happens for the first
|
||||
* time; flag is not updated ever since)
|
||||
*
|
||||
* - user disabled version update and closing reports checks (sent once when checks and reports are disabled)
|
||||
* - user looked at the "Getting Started" tutorial at least once
|
||||
* - user created their first firewall object using template
|
||||
* - user created their first firewall object without template
|
||||
* - user did their first rule modification of any kind
|
||||
* - user ran their first policy compile
|
||||
* - user ran their first policy install
|
||||
* - user ran their first policy import
|
||||
*
|
||||
*/
|
||||
|
||||
#define CLOSING_REPORT_URL \
|
||||
"http://update.fwbuilder.org/reports/closing.cgi?v=%1&uuid=%2&%3"
|
||||
|
||||
class UserWorkflow : public QObject {
|
||||
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
|
||||
enum workflowFlags
|
||||
{
|
||||
UPDATE_CHECKS_DISABLED,
|
||||
GETTING_STARTED_TUTOTIAL,
|
||||
NEW_FW_WITH_TEMPLATE,
|
||||
NEW_FW_NO_TEMPLATE,
|
||||
RULE_MOD,
|
||||
COMPILE,
|
||||
INSTALL,
|
||||
INSTALL_RAN,
|
||||
INSTALL_SUCCESS,
|
||||
IMPORT,
|
||||
TIP_OF_THE_DAY_DISABLED,
|
||||
USING_HTTP_PROXY,
|
||||
SSH_CONFIGURED,
|
||||
INTRO_TUTOTIAL,
|
||||
};
|
||||
|
||||
private:
|
||||
QDateTime start_timestamp;
|
||||
QHash<quint32, quint32> flags;
|
||||
HttpGet *report_query;
|
||||
|
||||
QString flagsToQueryString(int session_duration);
|
||||
|
||||
public:
|
||||
UserWorkflow();
|
||||
virtual ~UserWorkflow();
|
||||
void registerFlag(enum workflowFlags e, quint32 f);
|
||||
void registerTutorialViewing(const QString &tutorial_name);
|
||||
void report();
|
||||
bool reportInProgress() { return report_query != NULL; }
|
||||
|
||||
public slots:
|
||||
void reportDone(const QString&);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@ -35,12 +35,10 @@ class QString;
|
||||
class FWBApplication;
|
||||
class FWWindow;
|
||||
class FWBSettings;
|
||||
class UserWorkflow;
|
||||
|
||||
extern FWBApplication *app;
|
||||
extern FWWindow *mw;
|
||||
extern FWBSettings *st;
|
||||
extern UserWorkflow *wfl;
|
||||
|
||||
extern std::string appRootDir;
|
||||
extern std::string userDataDir;
|
||||
|
||||
@ -35,7 +35,6 @@
|
||||
#include "InstallFirewallViewItem.h"
|
||||
#include "instOptionsDialog.h"
|
||||
#include "instBatchOptionsDialog.h"
|
||||
#include "UserWorkflow.h"
|
||||
#include "FirewallCodeViewer.h"
|
||||
|
||||
#include <qcheckbox.h>
|
||||
@ -370,9 +369,6 @@ void instDialog::opSuccess(Firewall *fw)
|
||||
setSuccessState(itm);
|
||||
}
|
||||
currentLabel->setText("");
|
||||
|
||||
if (installer)
|
||||
wfl->registerFlag(UserWorkflow::INSTALL_SUCCESS, true);
|
||||
}
|
||||
|
||||
void instDialog::opError(Firewall *fw)
|
||||
|
||||
@ -185,7 +185,6 @@ HEADERS += ../../config.h \
|
||||
IconSetter.h \
|
||||
TutorialDialog.h \
|
||||
MDIEventFilter.h \
|
||||
UserWorkflow.h \
|
||||
FWBApplication.h \
|
||||
WorkflowIcons.h \
|
||||
FirewallCodeViewer.h \
|
||||
@ -403,7 +402,6 @@ SOURCES += ProjectPanel.cpp \
|
||||
UsageResolver.cpp \
|
||||
TutorialDialog.cpp \
|
||||
MDIEventFilter.cpp \
|
||||
UserWorkflow.cpp \
|
||||
FWBApplication.cpp \
|
||||
WorkflowIcons.cpp \
|
||||
FirewallCodeViewer.cpp \
|
||||
|
||||
@ -33,7 +33,6 @@
|
||||
#include "FWBSettings.h"
|
||||
#include "FWBTree.h"
|
||||
#include "events.h"
|
||||
#include "UserWorkflow.h"
|
||||
#include "FWBApplication.h"
|
||||
#include "QDesktopWidget"
|
||||
#include "networkZoneManager.h"
|
||||
@ -1125,8 +1124,6 @@ void newFirewallDialog::finishClicked()
|
||||
|
||||
} else
|
||||
{
|
||||
wfl->registerFlag(UserWorkflow::NEW_FW_NO_TEMPLATE, true);
|
||||
|
||||
// Create from interface list (obtained either manually or via snmp)
|
||||
if ( !this->m_dialog->interfaceEditor1->isValid() )
|
||||
return;
|
||||
|
||||
@ -30,7 +30,6 @@
|
||||
|
||||
#include "newFirewallDialog.h"
|
||||
#include "FWBSettings.h"
|
||||
#include "UserWorkflow.h"
|
||||
#include "FWBTree.h"
|
||||
#include "InterfaceEditorWidget.h"
|
||||
#include "InterfacesTabWidget.h"
|
||||
@ -75,8 +74,6 @@ class FindNetwork : public FWObjectFindPredicate
|
||||
|
||||
void newFirewallDialog::createFirewallFromTemplate()
|
||||
{
|
||||
wfl->registerFlag(UserWorkflow::NEW_FW_WITH_TEMPLATE, true);
|
||||
|
||||
QListWidgetItem *itm = m_dialog->templateList->currentItem();
|
||||
FWObject *template_fw = templates[itm];
|
||||
assert (template_fw!=NULL);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user