1 // Copyright (C) 2009-2015 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "BL_MainWindows_SALOME.hxx"
22 #include <SalomeApp_Application.h>
23 #include <SalomeApp_Engine_i.h>
24 #include <SUIT_Desktop.h>
25 #include <SUIT_ViewManager.h>
26 #include <SUIT_ViewWindow.h>
30 BL::MainWindows_SALOME::MainWindows_SALOME(const QString & module_name) :
31 SalomeApp_Module(module_name)
33 DEBTRACE("Creating BL::MainWindows_SALOME");
40 BL::MainWindows_SALOME::initialize(SalomeApp_Application * appli)
42 DEBTRACE("Initialize BL::MainWindows_SALOME");
49 BL::MainWindows_SALOME::createView()
51 DEBTRACE("BL::MainWindows_SALOME CreateView");
52 QString vmType = "JobManager View";
54 // Get JobManager View Manager
55 _svm = _appli->getViewManager( vmType, true );
57 // view manager not found
58 QTextEdit* w = new QTextEdit;
59 _svm = _appli->createViewManager( vmType, w );
63 _viewWin = _svm->getActiveView();
64 _viewWin->setClosable( false );
65 _currentViewId = _viewWin->getId();
66 DEBTRACE("End of BL::MainWindows_SALOME CreateView");
70 BL::MainWindows_SALOME::restoreViewFocus()
73 SUIT_ViewWindow* resWnd = 0;
76 QList<SUIT_ViewWindow*> wndlist = _appli->desktop()->windows();
78 for (int i = 0; i < wndlist.size(); ++i)
81 if (_currentViewId == wnd->getId()) {resWnd = wnd;}
94 BL::MainWindows_SALOME::engineIOR() const
96 DEBTRACE("Entering in BL::SalomeGui::engineIOR");
97 QString anEngineIOR = SalomeApp_Engine_i::EngineIORForComponent( "JOBMANAGER", true ).c_str();
102 BL::MainWindows_SALOME::viewManagers(QStringList& list) const
104 DEBTRACE("Entering in BL::SalomeGui::viewManagers");
106 list.append(_svm->getType());
110 BL::MainWindows_SALOME::~MainWindows_SALOME()
112 DEBTRACE("Destroying BL::MainWindows_SALOME");
116 BL::MainWindows_SALOME::getDockParent()
118 return _appli->desktop();
122 BL::MainWindows_SALOME::getTabParent()
128 BL::MainWindows_SALOME::createAction(const QString& toolTip,
131 const QString& status,
137 const QString & shortCut)
139 return SalomeApp_Module::createAction(getActionId(), toolTip, icon, menu, status, accel, parent, checkable, receiver, member, shortCut);
143 BL::MainWindows_SALOME::createTopMenu(const QString & menu_name)
145 return createMenu(menu_name, -1, -1, 30 );
149 BL::MainWindows_SALOME::addActionToMenu(QAction * action, int menu_id)
151 createMenu(action, menu_id);