1
0
mirror of https://github.com/fwbuilder/fwbuilder synced 2026-03-19 17:57:22 +01:00

better WorkflowIcons initialisation

This commit is contained in:
Roman Bovsunivskiy 2010-06-17 18:39:09 +00:00
parent dadfcfbc18
commit 5442fd5708
2 changed files with 3 additions and 13 deletions

View File

@ -112,6 +112,8 @@ void ProjectPanel::initMain(FWWindow *main)
fd = new findDialog(this, this);
fd->hide();
m_panel->icons->setUpSignals(this);
}
void ProjectPanel::reset()
@ -160,8 +162,6 @@ ProjectPanel::ProjectPanel(QWidget *parent):
connect(m_panel->topSplitter, SIGNAL(splitterMoved(int,int)),
this, SLOT(splitterPositionChanged(int,int)));
m_panel->icons->setUpSignals(this);
}
ProjectPanel::~ProjectPanel()

View File

@ -38,16 +38,6 @@ WorkflowIcons::WorkflowIcons(QWidget *parent) :
ui(new Ui::WorkflowIcons_q)
{
ui->setupUi(this);
}
// Find main window object if child is in it's widget tree
QObject *findMainWindow(QObject *child)
{
if (dynamic_cast<FWWindow*>(child)!=NULL)
return child;
else
return findMainWindow(child->parent());
}
void WorkflowIcons::setUpSignals(QWidget *panel)
@ -57,7 +47,7 @@ void WorkflowIcons::setUpSignals(QWidget *panel)
connect(ui->newFirewall, SIGNAL(clicked()), newFirewall, SLOT(trigger()));
// global variable mw is null when this is running
QObject *mainWindow = findMainWindow(panel);
QObject *mainWindow = dynamic_cast<ProjectPanel*>(panel)->getWindow();
QAction *import = mainWindow->findChild<QAction*>("policyImportAction");
connect(ui->importConfig, SIGNAL(clicked()), import, SLOT(trigger()));