mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-09-11 15:41:41 +02:00
bugfix 2578
This commit is contained in:
@@ -1399,14 +1399,6 @@ listOfLibraries *FWWindow::getAddOnLibs()
|
||||
return activeProject()->getAddOnLibs();
|
||||
return 0;
|
||||
}
|
||||
|
||||
libfwbuilder::FWObject* FWWindow::getStandardSlotForObject(libfwbuilder::FWObject* lib,
|
||||
const QString &objType)
|
||||
{
|
||||
if (activeProject())
|
||||
return activeProject()->getStandardSlotForObject(lib, objType);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
bool FWWindow::isSystem(libfwbuilder::FWObject *obj)
|
||||
|
||||
+3
-3
@@ -74,9 +74,11 @@ class FWWindow : public QMainWindow {
|
||||
//int lastFirewallIdx;
|
||||
|
||||
void clearFirewallTabs();
|
||||
ProjectPanel* activeProject();
|
||||
ProjectPanel *newProjectPanel();
|
||||
void showSub(ProjectPanel *projectW);
|
||||
public:
|
||||
ProjectPanel* activeProject();
|
||||
|
||||
public slots:
|
||||
|
||||
virtual void search();
|
||||
@@ -343,8 +345,6 @@ class FWWindow : public QMainWindow {
|
||||
libfwbuilder::FWObjectDatabase* db();
|
||||
QString printHeader();
|
||||
listOfLibraries *getAddOnLibs();
|
||||
libfwbuilder::FWObject* getStandardSlotForObject(libfwbuilder::FWObject* lib,
|
||||
const QString &objType);
|
||||
|
||||
bool isSystem(libfwbuilder::FWObject *obj);
|
||||
protected:
|
||||
|
||||
+10
-2
@@ -55,6 +55,8 @@
|
||||
#include "fwbuilder/RuleElement.h"
|
||||
|
||||
#include "FWWindow.h"
|
||||
#include "ProjectPanel.h"
|
||||
#include "FWBTree.h"
|
||||
|
||||
using namespace libfwbuilder;
|
||||
|
||||
@@ -62,9 +64,15 @@ FWObject* Importer::createObject(const std::string &objType,
|
||||
const std::string &objName)
|
||||
{
|
||||
assert(library!=NULL);
|
||||
FWObject *slot = mw->getStandardSlotForObject(library,
|
||||
objType.c_str());
|
||||
if (mw->activeProject())
|
||||
{
|
||||
FWObject *slot = mw->activeProject()->getFWTree()->getStandardSlotForObject(library,objType.c_str());
|
||||
return createObject(slot, objType, objName);
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
FWObject* Importer::createObject(FWObject *parent,
|
||||
|
||||
@@ -1410,7 +1410,7 @@ void ObjectManipulator::moveObject(FWObject *targetLib, FWObject *obj)
|
||||
if (FWObjectDatabase::isA(targetLib)) grp = targetLib;
|
||||
else
|
||||
{
|
||||
grp=m_project->getStandardSlotForObject(targetLib,
|
||||
grp=m_project->getFWTree()->getStandardSlotForObject(targetLib,
|
||||
obj->getTypeName().c_str());
|
||||
}
|
||||
|
||||
@@ -2027,7 +2027,7 @@ void ObjectManipulator::groupObjects()
|
||||
* only with names of read-write libraries
|
||||
*/
|
||||
if (lib->isReadOnly()) return;
|
||||
FWObject *parent = m_project->getStandardSlotForObject(lib,type);
|
||||
FWObject *parent = m_project->getFWTree()->getStandardSlotForObject(lib,type);
|
||||
if (parent==NULL)
|
||||
{
|
||||
if (fwbdebug)
|
||||
@@ -2381,7 +2381,7 @@ FWObject* ObjectManipulator::createObject(const QString &objType,
|
||||
i++;
|
||||
}
|
||||
|
||||
FWObject *parent=m_project->getStandardSlotForObject(lib, objType);
|
||||
FWObject *parent=m_project->getFWTree()->getStandardSlotForObject(lib, objType);
|
||||
if (parent==NULL)
|
||||
{
|
||||
|
||||
@@ -2440,8 +2440,8 @@ FWObject* ObjectManipulator::createObject(FWObject *parent,
|
||||
}
|
||||
|
||||
|
||||
FWObject* ObjectManipulator::copyObj2Tree(const QString &objType, const QString &objName,
|
||||
libfwbuilder::FWObject *copyFrom, FWObject *parent, bool askLib)
|
||||
FWObject* ObjectManipulator::copyObj2Tree(const QString &/*objType*/, const QString &/*objName*/,
|
||||
libfwbuilder::FWObject *copyFrom, FWObject */*parent*/, bool /*askLib*/)
|
||||
{
|
||||
if (!validateDialog()) return NULL;
|
||||
ids.clear();
|
||||
@@ -2470,7 +2470,7 @@ libfwbuilder::FWObject * ObjectManipulator::copyObjWithDeep(libfwbuilder::FWObje
|
||||
FWReference * ref = FWReference::cast(nobj);
|
||||
if (ref!=NULL)
|
||||
{
|
||||
FWObject * obj = copyObjWithDeep(ref->getPointer());
|
||||
copyObjWithDeep(ref->getPointer());
|
||||
return ref ;
|
||||
}
|
||||
|
||||
@@ -2527,7 +2527,7 @@ libfwbuilder::FWObject * ObjectManipulator::copyObjWithDeep(libfwbuilder::FWObje
|
||||
|
||||
if (lib->getRoot()->getById(nobj->getId(),true)==NULL)
|
||||
{
|
||||
FWObject *par = m_project->getStandardSlotForObject(lib, nobj->getTypeName().c_str());
|
||||
FWObject *par = m_project->getFWTree()->getStandardSlotForObject(lib, nobj->getTypeName().c_str());
|
||||
FWObject *no = pasteTo (par, nobj, false, false, false);
|
||||
if (no && Firewall::isA(no))
|
||||
{
|
||||
@@ -2536,7 +2536,7 @@ libfwbuilder::FWObject * ObjectManipulator::copyObjWithDeep(libfwbuilder::FWObje
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nobj;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -3156,19 +3156,6 @@ bool ProjectPanel::getDeleteMenuState(const QString &objPath)
|
||||
{
|
||||
return objectTreeFormat->getDeleteMenuState(objPath);
|
||||
}
|
||||
|
||||
void ProjectPanel::getStandardSlotForObject(const QString &objType,
|
||||
QString &parentType,
|
||||
QString &parentName)
|
||||
{
|
||||
return objectTreeFormat->getStandardSlotForObject(objType, parentType, parentName);
|
||||
}
|
||||
|
||||
libfwbuilder::FWObject* ProjectPanel::getStandardSlotForObject(libfwbuilder::FWObject* lib,
|
||||
const QString &objType)
|
||||
{
|
||||
return objectTreeFormat->getStandardSlotForObject(lib, objType);
|
||||
}
|
||||
|
||||
libfwbuilder::FWObject* ProjectPanel::createNewLibrary(libfwbuilder::FWObjectDatabase *db)
|
||||
{
|
||||
|
||||
@@ -108,6 +108,8 @@ class ProjectPanel: public QWidget {
|
||||
libfwbuilder::RuleElement *re_old,
|
||||
const std::map<const std::string, libfwbuilder::FWObject *> &objByIds);
|
||||
public:
|
||||
FWBTree * getFWTree () {return objectTreeFormat;}
|
||||
|
||||
QMdiSubWindow *mdiWindow;
|
||||
Ui::ProjectPanel_q *m_panel;
|
||||
FindObjectWidget *findObjectWidget;
|
||||
@@ -376,11 +378,6 @@ public:
|
||||
bool getCutMenuState(const QString &objPath);
|
||||
bool getPasteMenuState(const QString &objPath);
|
||||
bool getDeleteMenuState(const QString &objPath);
|
||||
void getStandardSlotForObject(const QString &objType,
|
||||
QString &parentType,
|
||||
QString &parentName);
|
||||
libfwbuilder::FWObject* getStandardSlotForObject(libfwbuilder::FWObject* lib,
|
||||
const QString &objType);
|
||||
libfwbuilder::FWObject* createNewLibrary(libfwbuilder::FWObjectDatabase *db);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user