]> SALOME platform Git repositories - modules/gui.git/blob - src/PVViewer/PVViewer_GUIElements.cxx
Salome HOME
Fixing menus in PARAVIS.
[modules/gui.git] / src / PVViewer / PVViewer_GUIElements.cxx
1 // Copyright (C) 2010-2014  CEA/DEN, EDF R&D
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // Author: Adrien Bruneton (CEA)
20
21 #include "PVViewer_GUIElements.h"
22 #include "SUIT_Desktop.h"
23
24 #include <pqPropertiesPanel.h>
25 #include <pqPipelineBrowserWidget.h>
26 #include <pqParaViewMenuBuilders.h>
27
28 #include <QMenu>
29 #include <QList>
30 #include <QAction>
31
32 PVViewer_GUIElements * PVViewer_GUIElements::theInstance = 0;
33
34 PVViewer_GUIElements::PVViewer_GUIElements(SUIT_Desktop* desk) :
35   propertiesPanel(0), pipelineBrowserWidget(0),
36   sourcesMenu(0)
37 {
38   propertiesPanel = new pqPropertiesPanel(desk);
39   propertiesPanel->hide();
40   pipelineBrowserWidget  = new pqPipelineBrowserWidget(desk);
41   pipelineBrowserWidget->hide();
42
43 //  sourcesMenu = new QMenu(desk);
44 //  pqParaViewMenuBuilders::buildSourcesMenu(*sourcesMenu, desk);
45 //  filtersMenu = new QPVMenu(desk);
46 //  pqParaViewMenuBuilders::buildFiltersMenu(*filtersMenu, desk);
47 //  macrosMenu = new QMenu(desk);
48 //  pqParaViewMenuBuilders::buildMacrosMenu(*macrosMenu);
49 }
50
51 PVViewer_GUIElements * PVViewer_GUIElements::GetInstance(SUIT_Desktop* desk)
52 {
53   if (! theInstance)
54     theInstance = new PVViewer_GUIElements(desk);
55   return theInstance;
56 }
57
58 //void PVViewer_GUIElements::updateSourcesMenu(QMenu *menu)
59 //{
60 //  if (menu)
61 //    {
62 //      menu->clear();
63 //      QList<QAction *> act_list = sourcesMenu->actions();
64 //      foreach(QAction * a, act_list)
65 //      {
66 //        menu->addAction(a);
67 //      }
68 //    }
69 //}
70 //
71 //void PVViewer_GUIElements::updateFiltersMenu(QMenu *menu)
72 //{
73 //  if (menu)
74 //    {
75 //      filtersMenu->linkToMenu(menu);
76 //      menu->clear();
77 //      QList<QAction *> act_list = filtersMenu->actions();
78 //      foreach(QAction * a, act_list)
79 //      {
80 //        menu->addAction(a);
81 //      }
82 //    }
83 //}
84 //
85 //void PVViewer_GUIElements::updateMacrosMenu(QMenu *menu)
86 //{
87 //  if (menu)
88 //    {
89 //      menu->clear();
90 //      QList<QAction *> act_list = macrosMenu->actions();
91 //      foreach(QAction * a, act_list)
92 //      {
93 //        menu->addAction(a);
94 //      }
95 //    }
96 //}
97
98
99 void PVViewer_GUIElements::onEmulateApply()
100 {
101   if (propertiesPanel)
102     propertiesPanel->apply();
103 }