From: vsv Date: Tue, 13 May 2014 14:34:52 +0000 (+0400) Subject: Issue #8: Fix for delete view event X-Git-Tag: V_0.2~70 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f9ea06a9d7bb695b60b3338d6946092d05e436b2;p=modules%2Fshaper.git Issue #8: Fix for delete view event --- diff --git a/src/XGUI/XGUI_MainWindow.cpp b/src/XGUI/XGUI_MainWindow.cpp index 02971608f..a0cefc1d3 100644 --- a/src/XGUI/XGUI_MainWindow.cpp +++ b/src/XGUI/XGUI_MainWindow.cpp @@ -40,11 +40,15 @@ XGUI_MainWindow::XGUI_MainWindow(QWidget* parent) aMdiArea->addAction(aAction); connect(aAction, SIGNAL(triggered(bool)), this, SLOT(cascadeWindows())); + aAction = new QAction(aMdiArea); + aAction->setSeparator(true); + aMdiArea->addAction(aAction); + myViewer = new XGUI_Viewer(this); connect(myViewer, SIGNAL(viewCreated(XGUI_ViewWindow*)), this, SLOT(onViewCreated(XGUI_ViewWindow*))); connect(myViewer, SIGNAL(deleteView(XGUI_ViewWindow*)), - this, SLOT(onViewCreated(XGUI_ViewWindow*))); + this, SLOT(onDeleteView(XGUI_ViewWindow*))); } XGUI_MainWindow::~XGUI_MainWindow(void) @@ -129,13 +133,8 @@ void XGUI_MainWindow::onViewCreated(XGUI_ViewWindow* theWindow) { QWidget* aSubWindow = theWindow->parentWidget(); QWidget* aMDIWidget = centralWidget(); - QAction* aAction; - if (aMDIWidget->actions().size() == 3) { - aAction = new QAction(aMDIWidget); - aAction->setSeparator(true); - aMDIWidget->addAction(aAction); - } - aAction = new QAction(aSubWindow->windowTitle(), aMDIWidget); + + QAction* aAction = new QAction(aSubWindow->windowTitle(), aMDIWidget); aAction->setCheckable(true); connect(aAction, SIGNAL(triggered(bool)), this, SLOT(activateView())); aMDIWidget->addAction(aAction);