1
0
mirror of https://github.com/fwbuilder/fwbuilder synced 2026-03-25 12:47:44 +01:00

some cleanup in object dialogs: moving common methods to the BaseObjectDialog class

This commit is contained in:
Vadim Kurland 2009-10-05 07:34:25 +00:00
parent ea506af6cb
commit d0a79d38e0
68 changed files with 98 additions and 1170 deletions

View File

@ -1 +1 @@
#define BUILD_NUM 1551
#define BUILD_NUM 1552

View File

@ -111,12 +111,6 @@ void ActionsDialog::getHelpName(QString *str)
*str = help_name;
}
void ActionsDialog::changed()
{
//apply->setEnabled( true );
emit changed_sign();
}
void ActionsDialog::validate(bool *res)
{
FWOptions *ruleopt =rule->getOptionsObject();
@ -147,10 +141,6 @@ void ActionsDialog::validate(bool *res)
}
}
void ActionsDialog::isChanged(bool*)
{
//*res=apply->isEnabled();
}
void ActionsDialog::applyChanges()
@ -211,9 +201,7 @@ void ActionsDialog::applyChanges()
else
ropt->setInt("ipfw_classify_method",DUMMYNETQUEUE);
emit notify_changes_applied_sign();
// mw->updateLastModifiedTimestampForAllFirewalls(rule);
BaseObjectDialog::applyChanges();
}
void ActionsDialog::discardChanges()
@ -444,11 +432,4 @@ void ActionsDialog::fillInterfaces(QComboBox* cb)
}
void ActionsDialog::closeEvent(QCloseEvent *e)
{
if (fwbdebug)
qDebug("ActionsDialog::closeEvent got close event: %p",e);
emit close_sign(e);
//hide();
}

View File

@ -70,33 +70,21 @@ class ActionsDialog : public BaseObjectDialog
Ui::ActionsDialog_q *m_dialog;
ActionsDialog(QWidget *parent);
~ActionsDialog();
virtual void closeEvent(QCloseEvent *e);
void fillInterfaces(QComboBox *);
public slots:
virtual void changed();
virtual void applyChanges();
virtual void discardChanges();
virtual void tagvalueChanged(int);
virtual void iptRouteContinueToggled();
virtual void loadFWObject(libfwbuilder::FWObject *obj);
virtual void validate(bool*);
virtual void isChanged(bool*);
virtual void getHelpName(QString*);
void setRule(libfwbuilder::PolicyRule*);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};

View File

@ -97,12 +97,6 @@ void AddressRangeDialog::loadFWObject(FWObject *o)
init=false;
}
void AddressRangeDialog::changed()
{
//apply->setEnabled( true );
emit changed_sign();
}
void AddressRangeDialog::validate(bool *res)
{
*res=true;
@ -136,15 +130,7 @@ void AddressRangeDialog::validate(bool *res)
}
}
void AddressRangeDialog::isChanged(bool *)
{
//*res=(!init && apply->isEnabled());
}
void AddressRangeDialog::libChanged()
{
changed();
}
void AddressRangeDialog::applyChanges()
@ -165,7 +151,7 @@ void AddressRangeDialog::applyChanges()
}
m_project->updateObjName(obj,QString::fromUtf8(oldname.c_str()));
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
void AddressRangeDialog::discardChanges()
@ -175,13 +161,3 @@ void AddressRangeDialog::discardChanges()
/* ObjectEditor class connects its slot to this signal and does all
* the verification for us, then accepts (or not) the event. So we do
* nothing here and defer all the processing to ObjectEditor
*/
void AddressRangeDialog::closeEvent(QCloseEvent *e)
{
emit close_sign(e);
}

View File

@ -48,26 +48,12 @@ class AddressRangeDialog : public BaseObjectDialog
~AddressRangeDialog();
public slots:
virtual void changed();
virtual void libChanged();
virtual void applyChanges();
virtual void discardChanges();
virtual void loadFWObject(libfwbuilder::FWObject *obj);
virtual void validate(bool*);
virtual void isChanged(bool*);
virtual void closeEvent(QCloseEvent *e);
virtual void getHelpName(QString*);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};
#endif // ADDRESSRANGEDIALOG_H

View File

@ -110,14 +110,6 @@ void AddressTableDialog::loadFWObject(FWObject *o)
init=false;
}
void AddressTableDialog::changed()
{
//BrowseButton->setEnabled(r_compiletime->isChecked() );
//apply->setEnabled( true );
emit changed_sign();
}
void AddressTableDialog::validate(bool *res)
{
*res=true;
@ -128,15 +120,7 @@ void AddressTableDialog::validate(bool *res)
if (!validateName(this,obj,m_dialog->obj_name->text())) { *res=false; return; }
}
void AddressTableDialog::isChanged(bool *)
{
//*res=(!init && apply->isEnabled());
}
void AddressTableDialog::libChanged()
{
changed();
}
void AddressTableDialog::applyChanges()
{
@ -152,7 +136,7 @@ void AddressTableDialog::applyChanges()
m_project->updateObjName(obj,QString::fromUtf8(oldname.c_str()));
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
void AddressTableDialog::discardChanges()
@ -160,14 +144,6 @@ void AddressTableDialog::discardChanges()
loadFWObject(obj);
}
void AddressTableDialog::closeEvent(QCloseEvent *e)
{
if (fwbdebug)
qDebug("AddressTableDialog::closeEvent got close event: %p",e);
emit close_sign(e);
}
void AddressTableDialog::browse()
{

View File

@ -45,30 +45,16 @@ class AddressTableDialog : public BaseObjectDialog
public:
AddressTableDialog(QWidget *parent);
~AddressTableDialog();
virtual void closeEvent(QCloseEvent *e);
public slots:
virtual void changed();
virtual void libChanged();
virtual void applyChanges();
virtual void discardChanges();
virtual void loadFWObject(libfwbuilder::FWObject *obj);
virtual void validate(bool*);
virtual void isChanged(bool*);
virtual void browse();
virtual void preview( void );
virtual void getHelpName(QString*);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};
#endif

View File

@ -2,7 +2,7 @@
Firewall Builder
Copyright (C) 2003 NetCitadel, LLC
Copyright (C) 2009 NetCitadel, LLC
Author: Vadim Kurland vadim@fwbuilder.org
@ -28,12 +28,12 @@
#define __BASEOBJECTDIALOG_H_
#include <QWidget>
#include <QCloseEvent>
#include "fwbuilder/FWObject.h"
class ProjectPanel;
class BaseObjectDialog : public QWidget
{
Q_OBJECT;
@ -41,14 +41,54 @@ class BaseObjectDialog : public QWidget
protected:
libfwbuilder::FWObject *obj;
bool init;
bool data_changed;
ProjectPanel *m_project;
virtual void closeEvent(QCloseEvent *e)
{
emit close_sign(e);
}
public:
BaseObjectDialog(QWidget *parent) : QWidget(parent) {obj = 0; init = false; m_project = NULL;}
BaseObjectDialog(QWidget *parent) : QWidget(parent)
{
obj = 0;
init = false;
data_changed = false;
m_project = NULL;
}
virtual ~BaseObjectDialog() {};
void attachToProjectWindow(ProjectPanel *pp) { m_project = pp; }
bool isDataChanged() { return data_changed; }
public slots:
virtual void changed()
{
if (!init)
{
data_changed = true;
emit changed_sign();
}
}
virtual void applyChanges()
{
data_changed = false;
emit notify_changes_applied_sign();
}
signals:
void changed_sign();
void notify_changes_applied_sign();
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be
* closed and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
};
#endif

View File

@ -160,11 +160,6 @@ void ClusterDialog::resetSingleClusterGroupType(FWObject *grp,
if (!match) grp->setStr("type", first_allowed_type);
}
void ClusterDialog::changed()
{
emit changed_sign();
}
void ClusterDialog::validate(bool *res)
{
*res = true;
@ -180,10 +175,6 @@ void ClusterDialog::validate(bool *res)
}
}
void ClusterDialog::libChanged()
{
changed();
}
void ClusterDialog::applyChanges()
{
@ -211,7 +202,7 @@ void ClusterDialog::applyChanges()
m_project->scheduleRuleSetRedraw();
}
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
@ -219,14 +210,3 @@ void ClusterDialog::discardChanges()
{
loadFWObject(obj);
}
/**
* ObjectEditor class connects its slot to this signal and does all
* the verification for us, then accepts (or not) the event. So we do
* nothing here and defer all the processing to ObjectEditor
*/
void ClusterDialog::closeEvent(QCloseEvent *e)
{
emit close_sign(e);
}

View File

@ -48,26 +48,13 @@ private:
bool config_changed;
public slots:
virtual void changed();
virtual void libChanged();
virtual void applyChanges();
virtual void discardChanges();
virtual void platformChanged();
virtual void hostOSChanged();
virtual void loadFWObject(libfwbuilder::FWObject *obj);
virtual void validate(bool*);
virtual void closeEvent(QCloseEvent *e);
virtual void getHelpName(QString*);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};
#endif /* __CLUSTERDIALOG_H_ */

View File

@ -67,6 +67,8 @@ void ClusterGroupDialog::loadFWObject(FWObject *o)
ClusterGroup *g = dynamic_cast<ClusterGroup*>(obj);
assert(g != NULL);
init = true;
// disable manage members if host OS does not support clustering.
// Parent is either 'Cluster' or 'Interface', call getParent() approprietly
FWObject *parent = obj;
@ -166,6 +168,7 @@ void ClusterGroupDialog::loadFWObject(FWObject *o)
m_dialog->fwMemberTree->resizeColumnToContents(2);
m_dialog->fwMemberTree->resizeColumnToContents(3);
init = false;
}
void ClusterGroupDialog::saveGroupType()
@ -245,10 +248,7 @@ void ClusterGroupDialog::addIcon(FWObject *o, bool master)
void ClusterGroupDialog::changed()
{
if (!reload)
{
emit changed_sign();
}
if (!reload) BaseObjectDialog::changed();
}
void ClusterGroupDialog::validate(bool *res)
@ -277,7 +277,7 @@ void ClusterGroupDialog::applyChanges()
m_project->updateObjName(obj, oldname);
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
void ClusterGroupDialog::discardChanges()
@ -293,7 +293,7 @@ void ClusterGroupDialog::openClusterConfDialog()
{
try
{
applyChanges();
if (isDataChanged()) applyChanges();
QWidget *w = DialogFactory::createClusterConfDialog(this, obj);
if (w == NULL)
@ -320,16 +320,6 @@ void ClusterGroupDialog::openClusterConfDialog()
}
}
/**
* ObjectEditor class connects its slot to this signal and does all
* the verification for us, then accepts (or not) the event. So we do
* nothing here and defer all the processing to ObjectEditor
*/
void ClusterGroupDialog::closeEvent(QCloseEvent *e)
{
emit close_sign(e);
}
void ClusterGroupDialog::openObject(QTreeWidgetItem *item)
{
ObjectListViewItem *otvi = dynamic_cast<ObjectListViewItem*>(item);
@ -358,7 +348,7 @@ void ClusterGroupDialog::objectChanged()
*/
void ClusterGroupDialog::openParametersEditor()
{
applyChanges();
if (isDataChanged()) applyChanges();
FWOptions *gr_opt = ClusterGroup::cast(obj)->getOptionsObject();

View File

@ -62,22 +62,12 @@ public slots:
virtual void validate(bool*);
virtual void loadFWObject(libfwbuilder::FWObject *obj);
virtual void openClusterConfDialog();
virtual void closeEvent(QCloseEvent *e);
virtual void getHelpName(QString*);
void openObject(QTreeWidgetItem *item);
void objectChanged();
void openParametersEditor();
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};
#endif /* __CLUSTERDIALOG_H_ */

View File

@ -120,7 +120,7 @@ void CommentEditorPanel::applyChanges()
string(m_widget->editor->toPlainText().toUtf8().constData())
);
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
void CommentEditorPanel::getHelpName(QString *str)

View File

@ -71,8 +71,6 @@ public slots:
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};
#endif

View File

@ -68,7 +68,7 @@ void CompilerOutputPanel::changed()
void CompilerOutputPanel::applyChanges()
{
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
void CompilerOutputPanel::discardChanges()

View File

@ -67,15 +67,6 @@ public slots:
virtual void getHelpName(QString*);
virtual void closeEvent(QCloseEvent *e);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};

View File

@ -163,13 +163,10 @@ void CustomServiceDialog::changed()
{
if (!init)
{
QString pl = platformReverseMap[m_dialog->platform->currentText()];
QString pl = platformReverseMap[m_dialog->platform->currentText()];
allCodes[pl] = m_dialog->code->text().toUtf8().constData();
//apply->setEnabled( true );
emit changed_sign();
}
BaseObjectDialog::changed();
}
void CustomServiceDialog::validate(bool *res)
@ -183,15 +180,7 @@ void CustomServiceDialog::validate(bool *res)
}
}
void CustomServiceDialog::isChanged(bool*)
{
//*res=(!init && apply->isEnabled());
}
void CustomServiceDialog::libChanged()
{
changed();
}
void CustomServiceDialog::platformChanged()
{
@ -232,7 +221,7 @@ void CustomServiceDialog::applyChanges()
m_project->updateObjName(obj,QString::fromUtf8(oldname.c_str()));
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
void CustomServiceDialog::discardChanges()
@ -240,16 +229,6 @@ void CustomServiceDialog::discardChanges()
loadFWObject(obj);
}
/* ObjectEditor class connects its slot to this signal and does all
* the verification for us, then accepts (or not) the event. So we do
* nothing here and defer all the processing to ObjectEditor
*/
void CustomServiceDialog::closeEvent(QCloseEvent *e)
{
emit close_sign(e);
}
void CustomServiceDialog::fillDialogInputFields()
{
QString npl = platformReverseMap[m_dialog->platform->currentText()];

View File

@ -59,26 +59,13 @@ public:
public slots:
virtual void changed();
virtual void libChanged();
virtual void platformChanged();
virtual void applyChanges();
virtual void discardChanges();
virtual void loadFWObject(libfwbuilder::FWObject *obj);
virtual void validate(bool*);
virtual void isChanged(bool*);
virtual void closeEvent(QCloseEvent *e);
virtual void getHelpName(QString*);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};
#endif // CUSTOMSERVICEDIALOG_H

View File

@ -103,12 +103,6 @@ void DNSNameDialog::loadFWObject(FWObject *o)
init=false;
}
void DNSNameDialog::changed()
{
//apply->setEnabled( true );
emit changed_sign();
}
void DNSNameDialog::validate(bool *res)
{
*res=true;
@ -119,15 +113,7 @@ void DNSNameDialog::validate(bool *res)
if (!validateName(this,obj,m_dialog->obj_name->text())) { *res=false; return; }
}
void DNSNameDialog::isChanged(bool*)
{
// *res=(!init && apply->isEnabled());
}
void DNSNameDialog::libChanged()
{
changed();
}
void DNSNameDialog::applyChanges()
{
@ -143,7 +129,7 @@ void DNSNameDialog::applyChanges()
m_project->updateObjName(obj,QString::fromUtf8(oldname.c_str()));
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
@ -153,10 +139,4 @@ void DNSNameDialog::discardChanges()
}
void DNSNameDialog::closeEvent(QCloseEvent *e)
{
if (fwbdebug)
qDebug("DNSNameDialog::closeEvent got close event: %p",e);
emit close_sign(e);
}

View File

@ -45,27 +45,14 @@ class DNSNameDialog : public BaseObjectDialog
public:
DNSNameDialog(QWidget *parent);
~DNSNameDialog();
virtual void closeEvent(QCloseEvent *e);
public slots:
virtual void changed();
virtual void libChanged();
virtual void applyChanges();
virtual void discardChanges();
virtual void loadFWObject(libfwbuilder::FWObject *obj);
virtual void validate(bool*);
virtual void isChanged(bool*);
virtual void getHelpName(QString*);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};

View File

@ -108,7 +108,6 @@ class FilterDialog : public QDialog
~FilterDialog();
void setFilter(Filter *);
//virtual void closeEvent(QCloseEvent *e);
public slots:
@ -121,13 +120,6 @@ public slots:
virtual void updateData();
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
// void close_sign(QCloseEvent *e);
};

View File

@ -88,7 +88,6 @@ void FirewallDialog::loadFWObject(FWObject *o)
assert(s!=NULL);
init = true;
modified = false;
QString platform = obj->getStr("platform").c_str();
/* fill in platform */
@ -196,13 +195,6 @@ void FirewallDialog::hostOSChanged()
m_dialog->osAdvanced->setEnabled( ho!="unknown_os" );
}
void FirewallDialog::changed()
{
if (fwbdebug) qDebug("FirewallDialog::changed init=%d", init);
if (!init) modified = true;
emit changed_sign();
}
void FirewallDialog::validate(bool *res)
{
*res = true;
@ -243,15 +235,7 @@ void FirewallDialog::validate(bool *res)
}
}
void FirewallDialog::isChanged(bool *m)
{
*m = modified;
}
void FirewallDialog::libChanged()
{
changed();
}
void FirewallDialog::applyChanges()
{
@ -320,10 +304,7 @@ void FirewallDialog::applyChanges()
Resources::setDefaultTargetOptions(new_host_os, s);
}
// mw->updateLastModifiedTimestampForAllFirewalls(s);
modified = false;
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
void FirewallDialog::discardChanges()
@ -334,9 +315,9 @@ void FirewallDialog::discardChanges()
void FirewallDialog::openFWDialog()
{
if (fwbdebug)
qDebug("FirewallDialog::openFWDialog: modified=%d", modified);
qDebug("FirewallDialog::openFWDialog: modified=%d", isDataChanged());
if (modified) applyChanges();
if (isDataChanged()) applyChanges();
// if (obj->getStr("version").empty()) saveVersion();
@ -363,7 +344,7 @@ void FirewallDialog::openFWDialog()
void FirewallDialog::openOSDialog()
{
if (modified) applyChanges();
if (isDataChanged()) applyChanges();
try
{
@ -385,12 +366,4 @@ void FirewallDialog::openOSDialog()
}
}
/* ObjectEditor class connects its slot to this signal and does all
* the verification for us, then accepts (or not) the event. So we do
* nothing here and defer all the processing to ObjectEditor
*/
void FirewallDialog::closeEvent(QCloseEvent *e)
{
emit close_sign(e);
}

View File

@ -41,7 +41,6 @@ class FirewallDialog : public BaseObjectDialog
Q_OBJECT;
Ui::FirewallDialog_q *m_dialog;
bool modified;
void fillVersion();
void saveVersion();
@ -52,29 +51,16 @@ class FirewallDialog : public BaseObjectDialog
~FirewallDialog();
public slots:
virtual void changed();
virtual void libChanged();
virtual void applyChanges();
virtual void discardChanges();
virtual void platformChanged();
virtual void hostOSChanged();
virtual void loadFWObject(libfwbuilder::FWObject *obj);
virtual void validate(bool*);
virtual void isChanged(bool*);
virtual void openFWDialog();
virtual void openOSDialog();
virtual void closeEvent(QCloseEvent *e);
virtual void getHelpName(QString*);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};

View File

@ -377,13 +377,6 @@ void GroupObjectDialog::loadFWObject(FWObject *o)
init=false;
}
void GroupObjectDialog::changed()
{
//if (!init) apply->setEnabled( true );
emit changed_sign();
}
void GroupObjectDialog::validate(bool *res)
{
*res=true;
@ -395,15 +388,7 @@ void GroupObjectDialog::validate(bool *res)
}
}
void GroupObjectDialog::isChanged(bool*)
{
//*res=(!init && apply->isEnabled());
}
void GroupObjectDialog::libChanged()
{
changed();
}
void GroupObjectDialog::applyChanges()
{
@ -469,9 +454,9 @@ void GroupObjectDialog::applyChanges()
m_project->updateObjName(obj, QString::fromUtf8(oldname.c_str()));
emit notify_changes_applied_sign();
saveColumnWidths();
if (fwbdebug) qDebug("GroupObjectDialog::applyChanges done");
BaseObjectDialog::applyChanges();
}
void GroupObjectDialog::discardChanges()
@ -701,21 +686,6 @@ void GroupObjectDialog::saveColumnWidths()
st->setGroupViewColumns(s);
}
/* ObjectEditor class connects its slot to this signal and does all
* the verification for us, then accepts (or not) the event. So we do
* nothing here and defer all the processing to ObjectEditor
*/
void GroupObjectDialog::closeEvent(QCloseEvent *e)
{
saveColumnWidths();
emit close_sign(e);
}
void GroupObjectDialog::hideEvent(QHideEvent *)
{
saveColumnWidths();
}
void GroupObjectDialog::selectObject(FWObject *o)
{
int o_id = o->getId();

View File

@ -72,13 +72,10 @@ class GroupObjectDialog : public BaseObjectDialog
enum viewType { Icon, List };
public slots:
virtual void changed();
virtual void libChanged();
virtual void applyChanges();
virtual void discardChanges();
virtual void loadFWObject(libfwbuilder::FWObject *obj);
virtual void validate(bool*);
virtual void isChanged(bool*);
virtual void switchToIconView();
virtual void switchToListView();
virtual void openObject();
@ -87,8 +84,6 @@ class GroupObjectDialog : public BaseObjectDialog
virtual void dropped(QDropEvent *ev);
virtual void iconContextMenu(const QPoint & pos);
virtual void listContextMenu(const QPoint & pos);
virtual void closeEvent(QCloseEvent *e);
virtual void hideEvent(QHideEvent *e);
virtual void getHelpName(QString*);
void copyObj();
@ -104,16 +99,6 @@ class GroupObjectDialog : public BaseObjectDialog
void selectObject(libfwbuilder::FWObject *o);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
private:
static enum viewType vt;

View File

@ -75,7 +75,7 @@ void HostDialog::loadFWObject(FWObject *o)
assert(s!=NULL);
init = true;
modified = false;
data_changed = false;
Management *mgmt=s->getManagementObject();
assert(mgmt!=NULL);
@ -106,12 +106,6 @@ void HostDialog::loadFWObject(FWObject *o)
init=false;
}
void HostDialog::changed()
{
if (!init) modified = true;
emit changed_sign();
}
void HostDialog::validate(bool *res)
{
*res = true;
@ -127,15 +121,7 @@ void HostDialog::validate(bool *res)
}
}
void HostDialog::isChanged(bool *m)
{
*m = modified;
}
void HostDialog::libChanged()
{
changed();
}
void HostDialog::applyChanges()
{
@ -155,10 +141,7 @@ void HostDialog::applyChanges()
m_project->updateObjName(obj,QString::fromUtf8(oldname.c_str()));
modified = false;
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
void HostDialog::discardChanges()
@ -166,14 +149,3 @@ void HostDialog::discardChanges()
loadFWObject(obj);
}
/* ObjectEditor class connects its slot to this signal and does all
* the verification for us, then accepts (or not) the event. So we do
* nothing here and defer all the processing to ObjectEditor
*/
void HostDialog::closeEvent(QCloseEvent *e)
{
emit close_sign(e);
}

View File

@ -40,7 +40,6 @@ class HostDialog : public BaseObjectDialog
{
Q_OBJECT;
bool modified;
Ui::HostDialog_q *m_dialog;
public:
@ -48,26 +47,12 @@ class HostDialog : public BaseObjectDialog
~HostDialog();
public slots:
virtual void changed();
virtual void libChanged();
virtual void applyChanges();
virtual void discardChanges();
virtual void loadFWObject(libfwbuilder::FWObject *obj);
virtual void validate(bool*);
virtual void isChanged(bool*);
virtual void closeEvent(QCloseEvent *e);
virtual void getHelpName(QString*);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};
#endif // HOSTDIALOG_H

View File

@ -110,12 +110,6 @@ void ICMPServiceDialog::loadFWObject(FWObject *o)
init=false;
}
void ICMPServiceDialog::changed()
{
//apply->setEnabled( true );
emit changed_sign();
}
void ICMPServiceDialog::validate(bool *res)
{
*res=true;
@ -123,15 +117,7 @@ void ICMPServiceDialog::validate(bool *res)
if (!validateName(this,obj,m_dialog->obj_name->text())) { *res=false; return; }
}
void ICMPServiceDialog::isChanged(bool*)
{
//*res=(!init && apply->isEnabled());
}
void ICMPServiceDialog::libChanged()
{
changed();
}
void ICMPServiceDialog::applyChanges()
{
@ -144,8 +130,7 @@ void ICMPServiceDialog::applyChanges()
m_project->updateObjName(obj,QString::fromUtf8(oldname.c_str()));
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
void ICMPServiceDialog::discardChanges()
@ -153,15 +138,3 @@ void ICMPServiceDialog::discardChanges()
loadFWObject(obj);
}
/* ObjectEditor class connects its slot to this signal and does all
* the verification for us, then accepts (or not) the event. So we do
* nothing here and defer all the processing to ObjectEditor
*/
void ICMPServiceDialog::closeEvent(QCloseEvent *e)
{
emit close_sign(e);
}

View File

@ -47,25 +47,12 @@ class ICMPServiceDialog : public BaseObjectDialog
~ICMPServiceDialog();
public slots:
virtual void changed();
virtual void libChanged();
virtual void applyChanges();
virtual void discardChanges();
virtual void loadFWObject(libfwbuilder::FWObject *obj);
virtual void validate(bool*);
virtual void isChanged(bool*);
virtual void closeEvent(QCloseEvent *e);
virtual void getHelpName(QString*);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};

View File

@ -150,9 +150,8 @@ void IPServiceDialog::loadFWObject(FWObject *o)
void IPServiceDialog::changed()
{
//apply->setEnabled( true );
setCodeLabel();
emit changed_sign();
BaseObjectDialog::changed();
}
void IPServiceDialog::validate(bool *res)
@ -162,15 +161,7 @@ void IPServiceDialog::validate(bool *res)
if (!validateName(this,obj,m_dialog->obj_name->text())) { *res=false; return; }
}
void IPServiceDialog::isChanged(bool*)
{
//*res=(!init && apply->isEnabled());
}
void IPServiceDialog::libChanged()
{
changed();
}
void IPServiceDialog::applyChanges()
{
@ -199,8 +190,7 @@ void IPServiceDialog::applyChanges()
m_project->updateObjName(obj,QString::fromUtf8(oldname.c_str()));
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
void IPServiceDialog::discardChanges()
@ -208,14 +198,3 @@ void IPServiceDialog::discardChanges()
loadFWObject(obj);
}
/* ObjectEditor class connects its slot to this signal and does all
* the verification for us, then accepts (or not) the event. So we do
* nothing here and defer all the processing to ObjectEditor
*/
void IPServiceDialog::closeEvent(QCloseEvent *e)
{
emit close_sign(e);
}

View File

@ -52,25 +52,12 @@ public:
public slots:
virtual void changed();
virtual void libChanged();
virtual void applyChanges();
virtual void discardChanges();
virtual void loadFWObject(libfwbuilder::FWObject *obj);
virtual void validate(bool*);
virtual void isChanged(bool*);
virtual void closeEvent(QCloseEvent *e);
virtual void getHelpName(QString*);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};
#endif // IPSERVICEDIALOG_H

View File

@ -134,12 +134,6 @@ void IPv4Dialog::loadFWObject(FWObject *o)
init=false;
}
void IPv4Dialog::changed()
{
//apply->setEnabled( true );
emit changed_sign();
}
void IPv4Dialog::validate(bool *result)
{
*result=true;
@ -183,15 +177,7 @@ void IPv4Dialog::validate(bool *result)
}
}
void IPv4Dialog::isChanged(bool *)
{
//*result=(!init && apply->isEnabled());
}
void IPv4Dialog::libChanged()
{
changed();
}
void IPv4Dialog::applyChanges()
{
@ -221,8 +207,7 @@ void IPv4Dialog::applyChanges()
m_project->updateObjName(obj,QString::fromUtf8(oldname.c_str()));
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
void IPv4Dialog::discardChanges()
@ -286,11 +271,3 @@ void IPv4Dialog::DNSlookup()
return;
}
}
void IPv4Dialog::closeEvent(QCloseEvent *e)
{
if (fwbdebug)
qDebug("IPv4Dialog::closeEvent got close event: %p",e);
emit close_sign(e);
}

View File

@ -49,28 +49,15 @@ class IPv4Dialog : public BaseObjectDialog
public:
IPv4Dialog(QWidget *parent);
~IPv4Dialog();
virtual void closeEvent(QCloseEvent *e);
public slots:
virtual void changed();
virtual void libChanged();
virtual void applyChanges();
virtual void discardChanges();
virtual void loadFWObject(libfwbuilder::FWObject *obj);
virtual void validate(bool*);
virtual void isChanged(bool*);
virtual void DNSlookup();
virtual void getHelpName(QString*);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};

View File

@ -138,12 +138,6 @@ void IPv6Dialog::loadFWObject(FWObject *o)
init=false;
}
void IPv6Dialog::changed()
{
//apply->setEnabled( true );
emit changed_sign();
}
void IPv6Dialog::validate(bool *res)
{
*res=true;
@ -183,16 +177,7 @@ void IPv6Dialog::validate(bool *res)
}
}
void IPv6Dialog::isChanged(bool*)
{
//*res=(!init && apply->isEnabled());
}
void IPv6Dialog::libChanged()
{
changed();
}
void IPv6Dialog::applyChanges()
{
@ -223,8 +208,7 @@ void IPv6Dialog::applyChanges()
m_project->updateObjName(obj,QString::fromUtf8(oldname.c_str()));
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
void IPv6Dialog::discardChanges()
@ -296,11 +280,3 @@ void IPv6Dialog::DNSlookup()
return;
}
}
void IPv6Dialog::closeEvent(QCloseEvent *e)
{
if (fwbdebug)
qDebug("IPv6Dialog::closeEvent got close event: %p",e);
emit close_sign(e);
}

View File

@ -49,28 +49,15 @@ class IPv6Dialog : public BaseObjectDialog
public:
IPv6Dialog(QWidget *parent);
~IPv6Dialog();
virtual void closeEvent(QCloseEvent *e);
public slots:
virtual void changed();
virtual void libChanged();
virtual void applyChanges();
virtual void discardChanges();
virtual void loadFWObject(libfwbuilder::FWObject *obj);
virtual void validate(bool*);
virtual void isChanged(bool*);
virtual void DNSlookup();
virtual void getHelpName(QString*);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};

View File

@ -31,6 +31,7 @@
#include "DialogFactory.h"
#include "ProjectPanel.h"
#include "FWWindow.h"
#include "FWBSettings.h"
#include "interfaceProperties.h"
#include "interfacePropertiesObjectFactory.h"
@ -57,7 +58,8 @@
#include <qradiobutton.h>
#include <qpushbutton.h>
#include <qlabel.h>
#include "FWBSettings.h"
#include <QtDebug>
#include <QTime>
using namespace std;
using namespace libfwbuilder;
@ -322,15 +324,6 @@ void InterfaceDialog::loadFWObject(FWObject *o)
init=false;
}
void InterfaceDialog::changed()
{
if (fwbdebug)
qDebug("InterfaceDialog::changed()");
//apply->setEnabled( true );
emit changed_sign();
}
void InterfaceDialog::validate(bool *res)
{
*res = true;
@ -379,15 +372,7 @@ void InterfaceDialog::validate(bool *res)
delete int_prop;
}
void InterfaceDialog::isChanged(bool*)
{
//*res=(!init && apply->isEnabled());
}
void InterfaceDialog::libChanged()
{
changed();
}
void InterfaceDialog::applyChanges()
{
@ -443,7 +428,7 @@ void InterfaceDialog::applyChanges()
// interface name
mw->activeProject()->m_panel->om->guessSubInterfaceTypeAndAttributes(s);
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
void InterfaceDialog::discardChanges()
@ -453,8 +438,7 @@ void InterfaceDialog::discardChanges()
void InterfaceDialog::openIfaceDialog()
{
// TODO: applyChanges() call enabled results in problems with FWBTree ...
applyChanges();
if (isDataChanged()) applyChanges();
try
{
@ -470,7 +454,7 @@ void InterfaceDialog::openIfaceDialog()
// update object tree (if interface type has changed, the object properties
// summary text may have to change too)
mw->activeProject()->updateObjectInTree(obj, true);
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
}
catch (FWException &ex)
@ -483,15 +467,3 @@ void InterfaceDialog::openIfaceDialog()
return;
}
}
/* ObjectEditor class connects its slot to this signal and does all
* the verification for us, then accepts (or not) the event. So we do
* nothing here and defer all the processing to ObjectEditor
*/
void InterfaceDialog::closeEvent(QCloseEvent *e)
{
if (fwbdebug)
qDebug("InterfaceDialog::coseEvent got close event: %p",e);
emit close_sign(e);
}

View File

@ -55,29 +55,15 @@ class InterfaceDialog : public BaseObjectDialog
InterfaceDialog(QWidget *parent);
~InterfaceDialog();
virtual void closeEvent(QCloseEvent *e);
public slots:
virtual void changed();
virtual void libChanged();
virtual void applyChanges();
virtual void discardChanges();
virtual void loadFWObject(libfwbuilder::FWObject *obj);
virtual void validate(bool*);
virtual void isChanged(bool*);
virtual void openIfaceDialog();
virtual void getHelpName(QString*);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};
#endif // INTERFACEDIALOG_H

View File

@ -106,12 +106,6 @@ void LibraryDialog::loadFWObject(FWObject *o)
init=false;
}
void LibraryDialog::changed()
{
//apply->setEnabled( true );
emit changed_sign();
}
void LibraryDialog::changeIds(FWObject *root)
{
if (FWBTree().isStandardId(root))
@ -140,9 +134,7 @@ void LibraryDialog::applyChanges()
// m_project->updateLibName(obj);
if (color!=oldcolor) m_project->updateLibColor(obj);
//apply->setEnabled( false );
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
void LibraryDialog::discardChanges()
@ -157,10 +149,6 @@ void LibraryDialog::validate(bool *res)
if (!validateName(this,obj,m_dialog->obj_name->text())) { *res=false; return; }
}
void LibraryDialog::isChanged(bool*)
{
//*res=(!init && apply->isEnabled());
}
void LibraryDialog::changeColor()
{
@ -185,14 +173,3 @@ void LibraryDialog::fillColor()
m_dialog->colorButton->setIcon(QIcon(pm));
}
/* ObjectEditor class connects its slot to this signal and does all
* the verification for us, then accepts (or not) the event. So we do
* nothing here and defer all the processing to ObjectEditor
*/
void LibraryDialog::closeEvent(QCloseEvent *e)
{
emit close_sign(e);
}

View File

@ -55,25 +55,13 @@ class LibraryDialog : public BaseObjectDialog
~LibraryDialog();
public slots:
virtual void changed();
virtual void applyChanges();
virtual void discardChanges();
virtual void loadFWObject(libfwbuilder::FWObject *obj);
virtual void validate(bool*);
virtual void isChanged(bool*);
virtual void changeColor();
virtual void closeEvent(QCloseEvent *e);
virtual void getHelpName(QString*);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};

View File

@ -76,7 +76,7 @@ void MetricEditorPanel::changed()
void MetricEditorPanel::applyChanges()
{
rule->setMetric( value() );
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
void MetricEditorPanel::discardChanges()

View File

@ -63,15 +63,6 @@ public slots:
virtual void getHelpName(QString*);
virtual void closeEvent(QCloseEvent *e);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};

View File

@ -110,26 +110,12 @@ void NATRuleOptionsDialog::loadFWObject(FWObject *o)
init=false;
}
void NATRuleOptionsDialog::changed()
{
//apply->setEnabled( true );
emit changed_sign();
}
void NATRuleOptionsDialog::validate(bool *res)
{
*res=true;
}
void NATRuleOptionsDialog::isChanged(bool*)
{
//*res=(!init && apply->isEnabled());
}
void NATRuleOptionsDialog::libChanged()
{
changed();
}
void NATRuleOptionsDialog::applyChanges()
{
@ -141,10 +127,7 @@ void NATRuleOptionsDialog::applyChanges()
// mw->updateRuleOptions();
//apply->setEnabled( false );
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
void NATRuleOptionsDialog::discardChanges()
@ -152,14 +135,3 @@ void NATRuleOptionsDialog::discardChanges()
loadFWObject(obj);
}
/* ObjectEditor class connects its slot to this signal and does all
* the verification for us, then accepts (or not) the event. So we do
* nothing here and defer all the processing to ObjectEditor
*/
void NATRuleOptionsDialog::closeEvent(QCloseEvent *e)
{
emit close_sign(e);
}

View File

@ -51,26 +51,12 @@ class NATRuleOptionsDialog : public BaseObjectDialog
~NATRuleOptionsDialog();
public slots:
virtual void changed();
virtual void libChanged();
virtual void applyChanges();
virtual void discardChanges();
virtual void loadFWObject(libfwbuilder::FWObject *obj);
virtual void validate(bool*);
virtual void isChanged(bool*);
virtual void closeEvent(QCloseEvent *e);
virtual void getHelpName(QString*);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};
#endif // __NATRULEOPTIONSDIALOG_H

View File

@ -95,12 +95,6 @@ void NetworkDialog::loadFWObject(FWObject *o)
init=false;
}
void NetworkDialog::changed()
{
//apply->setEnabled( true );
emit changed_sign();
}
void NetworkDialog::validate(bool *result)
{
*result=true;
@ -164,15 +158,7 @@ void NetworkDialog::validate(bool *result)
}
}
void NetworkDialog::isChanged(bool*)
{
//*result=(!init && apply->isEnabled());
}
void NetworkDialog::libChanged()
{
changed();
}
void NetworkDialog::applyChanges()
{
@ -214,8 +200,7 @@ void NetworkDialog::applyChanges()
m_project->updateObjName(obj,QString::fromUtf8(oldname.c_str()));
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
void NetworkDialog::discardChanges()
@ -223,17 +208,6 @@ void NetworkDialog::discardChanges()
loadFWObject(obj);
}
/* ObjectEditor class connects its slot to this signal and does all
* the verification for us, then accepts (or not) the event. So we do
* nothing here and defer all the processing to ObjectEditor
*/
void NetworkDialog::closeEvent(QCloseEvent *e)
{
emit close_sign(e);
}
void NetworkDialog::addressEntered()
{
try

View File

@ -47,26 +47,13 @@ class NetworkDialog : public BaseObjectDialog
~NetworkDialog();
public slots:
virtual void changed();
virtual void libChanged();
virtual void applyChanges();
virtual void discardChanges();
virtual void loadFWObject(libfwbuilder::FWObject *obj);
virtual void validate(bool*);
virtual void isChanged(bool*);
virtual void closeEvent(QCloseEvent *e);
virtual void addressEntered();
virtual void getHelpName(QString*);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};

View File

@ -146,15 +146,7 @@ void NetworkDialogIPv6::validate(bool *res)
}
}
void NetworkDialogIPv6::isChanged(bool*)
{
//*res=(!init && apply->isEnabled());
}
void NetworkDialogIPv6::libChanged()
{
changed();
}
void NetworkDialogIPv6::applyChanges()
{
@ -183,10 +175,7 @@ void NetworkDialogIPv6::applyChanges()
}
m_project->updateObjName(obj,QString::fromUtf8(oldname.c_str()));
//apply->setEnabled( false );
//mw->updateLastModifiedTimestampForAllFirewalls(obj);
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
@ -195,17 +184,6 @@ void NetworkDialogIPv6::discardChanges()
loadFWObject(obj);
}
/* ObjectEditor class connects its slot to this signal and does all
* the verification for us, then accepts (or not) the event. So we do
* nothing here and defer all the processing to ObjectEditor
*/
void NetworkDialogIPv6::closeEvent(QCloseEvent *e)
{
emit close_sign(e);
}
void NetworkDialogIPv6::addressEntered()
{
try

View File

@ -48,26 +48,13 @@ class NetworkDialogIPv6 : public BaseObjectDialog
public slots:
virtual void changed();
virtual void libChanged();
virtual void applyChanges();
virtual void discardChanges();
virtual void loadFWObject(libfwbuilder::FWObject *obj);
virtual void validate(bool*);
virtual void isChanged(bool*);
virtual void closeEvent(QCloseEvent *e);
virtual void addressEntered();
virtual void getHelpName(QString*);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};
#endif // NETWORKDIALOG_H

View File

@ -96,12 +96,6 @@ void PhysicalAddressDialog::loadFWObject(FWObject *o)
init=false;
}
void PhysicalAddressDialog::changed()
{
//apply->setEnabled( true );
emit changed_sign();
}
void PhysicalAddressDialog::validate(bool *res)
{
*res=true;
@ -110,15 +104,7 @@ void PhysicalAddressDialog::validate(bool *res)
if (!validateName(this,obj,m_dialog->obj_name->text())) { *res=false; return; }
}
void PhysicalAddressDialog::isChanged(bool *)
{
//*res=(!init && apply->isEnabled());
}
void PhysicalAddressDialog::libChanged()
{
changed();
}
void PhysicalAddressDialog::applyChanges()
{
@ -132,8 +118,7 @@ void PhysicalAddressDialog::applyChanges()
m_project->updateObjName(obj,QString::fromUtf8(oldname.c_str()));
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
void PhysicalAddressDialog::discardChanges()
@ -141,14 +126,3 @@ void PhysicalAddressDialog::discardChanges()
loadFWObject(obj);
}
/* ObjectEditor class connects its slot to this signal and does all
* the verification for us, then accepts (or not) the event. So we do
* nothing here and defer all the processing to ObjectEditor
*/
void PhysicalAddressDialog::closeEvent(QCloseEvent *e)
{
emit close_sign(e);
}

View File

@ -48,26 +48,12 @@ class PhysicalAddressDialog : public BaseObjectDialog
~PhysicalAddressDialog();
public slots:
virtual void changed();
virtual void libChanged();
virtual void applyChanges();
virtual void discardChanges();
virtual void loadFWObject(libfwbuilder::FWObject *obj);
virtual void validate(bool*);
virtual void isChanged(bool*);
virtual void closeEvent(QCloseEvent *e);
virtual void getHelpName(QString*);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};
#endif // PHYSICALADDRESSDIALOG_H

View File

@ -78,15 +78,7 @@ void PrototypeDialog::validate(bool *res)
*res=true;
}
void PrototypeDialog::isChanged(bool *res)
{
*res=(!init && apply->isEnabled());
}
void PrototypeDialog::libChanged()
{
changed();
}
void PrototypeDialog::applyChanges()
{
@ -99,14 +91,6 @@ void PrototypeDialog::applyChanges()
m_project->updateObjName(obj,QString::fromUtf8(oldname.c_str()));
init=true;
/* move to another lib if we have to */
if (! FWBTree().isSystem(obj) && libs->currentText() != QString(obj->getLibrary()->getName().c_str()))
mw->moveObject(libs->currentText(), obj);
init=false;
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}

View File

@ -45,22 +45,12 @@ class PrototypeDialog : public PrototypeDialog_q
public slots:
virtual void changed();
virtual void libChanged();
virtual void applyChanges();
virtual void discardChanges();
virtual void loadFWObject(libfwbuilder::FWObject *obj);
virtual void validate(bool*);
virtual void isChanged(bool*);
virtual void closeEvent(QCloseEvent *e);
virtual void getHelpName(QString*);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
};

View File

@ -116,26 +116,12 @@ void RoutingRuleOptionsDialog::loadFWObject(FWObject *o)
init=false;
}
void RoutingRuleOptionsDialog::changed()
{
//apply->setEnabled( true );
emit changed_sign();
}
void RoutingRuleOptionsDialog::validate(bool *res)
{
*res=true;
}
void RoutingRuleOptionsDialog::isChanged(bool*)
{
//*res=(!init && apply->isEnabled());
}
void RoutingRuleOptionsDialog::libChanged()
{
changed();
}
void RoutingRuleOptionsDialog::applyChanges()
{
@ -145,10 +131,7 @@ void RoutingRuleOptionsDialog::applyChanges()
data.saveAll();
init=false;
// mw->updateRuleOptions();
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
void RoutingRuleOptionsDialog::discardChanges()
@ -156,14 +139,3 @@ void RoutingRuleOptionsDialog::discardChanges()
loadFWObject(obj);
}
/* ObjectEditor class connects its slot to this signal and does all
* the verification for us, then accepts (or not) the event. So we do
* nothing here and defer all the processing to ObjectEditor
*/
void RoutingRuleOptionsDialog::closeEvent(QCloseEvent *e)
{
emit close_sign(e);
}

View File

@ -54,26 +54,12 @@ class RoutingRuleOptionsDialog : public BaseObjectDialog
~RoutingRuleOptionsDialog();
public slots:
virtual void changed();
virtual void libChanged();
virtual void applyChanges();
virtual void discardChanges();
virtual void loadFWObject(libfwbuilder::FWObject *obj);
virtual void validate(bool*);
virtual void isChanged(bool*);
virtual void closeEvent(QCloseEvent *e);
virtual void getHelpName(QString*);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};
#endif // __ROUTINGRULEOPTIONSDIALOG_H

View File

@ -280,7 +280,7 @@ void RuleOptionsDialog::changed()
m_dialog->pf_flush->setEnabled(enable_overload_options);
m_dialog->pf_global->setEnabled(enable_overload_options);
emit changed_sign();
BaseObjectDialog::changed();
}
void RuleOptionsDialog::validate(bool *res)
@ -288,15 +288,7 @@ void RuleOptionsDialog::validate(bool *res)
*res=true;
}
void RuleOptionsDialog::isChanged(bool*)
{
//*res=(!init && apply->isEnabled());
}
void RuleOptionsDialog::libChanged()
{
changed();
}
void RuleOptionsDialog::applyChanges()
{
@ -306,10 +298,7 @@ void RuleOptionsDialog::applyChanges()
data.saveAll();
init=false;
// mw->updateRuleOptions();
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
void RuleOptionsDialog::cancelChanges()
@ -323,14 +312,3 @@ void RuleOptionsDialog::discardChanges()
loadFWObject(obj);
}
/* ObjectEditor class connects its slot to this signal and does all
* the verification for us, then accepts (or not) the event. So we do
* nothing here and defer all the processing to ObjectEditor
*/
void RuleOptionsDialog::closeEvent(QCloseEvent *e)
{
emit close_sign(e);
}

View File

@ -56,26 +56,13 @@ public:
public slots:
virtual void changed();
virtual void libChanged();
virtual void applyChanges();
virtual void cancelChanges();
virtual void discardChanges();
virtual void loadFWObject(libfwbuilder::FWObject *obj);
virtual void validate(bool*);
virtual void isChanged(bool*);
virtual void closeEvent(QCloseEvent *e);
virtual void getHelpName(QString*);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};
#endif // __RULEOPTIONSDIALOG_H

View File

@ -161,12 +161,6 @@ void RuleSetDialog::loadFWObject(FWObject *o)
init=false;
}
void RuleSetDialog::changed()
{
//apply->setEnabled( true );
emit changed_sign();
}
void RuleSetDialog::validate(bool *res)
{
*res = true;
@ -197,14 +191,7 @@ void RuleSetDialog::validate(bool *res)
}
}
void RuleSetDialog::isChanged(bool *)
{
}
void RuleSetDialog::libChanged()
{
changed();
}
void RuleSetDialog::applyChanges()
{
@ -245,10 +232,7 @@ void RuleSetDialog::applyChanges()
m_project->updateObjName(obj,QString::fromUtf8(oldname.c_str()));
init=false;
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
void RuleSetDialog::discardChanges()
@ -256,14 +240,3 @@ void RuleSetDialog::discardChanges()
loadFWObject(obj);
}
/* ObjectEditor class connects its slot to this signal and does all
* the verification for us, then accepts (or not) the event. So we do
* nothing here and defer all the processing to ObjectEditor
*/
void RuleSetDialog::closeEvent(QCloseEvent *e)
{
emit close_sign(e);
}

View File

@ -50,26 +50,12 @@ public:
~RuleSetDialog();
public slots:
virtual void changed();
virtual void libChanged();
virtual void applyChanges();
virtual void discardChanges();
virtual void loadFWObject(libfwbuilder::FWObject *obj);
virtual void validate(bool*);
virtual void isChanged(bool*);
virtual void closeEvent(QCloseEvent *e);
virtual void getHelpName(QString*);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};
#endif // RULESETDIALOG_H

View File

@ -164,12 +164,6 @@ void TCPServiceDialog::loadFWObject(FWObject *o)
init=false;
}
void TCPServiceDialog::changed()
{
//apply->setEnabled( true );
emit changed_sign();
}
void TCPServiceDialog::validate(bool *res)
{
if (fwbdebug) qDebug("TCPServiceDialog::validate");
@ -203,15 +197,7 @@ void TCPServiceDialog::validate(bool *res)
}
}
void TCPServiceDialog::isChanged(bool*)
{
//*res=(!init && apply->isEnabled());
}
void TCPServiceDialog::libChanged()
{
changed();
}
void TCPServiceDialog::applyChanges()
{
@ -246,8 +232,7 @@ void TCPServiceDialog::applyChanges()
m_project->updateObjName(obj,QString::fromUtf8(oldname.c_str()));
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
void TCPServiceDialog::discardChanges()
@ -255,17 +240,6 @@ void TCPServiceDialog::discardChanges()
loadFWObject(obj);
}
/* ObjectEditor class connects its slot to this signal and does all
* the verification for us, then accepts (or not) the event. So we do
* nothing here and defer all the processing to ObjectEditor
*/
void TCPServiceDialog::closeEvent(QCloseEvent *e)
{
emit close_sign(e);
}
void TCPServiceDialog::toggleEstablished()
{
bool using_established = m_dialog->established->isChecked();

View File

@ -47,27 +47,13 @@ class TCPServiceDialog : public BaseObjectDialog
~TCPServiceDialog();
public slots:
virtual void changed();
virtual void libChanged();
virtual void applyChanges();
virtual void discardChanges();
virtual void loadFWObject(libfwbuilder::FWObject *obj);
virtual void validate(bool*);
virtual void isChanged(bool*);
virtual void closeEvent(QCloseEvent *e);
virtual void toggleEstablished();
virtual void getHelpName(QString*);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};
#endif // TCPSERVICEDIALOG_H

View File

@ -101,12 +101,6 @@ void TagServiceDialog::loadFWObject(FWObject *o)
init=false;
}
void TagServiceDialog::changed()
{
//apply->setEnabled( true );
emit changed_sign();
}
void TagServiceDialog::validate(bool *res)
{
*res=true;
@ -117,15 +111,7 @@ void TagServiceDialog::validate(bool *res)
if (!validateName(this,obj,m_dialog->obj_name->text())) { *res=false; return; }
}
void TagServiceDialog::isChanged(bool*)
{
//*res=(!init && apply->isEnabled());
}
void TagServiceDialog::libChanged()
{
changed();
}
void TagServiceDialog::applyChanges()
{
@ -140,8 +126,7 @@ void TagServiceDialog::applyChanges()
m_project->updateObjName(obj,QString::fromUtf8(oldname.c_str()));
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
void TagServiceDialog::discardChanges()
@ -149,11 +134,3 @@ void TagServiceDialog::discardChanges()
loadFWObject(obj);
}
void TagServiceDialog::closeEvent(QCloseEvent *e)
{
if (fwbdebug)
qDebug("TagServiceDialog::closeEvent got close event: %p",e);
emit close_sign(e);
}

View File

@ -45,27 +45,14 @@ class TagServiceDialog : public BaseObjectDialog
public:
~TagServiceDialog();
TagServiceDialog(QWidget *parent);
virtual void closeEvent(QCloseEvent *e);
public slots:
virtual void changed();
virtual void libChanged();
virtual void applyChanges();
virtual void discardChanges();
virtual void loadFWObject(libfwbuilder::FWObject *obj);
virtual void validate(bool*);
virtual void isChanged(bool*);
virtual void getHelpName(QString*);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};

View File

@ -196,12 +196,6 @@ void TimeDialog::enableAllWidgets()
}
void TimeDialog::changed()
{
//apply->setEnabled( true );
emit changed_sign();
}
void TimeDialog::useStartOrEndDate()
{
enableAllWidgets();
@ -213,15 +207,7 @@ void TimeDialog::validate(bool *res)
*res=true;
}
void TimeDialog::isChanged(bool*)
{
//*res=(!init && apply->isEnabled());
}
void TimeDialog::libChanged()
{
changed();
}
void TimeDialog::applyChanges()
{
@ -281,22 +267,10 @@ void TimeDialog::applyChanges()
m_project->updateObjName(obj, QString::fromUtf8(oldname.c_str()));
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
void TimeDialog::discardChanges()
{
loadFWObject(obj);
}
/* ObjectEditor class connects its slot to this signal and does all
* the verification for us, then accepts (or not) the event. So we do
* nothing here and defer all the processing to ObjectEditor
*/
void TimeDialog::closeEvent(QCloseEvent *e)
{
emit close_sign(e);
}

View File

@ -49,27 +49,13 @@ class TimeDialog : public BaseObjectDialog
~TimeDialog();
public slots:
virtual void changed();
virtual void libChanged();
virtual void applyChanges();
virtual void useStartOrEndDate();
virtual void discardChanges();
virtual void loadFWObject(libfwbuilder::FWObject *obj);
virtual void validate(bool*);
virtual void isChanged(bool*);
virtual void closeEvent(QCloseEvent *e);
virtual void getHelpName(QString*);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};
#endif // __TIMEDIALOG_H

View File

@ -106,12 +106,6 @@ void UDPServiceDialog::loadFWObject(FWObject *o)
init=false;
}
void UDPServiceDialog::changed()
{
//apply->setEnabled( true );
emit changed_sign();
}
void UDPServiceDialog::validate(bool *res)
{
if (fwbdebug) qDebug("UDPServiceDialog::validate");
@ -145,15 +139,7 @@ void UDPServiceDialog::validate(bool *res)
}
}
void UDPServiceDialog::isChanged(bool*)
{
//*res=(!init && apply->isEnabled());
}
void UDPServiceDialog::libChanged()
{
changed();
}
void UDPServiceDialog::applyChanges()
{
@ -171,8 +157,7 @@ void UDPServiceDialog::applyChanges()
m_project->updateObjName(obj,QString::fromUtf8(oldname.c_str()));
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
void UDPServiceDialog::discardChanges()
@ -180,14 +165,3 @@ void UDPServiceDialog::discardChanges()
loadFWObject(obj);
}
/* ObjectEditor class connects its slot to this signal and does all
* the verification for us, then accepts (or not) the event. So we do
* nothing here and defer all the processing to ObjectEditor
*/
void UDPServiceDialog::closeEvent(QCloseEvent *e)
{
emit close_sign(e);
}

View File

@ -47,26 +47,12 @@ class UDPServiceDialog : public BaseObjectDialog
~UDPServiceDialog();
public slots:
virtual void changed();
virtual void libChanged();
virtual void applyChanges();
virtual void discardChanges();
virtual void loadFWObject(libfwbuilder::FWObject *obj);
virtual void validate(bool*);
virtual void isChanged(bool*);
virtual void closeEvent(QCloseEvent *e);
virtual void getHelpName(QString*);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};
#endif // UDPSERVICEDIALOG_H

View File

@ -92,12 +92,6 @@ void UserDialog::loadFWObject(FWObject *o)
init=false;
}
void UserDialog::changed()
{
//apply->setEnabled( true );
emit changed_sign();
}
void UserDialog::validate(bool *res)
{
*res=true;
@ -109,15 +103,7 @@ void UserDialog::validate(bool *res)
assert(s!=NULL);
}
void UserDialog::isChanged(bool*)
{
//*res=(!init && apply->isEnabled());
}
void UserDialog::libChanged()
{
changed();
}
void UserDialog::applyChanges()
{
@ -131,7 +117,7 @@ void UserDialog::applyChanges()
m_project->updateObjName(obj,QString::fromUtf8(oldname.c_str()));
emit notify_changes_applied_sign();
BaseObjectDialog::applyChanges();
}
void UserDialog::discardChanges()
@ -139,14 +125,3 @@ void UserDialog::discardChanges()
loadFWObject(obj);
}
/* ObjectEditor class connects its slot to this signal and does all
* the verification for us, then accepts (or not) the event. So we do
* nothing here and defer all the processing to ObjectEditor
*/
void UserDialog::closeEvent(QCloseEvent *e)
{
emit close_sign(e);
}

View File

@ -47,26 +47,12 @@ class UserDialog : public BaseObjectDialog
~UserDialog();
public slots:
virtual void changed();
virtual void libChanged();
virtual void applyChanges();
virtual void discardChanges();
virtual void loadFWObject(libfwbuilder::FWObject *obj);
virtual void validate(bool*);
virtual void isChanged(bool*);
virtual void closeEvent(QCloseEvent *e);
virtual void getHelpName(QString*);
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
void close_sign(QCloseEvent *e);
void changed_sign();
void notify_changes_applied_sign();
};
#endif // UserDialog_H

View File

@ -49,16 +49,7 @@ class instOptionsDialog : public QDialog
Ui::instOptionsDialog_q *m_dialog;
public slots:
signals:
/**
* This signal is emitted from closeEvent, ObjectEditor connects
* to this signal to make checks before the object editor can be closed
* and to store its position on the screen
*/
// void close_sign(QCloseEvent *e);
};
#endif