mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-09-12 08:02:00 +02:00
see #2283 fixes GUI crash when importer could not create firewall object
This commit is contained in:
+26
-15
@@ -101,37 +101,48 @@ ImportFirewallConfigurationWizard::~ImportFirewallConfigurationWizard()
|
|||||||
|
|
||||||
void ImportFirewallConfigurationWizard::accept()
|
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*>(
|
dynamic_cast<IC_NetworkZonesPage*>(
|
||||||
page(Page_NetworkZones))->setNetworkZones();
|
page(Page_NetworkZones))->setNetworkZones();
|
||||||
|
|
||||||
|
if (fwbdebug) qDebug() << "ImportFirewallConfigurationWizard::accept()"
|
||||||
|
<< "merging object trees";
|
||||||
|
|
||||||
// merge dbcopy into db
|
// merge dbcopy into db
|
||||||
|
|
||||||
CompareObjectsDialog cod(this);
|
CompareObjectsDialog cod(this);
|
||||||
db_orig->merge(db_copy, &cod);
|
db_orig->merge(db_copy, &cod);
|
||||||
|
|
||||||
|
if (fwbdebug) qDebug() << "ImportFirewallConfigurationWizard::accept()"
|
||||||
|
<< "merge done";
|
||||||
|
|
||||||
ProjectPanel *pp = mw->activeProject();
|
ProjectPanel *pp = mw->activeProject();
|
||||||
QString filename = pp->getFileName();
|
QString filename = pp->getFileName();
|
||||||
|
|
||||||
QCoreApplication::postEvent(
|
QCoreApplication::postEvent(
|
||||||
mw, new reloadObjectTreeImmediatelyEvent(filename));
|
mw, new reloadObjectTreeImmediatelyEvent(filename));
|
||||||
|
|
||||||
QCoreApplication::postEvent(
|
if (fw)
|
||||||
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(
|
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();
|
QWizard::accept();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user