1
0
mirror of https://github.com/fwbuilder/fwbuilder synced 2026-03-23 03:37:15 +01:00

see #2283 fixes GUI crash when importer could not create firewall object

This commit is contained in:
Vadim Kurland 2011-03-27 18:17:14 -07:00
parent 1e0958384a
commit f61cc9d8bf

View File

@ -101,37 +101,48 @@ ImportFirewallConfigurationWizard::~ImportFirewallConfigurationWizard()
void ImportFirewallConfigurationWizard::accept()
{
if (platform == "pix" || platform == "fwsm")
if (fwbdebug) qDebug() << "ImportFirewallConfigurationWizard::accept()"
<< "fw=" << fw;
if (fw != NULL && (platform == "pix" || platform == "fwsm"))
dynamic_cast<IC_NetworkZonesPage*>(
page(Page_NetworkZones))->setNetworkZones();
if (fwbdebug) qDebug() << "ImportFirewallConfigurationWizard::accept()"
<< "merging object trees";
// merge dbcopy into db
CompareObjectsDialog cod(this);
db_orig->merge(db_copy, &cod);
if (fwbdebug) qDebug() << "ImportFirewallConfigurationWizard::accept()"
<< "merge done";
ProjectPanel *pp = mw->activeProject();
QString filename = pp->getFileName();
QCoreApplication::postEvent(
mw, new reloadObjectTreeImmediatelyEvent(filename));
QCoreApplication::postEvent(
pp, new showObjectInTreeEvent(filename, fw->getId()));
QCoreApplication::postEvent(
pp, new expandObjectInTreeEvent(
mw->activeProject()->getFileName(), fw->getId()));
QCoreApplication::postEvent(
mw, new openObjectInEditorEvent(filename, fw->getId()));
// Open first created Policy ruleset object
FWObject *first_policy = fw->getFirstByType(Policy::TYPENAME);
if (first_policy)
if (fw)
{
QCoreApplication::postEvent(
pp, new openRulesetEvent(filename, first_policy->getId()));
pp, new showObjectInTreeEvent(filename, fw->getId()));
QCoreApplication::postEvent(
pp, new expandObjectInTreeEvent(
mw->activeProject()->getFileName(), fw->getId()));
QCoreApplication::postEvent(
mw, new openObjectInEditorEvent(filename, fw->getId()));
// Open first created Policy ruleset object
FWObject *first_policy = fw->getFirstByType(Policy::TYPENAME);
if (first_policy)
QCoreApplication::postEvent(
pp, new openRulesetEvent(filename, first_policy->getId()));
}
QWizard::accept();
}