mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-09-13 16:39:48 +02:00
version checker
This commit is contained in:
@@ -1,3 +1,15 @@
|
||||
2008-08-10 Vadim Kurland <vadim@vk.crocodile.org>
|
||||
|
||||
* FWWindow.cpp (FWWindow::checkForUpgrade): the GUI checks if
|
||||
updated version is available on startup by making simple HTTP GET
|
||||
request to the web site at http://www.fwbuilder.org. This can be
|
||||
turned off in the Preferences dialog. Preferences dialog also
|
||||
provides a button to perform this query at any time. If function
|
||||
is enabled in Preferences, it is performed at every time the GUI
|
||||
is launched. The query does not transmit any data to the server,
|
||||
but the URL of the query includes the version of the Firewall
|
||||
Builder.
|
||||
|
||||
2008-08-06 Vadim Kurland <vadim@vk.crocodile.org>
|
||||
|
||||
* new_object.cpp (newObject): fixed bug # 1997469: "Create a new
|
||||
|
||||
@@ -105,6 +105,8 @@ const char* uiFont = SETTINGS_PATH_PREFIX "/UI/Fonts/UiFont";
|
||||
|
||||
const char* clipComment = SETTINGS_PATH_PREFIX "/UI/ClipComment";
|
||||
|
||||
const char* checkUpdates = SETTINGS_PATH_PREFIX "/UI/CheckUpdates";
|
||||
|
||||
FWBSettings::FWBSettings() :
|
||||
QSettings(QSettings::UserScope, "netcitadel.com", "Firewall Builder")
|
||||
{
|
||||
@@ -207,6 +209,10 @@ void FWBSettings::init()
|
||||
ok = contains(clipComment);
|
||||
if (!ok) setClipComment(true);
|
||||
|
||||
ok = contains(checkUpdates);
|
||||
if (!ok) setCheckUpdates(true);
|
||||
|
||||
|
||||
#ifndef _WIN32
|
||||
if (getSSHPath().isEmpty()) setSSHPath("ssh");
|
||||
#endif
|
||||
@@ -657,3 +663,15 @@ void FWBSettings::setClipComment(bool clip)
|
||||
{
|
||||
setValue(clipComment, clip);
|
||||
}
|
||||
|
||||
bool FWBSettings::getCheckUpdates()
|
||||
{
|
||||
return value(checkUpdates).toBool();
|
||||
}
|
||||
|
||||
void FWBSettings::setCheckUpdates(bool f)
|
||||
{
|
||||
setValue(checkUpdates, f);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -157,6 +157,10 @@ class FWBSettings : public QSettings {
|
||||
|
||||
bool getClipComment();
|
||||
void setClipComment(bool);
|
||||
|
||||
bool getCheckUpdates();
|
||||
void setCheckUpdates(bool);
|
||||
|
||||
private:
|
||||
QFont getFontByType(const char*type);
|
||||
};
|
||||
|
||||
+42
-3
@@ -26,10 +26,12 @@
|
||||
|
||||
#include "../../config.h"
|
||||
#include "global.h"
|
||||
#include "check_update_url.h"
|
||||
#include "utils.h"
|
||||
#include "utils_no_qt.h"
|
||||
|
||||
#include "FWWindow.h"
|
||||
#include "ProjectPanel.h"
|
||||
#include "ObjectTreeView.h"
|
||||
#include "ObjectManipulator.h"
|
||||
#include "FWObjectClipboard.h"
|
||||
@@ -55,6 +57,7 @@
|
||||
|
||||
#include "instConf.h"
|
||||
#include "instDialog.h"
|
||||
#include "HttpGet.h"
|
||||
|
||||
#include "fwbuilder/FWReference.h"
|
||||
#include "fwbuilder/Policy.h"
|
||||
@@ -139,7 +142,7 @@
|
||||
#include <QMdiArea>
|
||||
#include <QMdiSubWindow>
|
||||
#include <QSignalMapper>
|
||||
#include "ProjectPanel.h"
|
||||
#include <QUrl>
|
||||
|
||||
|
||||
using namespace libfwbuilder;
|
||||
@@ -173,7 +176,13 @@ FWWindow::FWWindow() : QMainWindow(), // QMainWindow(NULL, Qt::Desktop),
|
||||
|
||||
printer = new QPrinter(QPrinter::HighResolution);
|
||||
|
||||
connect(instDialogOnScreenTimer, SIGNAL(timeout()), this, SLOT(killInstDialog()));
|
||||
curent_version_http_getter = new HttpGet();
|
||||
connect(curent_version_http_getter, SIGNAL(done(const QString&)),
|
||||
this, SLOT(checkForUpgrade(const QString&)));
|
||||
|
||||
connect(instDialogOnScreenTimer, SIGNAL(timeout()),
|
||||
this, SLOT(killInstDialog()));
|
||||
|
||||
instDialogOnScreenTimer->start(1000);
|
||||
|
||||
|
||||
@@ -188,7 +197,8 @@ FWWindow::FWWindow() : QMainWindow(), // QMainWindow(NULL, Qt::Desktop),
|
||||
|
||||
connect( m_mainWindow->ObjectMenu, SIGNAL (aboutToShow() ),
|
||||
this, SLOT( prepareObjectMenu() ));
|
||||
connect( m_space, SIGNAL(subWindowActivated (QMdiSubWindow *)),this, SLOT(changeActiveSubwindow()));
|
||||
connect( m_space, SIGNAL(subWindowActivated (QMdiSubWindow *)),
|
||||
this, SLOT(changeActiveSubwindow()));
|
||||
if (fwbdebug)
|
||||
qDebug("/FWWindow constructor");
|
||||
|
||||
@@ -262,6 +272,13 @@ void FWWindow::updateWindowTitle ()
|
||||
|
||||
void FWWindow::startupLoad()
|
||||
{
|
||||
if (st->getCheckUpdates())
|
||||
{
|
||||
// start http query to get latest version from the web site
|
||||
curent_version_http_getter->get(QUrl(CHECK_UPDATE_URL));
|
||||
}
|
||||
|
||||
|
||||
if (activeProject())
|
||||
{
|
||||
activeProject()->startupLoad();
|
||||
@@ -1576,3 +1593,25 @@ void FWWindow::updateTreeFont ()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FWWindow::checkForUpgrade(const QString& server_response)
|
||||
{
|
||||
if (curent_version_http_getter->getStatus())
|
||||
{
|
||||
if (!server_response.trimmed().isEmpty())
|
||||
{
|
||||
QMessageBox::warning(
|
||||
this,"Firewall Builder",
|
||||
tr("A new version of Firewall Builder is available at"
|
||||
" http://www.fwbuilder.org"));
|
||||
}
|
||||
} else
|
||||
{
|
||||
if (fwbdebug)
|
||||
qDebug("Update check error: %s",
|
||||
curent_version_http_getter->getLastError().
|
||||
toLatin1().constData());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
+73
-67
@@ -30,6 +30,7 @@
|
||||
#include <ui_FWBMainWindow_q.h>
|
||||
#include "RCS.h"
|
||||
#include "ObjectEditor.h"
|
||||
#include "HttpGet.h"
|
||||
|
||||
#include <qstring.h>
|
||||
#include <QShowEvent>
|
||||
@@ -65,20 +66,22 @@ class FWWindow : public QMainWindow {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
QMdiArea *m_space;
|
||||
QWidget *instd;
|
||||
QMdiArea *m_space;
|
||||
QWidget *instd;
|
||||
HttpGet *curent_version_http_getter;
|
||||
|
||||
QTimer *autosaveTimer;
|
||||
QTimer *instDialogOnScreenTimer;
|
||||
QString noFirewalls;
|
||||
QPrinter *printer;
|
||||
libfwbuilder::FWObject *searchObject;
|
||||
libfwbuilder::FWObject *replaceObject;
|
||||
QTimer *autosaveTimer;
|
||||
QTimer *instDialogOnScreenTimer;
|
||||
QString noFirewalls;
|
||||
QPrinter *printer;
|
||||
libfwbuilder::FWObject *searchObject;
|
||||
libfwbuilder::FWObject *replaceObject;
|
||||
//int lastFirewallIdx;
|
||||
|
||||
void clearFirewallTabs();
|
||||
ProjectPanel *newProjectPanel();
|
||||
void showSub(ProjectPanel *projectW);
|
||||
|
||||
public:
|
||||
ProjectPanel* activeProject();
|
||||
void recreateWindowsMenu ();
|
||||
@@ -86,83 +89,86 @@ public:
|
||||
QVector <QString> windowsTitles;
|
||||
QVector <QMdiSubWindow*> windowsPainters;
|
||||
void updateTreeFont ();
|
||||
|
||||
public slots:
|
||||
void selectActiveSubWindow (/*const QString & text*/);
|
||||
|
||||
void minimize ();
|
||||
void maximize ();
|
||||
void changeActiveSubwindow ( );
|
||||
virtual void search();
|
||||
virtual void search();
|
||||
|
||||
virtual void reopenFirewall();
|
||||
virtual void redrawRuleSets();
|
||||
virtual void changeInfoStyle();
|
||||
virtual void restoreRuleSetTab();
|
||||
virtual void reopenFirewall();
|
||||
virtual void redrawRuleSets();
|
||||
virtual void changeInfoStyle();
|
||||
virtual void restoreRuleSetTab();
|
||||
|
||||
virtual void editFind();
|
||||
virtual void editRedo();
|
||||
virtual void editUndo();
|
||||
virtual void helpContents();
|
||||
virtual void helpContentsAction();
|
||||
virtual void helpIndex();
|
||||
virtual void editFind();
|
||||
virtual void editRedo();
|
||||
virtual void editUndo();
|
||||
virtual void helpContents();
|
||||
virtual void helpContentsAction();
|
||||
virtual void helpIndex();
|
||||
|
||||
virtual void fileNew();
|
||||
virtual void fileOpen();
|
||||
virtual void fileClose();
|
||||
virtual void fileSave();
|
||||
virtual void fileSaveAs();
|
||||
virtual void fileDiscard();
|
||||
virtual void fileCommit();
|
||||
virtual void fileImport();
|
||||
virtual void fileExport();
|
||||
virtual void filePrint();
|
||||
virtual void fileExit();
|
||||
virtual void fileProp();
|
||||
virtual void fileAddToRCS();
|
||||
virtual void fileCompare();
|
||||
virtual void editCopy();
|
||||
virtual void editCut();
|
||||
virtual void editDelete();
|
||||
virtual void editPaste();
|
||||
virtual void editPrefs();
|
||||
virtual void importPolicy();
|
||||
virtual void fileNew();
|
||||
virtual void fileOpen();
|
||||
virtual void fileClose();
|
||||
virtual void fileSave();
|
||||
virtual void fileSaveAs();
|
||||
virtual void fileDiscard();
|
||||
virtual void fileCommit();
|
||||
virtual void fileImport();
|
||||
virtual void fileExport();
|
||||
virtual void filePrint();
|
||||
virtual void fileExit();
|
||||
virtual void fileProp();
|
||||
virtual void fileAddToRCS();
|
||||
virtual void fileCompare();
|
||||
virtual void editCopy();
|
||||
virtual void editCut();
|
||||
virtual void editDelete();
|
||||
virtual void editPaste();
|
||||
virtual void editPrefs();
|
||||
virtual void importPolicy();
|
||||
|
||||
virtual void startupLoad();
|
||||
virtual void startupLoad();
|
||||
|
||||
virtual void helpAbout();
|
||||
virtual void debug();
|
||||
virtual void helpAbout();
|
||||
virtual void debug();
|
||||
|
||||
virtual void compile(std::set<libfwbuilder::Firewall * > vf);
|
||||
virtual void compile();
|
||||
virtual void install(std::set<libfwbuilder::Firewall * > vf);
|
||||
virtual void install();
|
||||
virtual void compile(std::set<libfwbuilder::Firewall * > vf);
|
||||
virtual void compile();
|
||||
virtual void install(std::set<libfwbuilder::Firewall * > vf);
|
||||
virtual void install();
|
||||
|
||||
virtual void insertRule();
|
||||
virtual void addRuleAfterCurrent();
|
||||
virtual void moveRule();
|
||||
virtual void moveRuleUp();
|
||||
virtual void moveRuleDown();
|
||||
virtual void removeRule();
|
||||
virtual void insertRule();
|
||||
virtual void addRuleAfterCurrent();
|
||||
virtual void moveRule();
|
||||
virtual void moveRuleUp();
|
||||
virtual void moveRuleDown();
|
||||
virtual void removeRule();
|
||||
|
||||
virtual void copyRule();
|
||||
virtual void cutRule();
|
||||
virtual void pasteRuleAbove();
|
||||
virtual void pasteRuleBelow();
|
||||
virtual void copyRule();
|
||||
virtual void cutRule();
|
||||
virtual void pasteRuleAbove();
|
||||
virtual void pasteRuleBelow();
|
||||
|
||||
virtual void back();
|
||||
virtual void newObject();
|
||||
virtual void lockObject();
|
||||
virtual void unlockObject();
|
||||
virtual void prepareObjectMenu();
|
||||
virtual void toolsDiscoveryDruid();
|
||||
virtual void closeAuxiliaryPanel();
|
||||
virtual void closeEditorPanel();
|
||||
virtual void openEditorPanel();
|
||||
virtual void back();
|
||||
virtual void newObject();
|
||||
virtual void lockObject();
|
||||
virtual void unlockObject();
|
||||
virtual void prepareObjectMenu();
|
||||
virtual void toolsDiscoveryDruid();
|
||||
virtual void closeAuxiliaryPanel();
|
||||
virtual void closeEditorPanel();
|
||||
virtual void openEditorPanel();
|
||||
|
||||
virtual void killInstDialog();
|
||||
virtual void killInstDialog();
|
||||
|
||||
virtual void checkForUpgrade(const QString&);
|
||||
|
||||
public:
|
||||
Ui::FWBMainWindow_q *m_mainWindow;
|
||||
Ui::FWBMainWindow_q *m_mainWindow;
|
||||
|
||||
FWWindow();
|
||||
~FWWindow();
|
||||
|
||||
@@ -40,6 +40,8 @@ using namespace std;
|
||||
Help::Help(QWidget *parent, const QString &help_file, const QString &title) :
|
||||
SimpleTextView(parent)
|
||||
{
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
setModal(false);
|
||||
setName(title);
|
||||
resize(500, 600);
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
|
||||
Firewall Builder
|
||||
|
||||
Copyright (C) 2008 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 "../../config.h"
|
||||
#include "global.h"
|
||||
|
||||
#include <QtCore>
|
||||
#include <QtNetwork>
|
||||
#include <QHttpResponseHeader>
|
||||
|
||||
#include "HttpGet.h"
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
HttpGet::HttpGet(QObject *parent) : QObject(parent), strm(&contents)
|
||||
{
|
||||
last_error = "";
|
||||
status = true;
|
||||
connect(&http, SIGNAL(requestFinished(int, bool)),
|
||||
this, SLOT(httpDone(int, bool)));
|
||||
}
|
||||
|
||||
bool HttpGet::get(const QUrl &url)
|
||||
{
|
||||
QTextStream err(&last_error, QIODevice::WriteOnly);
|
||||
|
||||
if (strm.isOpen())
|
||||
{
|
||||
contents.clear();
|
||||
strm.reset();
|
||||
}
|
||||
|
||||
if (!url.isValid())
|
||||
{
|
||||
err << "Error: Invalid URL";
|
||||
status = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (url.scheme() != "http")
|
||||
{
|
||||
err << "Error: URL must start with 'http:'";
|
||||
status = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (url.path().isEmpty())
|
||||
{
|
||||
err << "Error: URL has no path";
|
||||
status = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
http.setHost(url.host(), url.port(80));
|
||||
request_id = http.get(url.toString(), &strm);
|
||||
return true;
|
||||
}
|
||||
|
||||
void HttpGet::httpDone(int id, bool error)
|
||||
{
|
||||
if (request_id == id)
|
||||
{
|
||||
QHttpResponseHeader resp = http.lastResponse();
|
||||
QTextStream err(&last_error, QIODevice::WriteOnly);
|
||||
if (error)
|
||||
{
|
||||
err << "Error: " << qPrintable(http.errorString());
|
||||
status = false;
|
||||
}
|
||||
if (resp.isValid() && resp.statusCode()!=200)
|
||||
{
|
||||
err << "Error: " << resp.reasonPhrase();
|
||||
status = false;
|
||||
}
|
||||
emit done(toString());
|
||||
}
|
||||
}
|
||||
|
||||
void HttpGet::abort()
|
||||
{
|
||||
http.abort();
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
|
||||
Firewall Builder
|
||||
|
||||
Copyright (C) 2008 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 HTTPGET_H
|
||||
#define HTTPGET_H
|
||||
|
||||
#include <QBuffer>
|
||||
#include <QHttp>
|
||||
#include <QString>
|
||||
#include <QByteArray>
|
||||
|
||||
class QUrl;
|
||||
|
||||
class HttpGet : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
QHttp http;
|
||||
QBuffer strm;
|
||||
bool status;
|
||||
QString last_error;
|
||||
QByteArray contents;
|
||||
int request_id;
|
||||
|
||||
public:
|
||||
HttpGet(QObject *parent = 0);
|
||||
|
||||
bool get(const QUrl &url);
|
||||
QString getLastError() { return last_error; }
|
||||
bool getStatus() { return status; }
|
||||
QString toString() { return QString(contents); }
|
||||
void abort();
|
||||
|
||||
signals:
|
||||
void done(const QString &res);
|
||||
|
||||
private slots:
|
||||
void httpDone(int id, bool error);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -27,11 +27,13 @@
|
||||
#include "../../config.h"
|
||||
#include "global.h"
|
||||
#include "utils.h"
|
||||
#include "check_update_url.h"
|
||||
|
||||
#include "PrefsDialog.h"
|
||||
#include "FWBSettings.h"
|
||||
#include "listOfLibraries.h"
|
||||
#include "FWWindow.h"
|
||||
#include "HttpGet.h"
|
||||
|
||||
#include <qlineedit.h>
|
||||
#include <qfiledialog.h>
|
||||
@@ -49,6 +51,8 @@
|
||||
#include <qcolor.h>
|
||||
#include <qpixmapcache.h>
|
||||
#include <qfontdialog.h>
|
||||
#include <QUrl>
|
||||
|
||||
/*
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -80,6 +84,9 @@ void PrefsDialog::setButtonColor(QPushButton *btn,const QString &colorCode)
|
||||
|
||||
PrefsDialog::~PrefsDialog()
|
||||
{
|
||||
disconnect(&curent_version_http_getter, SIGNAL(done(const QString&)),
|
||||
this, SLOT(checkForUpgrade(const QString&)));
|
||||
|
||||
delete m_dialog;
|
||||
}
|
||||
|
||||
@@ -191,6 +198,9 @@ PrefsDialog::PrefsDialog(QWidget *parent) : QDialog(parent)
|
||||
m_dialog->treeFontDescr->setText(getFontDescription(treeFont));
|
||||
|
||||
m_dialog->chClipComment->setChecked(st->getClipComment() );
|
||||
|
||||
m_dialog->checkUpdates->setChecked(st->getCheckUpdates() );
|
||||
|
||||
}
|
||||
|
||||
QString PrefsDialog::getFontDescription(const QFont &font)
|
||||
@@ -453,6 +463,7 @@ void PrefsDialog::accept()
|
||||
st->setUiFont(uiFont);
|
||||
|
||||
st->setClipComment(m_dialog->chClipComment->isChecked());
|
||||
st->setCheckUpdates(m_dialog->checkUpdates->isChecked());
|
||||
|
||||
st->setSSHPath( m_dialog->sshPath->text() );
|
||||
|
||||
@@ -467,3 +478,41 @@ void PrefsDialog::accept()
|
||||
mw->updateTreeFont();
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
void PrefsDialog::checkSwUpdates()
|
||||
{
|
||||
connect(&curent_version_http_getter, SIGNAL(done(const QString&)),
|
||||
this, SLOT(checkForUpgrade(const QString&)));
|
||||
curent_version_http_getter.get(QUrl(CHECK_UPDATE_URL));
|
||||
}
|
||||
|
||||
void PrefsDialog::checkForUpgrade(const QString& server_response)
|
||||
{
|
||||
disconnect(&curent_version_http_getter, SIGNAL(done(const QString&)),
|
||||
this, SLOT(checkForUpgrade(const QString&)));
|
||||
|
||||
if (curent_version_http_getter.getStatus())
|
||||
{
|
||||
|
||||
if (server_response.trimmed().isEmpty())
|
||||
{
|
||||
QMessageBox::information(
|
||||
this,"Firewall Builder",
|
||||
tr("Your version of Firewall Builder is up to date."));
|
||||
} else
|
||||
{
|
||||
QMessageBox::warning(
|
||||
this,"Firewall Builder",
|
||||
tr("A new version of Firewall Builder is available at"
|
||||
" http://www.fwbuilder.org"));
|
||||
}
|
||||
} else
|
||||
{
|
||||
QMessageBox::critical(
|
||||
this,"Firewall Builder",
|
||||
tr("Error checking for software updates:\n%1").
|
||||
arg(curent_version_http_getter.getLastError()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
#include "FWBSettings.h"
|
||||
#include "listOfLibraries.h"
|
||||
#include "HttpGet.h"
|
||||
|
||||
#include <list>
|
||||
#include <string>
|
||||
@@ -53,6 +54,8 @@ class PrefsDialog : public QDialog
|
||||
std::map<int,QString> colors;
|
||||
Ui::prefsDialog_q *m_dialog;
|
||||
|
||||
HttpGet curent_version_http_getter;
|
||||
|
||||
QFont rulesFont;
|
||||
QFont treeFont;
|
||||
QFont uiFont;
|
||||
@@ -83,6 +86,8 @@ public slots:
|
||||
virtual void changeShowIcons();
|
||||
virtual void changeRulesFont();
|
||||
virtual void changeTreeFont();
|
||||
virtual void checkSwUpdates();
|
||||
virtual void checkForUpgrade(const QString&);
|
||||
};
|
||||
|
||||
#endif // __PREFSDIALOG_H
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
|
||||
Firewall Builder
|
||||
|
||||
Copyright (C) 2008 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 CHECK_UPDATE_URL_HH
|
||||
#define CHECK_UPDATE_URL_HH
|
||||
|
||||
#include "../../VERSION.h"
|
||||
|
||||
#define CHECK_UPDATE_URL "http://www.fwbuilder.org/update_checks/check.cgi?v="VERSION
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+1
-1
@@ -26,6 +26,7 @@
|
||||
#ifndef __GLOBAL_DEFS_
|
||||
#define __GLOBAL_DEFS_
|
||||
|
||||
#include "../../VERSION.h"
|
||||
#include <string>
|
||||
|
||||
class QApplication;
|
||||
@@ -59,7 +60,6 @@ extern bool gui_experiment1;
|
||||
//#define TEMPLATE_LIB "syslib100"
|
||||
//#define DELETED_LIB "sysid99"
|
||||
|
||||
|
||||
#ifdef NDEBUG
|
||||
# undef NDEBUG
|
||||
# include <assert.h>
|
||||
|
||||
+5
-2
@@ -130,7 +130,9 @@ HEADERS += ../../config.h \
|
||||
FWBAboutDialog.h \
|
||||
RuleGroupPanel.h \
|
||||
RuleRowInfo.h \
|
||||
Help.h
|
||||
Help.h \
|
||||
HttpGet.h \
|
||||
check_update_url.h
|
||||
|
||||
SOURCES += ProjectPanel.cpp \
|
||||
ProjectPanel_file_ops.cpp \
|
||||
@@ -240,7 +242,8 @@ SOURCES += ProjectPanel.cpp \
|
||||
AskLibForCopyDialog.cpp \
|
||||
ObjectListViewItem.cpp \
|
||||
RuleGroupPanel.cpp \
|
||||
Help.cpp
|
||||
Help.cpp \
|
||||
HttpGet.cpp
|
||||
|
||||
FORMS = FWBMainWindow_q.ui \
|
||||
customservicedialog_q.ui \
|
||||
|
||||
@@ -706,6 +706,9 @@ int main( int argc, char *argv[] )
|
||||
|
||||
app->connect(app, SIGNAL( lastWindowClosed() ), app, SLOT( quit()));
|
||||
|
||||
|
||||
if (fwbdebug) qDebug("Checking for new version ...");
|
||||
|
||||
// setup single shot timer to call loadEverything()
|
||||
|
||||
QTimer::singleShot( 0, mw, SLOT(startupLoad()) );
|
||||
|
||||
+139
-117
@@ -8,8 +8,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>588</width>
|
||||
<height>358</height>
|
||||
<width>620</width>
|
||||
<height>368</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
@@ -19,92 +19,10 @@
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="leftMargin" >
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="topMargin" >
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="horizontalSpacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="verticalSpacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="1" column="0" >
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonOk" >
|
||||
<property name="text" >
|
||||
<string>&OK</string>
|
||||
</property>
|
||||
<property name="shortcut" >
|
||||
<string/>
|
||||
</property>
|
||||
<property name="autoDefault" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="default" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonCancel" >
|
||||
<property name="text" >
|
||||
<string>&Cancel</string>
|
||||
</property>
|
||||
<property name="shortcut" >
|
||||
<string/>
|
||||
</property>
|
||||
<property name="autoDefault" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QTabWidget" name="tabWidget" >
|
||||
<property name="currentIndex" >
|
||||
<number>6</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="Widget2" >
|
||||
<attribute name="title" >
|
||||
@@ -137,7 +55,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="5" colspan="2" >
|
||||
<item row="0" column="5" colspan="3" >
|
||||
<widget class="QPushButton" name="browseWDir" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
|
||||
@@ -156,7 +74,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="7" >
|
||||
<item row="0" column="8" >
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
@@ -172,23 +90,7 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="4" >
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item rowspan="2" row="2" column="0" >
|
||||
<item rowspan="2" row="1" column="0" >
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
@@ -204,14 +106,14 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="5" >
|
||||
<item row="1" column="1" colspan="6" >
|
||||
<widget class="QCheckBox" name="autosave" >
|
||||
<property name="text" >
|
||||
<string>Automatically save data in dialogs when switching between objects</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="6" colspan="2" >
|
||||
<item row="1" column="7" colspan="2" >
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
@@ -227,14 +129,14 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="3" >
|
||||
<item row="2" column="1" colspan="3" >
|
||||
<widget class="QCheckBox" name="autosaveFile" >
|
||||
<property name="text" >
|
||||
<string>Periodically save data to file every </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="4" >
|
||||
<item row="2" column="4" >
|
||||
<widget class="QSpinBox" name="autosaveInterval" >
|
||||
<property name="minimum" >
|
||||
<number>1</number>
|
||||
@@ -244,7 +146,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="5" >
|
||||
<item row="2" column="5" colspan="2" >
|
||||
<widget class="QLabel" name="textLabel1_3" >
|
||||
<property name="text" >
|
||||
<string>minutes</string>
|
||||
@@ -254,14 +156,14 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1" colspan="2" >
|
||||
<item row="3" column="1" colspan="2" >
|
||||
<widget class="QCheckBox" name="objTooltips" >
|
||||
<property name="text" >
|
||||
<string>Enable object tooltips</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="3" >
|
||||
<item row="3" column="3" >
|
||||
<widget class="QLabel" name="textLabel1_6" >
|
||||
<property name="text" >
|
||||
<string>Tooltip delay:</string>
|
||||
@@ -271,14 +173,14 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="4" >
|
||||
<item row="3" column="4" >
|
||||
<widget class="QSpinBox" name="tooltipDelay" >
|
||||
<property name="minimum" >
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="5" colspan="3" >
|
||||
<item row="3" column="5" colspan="4" >
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
@@ -294,21 +196,61 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="5" column="1" colspan="5" >
|
||||
<item row="4" column="1" colspan="6" >
|
||||
<widget class="QCheckBox" name="deletedObj" >
|
||||
<property name="text" >
|
||||
<string>Show deleted objects</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1" colspan="5" >
|
||||
<item row="5" column="1" colspan="6" >
|
||||
<widget class="QCheckBox" name="chClipComment" >
|
||||
<property name="text" >
|
||||
<string>Clip comments in rules</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="4" >
|
||||
<item row="6" column="1" colspan="6" >
|
||||
<widget class="QLabel" name="label" >
|
||||
<property name="font" >
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Software Updates:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1" colspan="3" >
|
||||
<widget class="QCheckBox" name="checkUpdates" >
|
||||
<property name="text" >
|
||||
<string>Check for updates automatically</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="4" colspan="2" >
|
||||
<widget class="QPushButton" name="checkUpdatesNow" >
|
||||
<property name="text" >
|
||||
<string>Check Now</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="6" colspan="3" >
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>91</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="8" column="4" >
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Vertical</enum>
|
||||
@@ -318,7 +260,7 @@
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>20</width>
|
||||
<width>86</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
@@ -882,6 +824,70 @@
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonOk" >
|
||||
<property name="text" >
|
||||
<string>&OK</string>
|
||||
</property>
|
||||
<property name="shortcut" >
|
||||
<string/>
|
||||
</property>
|
||||
<property name="autoDefault" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="default" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonCancel" >
|
||||
<property name="text" >
|
||||
<string>&Cancel</string>
|
||||
</property>
|
||||
<property name="shortcut" >
|
||||
<string/>
|
||||
</property>
|
||||
<property name="autoDefault" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11" />
|
||||
@@ -1224,5 +1230,21 @@
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>checkUpdatesNow</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>prefsDialog_q</receiver>
|
||||
<slot>checkSwUpdates()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel" >
|
||||
<x>412</x>
|
||||
<y>263</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel" >
|
||||
<x>309</x>
|
||||
<y>183</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
|
||||
Reference in New Issue
Block a user