1 // PARAVIS : ParaView wrapper SALOME module
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : PVGUI_Module_MenuActions.cxx
23 // Author : Margarita KARPUNINA
26 #include "PVGUI_Module_impl.h"
28 #include <QtxAction.h>
29 #include <QtxActionMenuMgr.h>
30 #include <QtxActionToolMgr.h>
31 #include <SUIT_Desktop.h>
32 #include <SUIT_ResourceMgr.h>
33 #include <SUIT_Session.h>
34 #include <SalomeApp_Application.h>
35 #include <LightApp_Application.h>
41 #include <pqApplicationCore.h>
42 #include <pqColorScaleToolbar.h>
43 #include <pqProgressManager.h>
44 #include <pqRubberBandHelper.h>
45 #include <pqScalarBarVisibilityAdaptor.h>
46 #include <pqUndoStack.h>
47 #include <pqVCRController.h>
49 #include <pqSaveStateReaction.h>
50 #include <pqLoadDataReaction.h>
51 #include <pqLoadStateReaction.h>
52 #include <pqSaveDataReaction.h>
53 #include <pqSaveScreenshotReaction.h>
54 #include <pqExportReaction.h>
55 #include <pqSaveAnimationReaction.h>
56 #include <pqSaveAnimationGeometryReaction.h>
57 #include <pqServerConnectReaction.h>
58 #include <pqServerDisconnectReaction.h>
59 #include <pqCameraUndoRedoReaction.h>
60 #include <pqUndoRedoReaction.h>
61 #include <pqDeleteReaction.h>
62 #include <pqChangePipelineInputReaction.h>
63 #include <pqApplicationSettingsReaction.h>
64 #include <pqViewSettingsReaction.h>
65 #include <pqIgnoreSourceTimeReaction.h>
66 #include <pqViewMenuManager.h>
67 #include <pqParaViewMenuBuilders.h>
68 #include <pqProxyGroupMenuManager.h>
69 #include <pqCreateCustomFilterReaction.h>
70 #include <pqManageLinksReaction.h>
71 #include <pqManagePluginsReaction.h>
72 #include <pqCameraLinkReaction.h>
73 #include <pqManageCustomFiltersReaction.h>
74 #include <pqSetName.h>
75 #include <pqPythonShellReaction.h>
76 #include <pqTimerLogReaction.h>
77 #include <pqTestingReaction.h>
78 #include <pqAboutDialogReaction.h>
79 #include <pqHelpReaction.h>
80 #include <pqViewManager.h>
82 #include "PVGUI_Tools.h"
86 \brief Create actions for ParaView GUI operations
87 duplicating menus and toolbars in MainWindow class of
88 the standard ParaView GUI client application.
90 void PVGUI_Module::pvCreateActions()
92 SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
96 //QtxAction* aQtxAction;
101 aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_OPEN_FILE"), false );
102 anAction = new QAction(QIcon(aPixmap), tr("MEN_OPEN"), this);
103 anAction->setToolTip(tr("TOP_OPEN_FILE"));
104 anAction->setStatusTip(tr("STB_OPEN_FILE"));
105 registerAction(OpenFileId, anAction);
106 new pqLoadDataReaction(anAction);
109 anAction = new QAction(tr("MEN_LOAD_STATE"), this);
110 anAction->setToolTip(tr("TOP_LOAD_STATE"));
111 anAction->setStatusTip(tr("STB_LOAD_STATE"));
112 registerAction(LoadStateId, anAction);
113 new pqLoadStateReaction(anAction);
116 anAction = new QAction(tr("MEN_SAVE_STATE"), this);
117 anAction->setToolTip(tr("TOP_SAVE_STATE"));
118 anAction->setStatusTip(tr("STB_SAVE_STATE"));
119 registerAction(SaveStateId, anAction);
120 new pqSaveStateReaction(anAction);
123 aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_SAVE_DATA"), false );
124 anAction = new QAction(QIcon(aPixmap), tr("MEN_SAVE_DATA"), this);
125 anAction->setToolTip(tr("TOP_SAVE_DATA"));
126 anAction->setStatusTip(tr("STB_SAVE_DATA"));
127 registerAction(SaveDataId, anAction);
128 new pqSaveDataReaction(anAction);
131 aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_SAVE_SCREENSHOT"), false );
132 anAction = new QAction(QIcon(aPixmap), tr("MEN_SAVE_SCREENSHOT"), this);
133 anAction->setToolTip(tr("TOP_SAVE_SCREENSHOT"));
134 anAction->setStatusTip(tr("STB_SAVE_SCREENSHOT"));
135 registerAction(SaveScreenshotId, anAction);
136 new pqSaveScreenshotReaction(anAction);
139 anAction = new QAction(tr("MEN_EXPORT"), this);
140 anAction->setToolTip(tr("TOP_EXPORT"));
141 anAction->setStatusTip(tr("STB_EXPORT"));
142 registerAction(ExportId, anAction);
143 new pqExportReaction(anAction);
146 aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_SAVE_ANIMATION"), false );
147 anAction = new QAction(QIcon(aPixmap), tr("MEN_SAVE_ANIMATION"), this);
148 anAction->setToolTip(tr("TOP_SAVE_ANIMATION"));
149 anAction->setStatusTip(tr("STB_SAVE_ANIMATION"));
150 registerAction(SaveAnimationId, anAction);
151 new pqSaveAnimationReaction(anAction);
154 aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_SAVE_GEOMETRY"), false );
155 anAction = new QAction(QIcon(aPixmap), tr("MEN_SAVE_GEOMETRY"), this);
156 anAction->setToolTip(tr("TOP_SAVE_GEOMETRY"));
157 anAction->setStatusTip(tr("STB_SAVE_GEOMETRY"));
158 registerAction(SaveGeometryId, anAction);
159 new pqSaveAnimationGeometryReaction(anAction);
162 aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_CONNECT"), false );
163 anAction = new QAction(QIcon(aPixmap), tr("MEN_CONNECT"), this);
164 anAction->setToolTip(tr("TOP_CONNECT"));
165 anAction->setStatusTip(tr("STB_CONNECT"));
166 registerAction(ConnectId, anAction);
167 new pqServerConnectReaction(anAction);
170 aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_DISCONNECT"), false );
171 anAction = new QAction(QIcon(aPixmap), tr("MEN_DISCONNECT"), this);
172 anAction->setToolTip(tr("TOP_DISCONNECT"));
173 anAction->setStatusTip(tr("STB_DISCONNECT"));
174 registerAction(DisconnectId, anAction);
175 new pqServerDisconnectReaction(anAction);
180 aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_UNDO"), false );
181 anAction = new QAction(QIcon(aPixmap), tr("MEN_UNDO"), this);
182 anAction->setToolTip(tr("TOP_UNDO"));
183 anAction->setStatusTip(tr("STB_UNDO"));
184 registerAction(UndoId, anAction);
185 new pqUndoRedoReaction(anAction, true);
188 aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_REDO"), false );
189 anAction = new QAction(QIcon(aPixmap), tr("MEN_REDO"), this);
190 anAction->setToolTip(tr("TOP_REDO"));
191 anAction->setStatusTip(tr("STB_REDO"));
192 registerAction(RedoId, anAction);
193 new pqUndoRedoReaction(anAction, false);
196 aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_CAMERA_UNDO"), false );
197 anAction = new QAction(QIcon(aPixmap), tr("MEN_CAMERA_UNDO"), this);
198 anAction->setToolTip(tr("TOP_CAMERA_UNDO"));
199 anAction->setStatusTip(tr("STB_CAMERA_UNDO"));
200 registerAction(CameraUndoId, anAction);
201 new pqCameraUndoRedoReaction(anAction, true);
204 aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_CAMERA_REDO"), false );
205 anAction = new QAction(QIcon(aPixmap), tr("MEN_CAMERA_REDO"), this);
206 anAction->setToolTip(tr("TOP_CAMERA_REDO"));
207 anAction->setStatusTip(tr("STB_CAMERA_REDO"));
208 registerAction(CameraRedoId, anAction);
209 new pqCameraUndoRedoReaction(anAction, false);
212 anAction = new QAction(tr("MEN_CHANGE_INPUT"), this);
213 anAction->setToolTip(tr("TOP_CHANGE_INPUT"));
214 anAction->setStatusTip(tr("STB_CHANGE_INPUT"));
215 registerAction(ChangeInputId, anAction);
216 new pqChangePipelineInputReaction(anAction);
218 // Ignore source time
219 anAction = new QAction(tr("MEN_IGNORE_TIME"), this);
220 anAction->setToolTip(tr("TOP_IGNORE_TIME"));
221 anAction->setStatusTip(tr("STB_IGNORE_TIME"));
222 anAction->setCheckable(true);
223 registerAction(IgnoreTimeId, anAction);
224 new pqIgnoreSourceTimeReaction(anAction);
227 anAction = new QAction(tr("MEN_DELETE"), this);
228 anAction->setToolTip(tr("TOP_DELETE"));
229 anAction->setStatusTip(tr("STB_DELETE"));
230 registerAction(DeleteId, anAction);
231 new pqDeleteReaction(anAction);
234 anAction = new QAction(tr("MEN_DELETE_ALL"), this);
235 anAction->setToolTip(tr("TOP_DELETE_ALL"));
236 anAction->setStatusTip(tr("STB_DELETE_ALL"));
237 registerAction(DeleteAllId, anAction);
238 new pqDeleteReaction(anAction, true);
242 anAction = new QAction(tr("MEN_SETTINGS"), this);
243 anAction->setToolTip(tr("TOP_SETTINGS"));
244 anAction->setStatusTip(tr("STB_SETTINGS"));
245 registerAction(SettingsId, anAction);
246 new pqApplicationSettingsReaction(anAction);
249 anAction = new QAction(tr("MEN_VIEW_SETTINGS"), this);
250 anAction->setToolTip(tr("TOP_VIEW_SETTINGS"));
251 anAction->setStatusTip(tr("STB_VIEW_SETTINGS"));
252 registerAction(ViewSettingsId, anAction);
253 new pqViewSettingsReaction(anAction);
256 pqViewManager* viewManager = qobject_cast<pqViewManager*>(
257 pqApplicationCore::instance()->manager("MULTIVIEW_MANAGER"));
259 anAction = new QAction("Full Screen", this);
260 anAction->setObjectName("actionFullScreen");
261 anAction->setShortcut(QKeySequence("F11"));
262 connect(anAction, SIGNAL(triggered()), viewManager, SLOT(toggleFullScreen()));
263 registerAction(FullScreenId, anAction);
267 // Create Custom Filter
268 anAction = new QAction(tr("MEN_CREATE_CUSTOM_FILTER"), this);
269 anAction->setToolTip(tr("TOP_CREATE_CUSTOM_FILTER"));
270 anAction->setStatusTip(tr("STB_CREATE_CUSTOM_FILTER"));
271 registerAction(CreateCustomFilterId, anAction);
272 new pqCreateCustomFilterReaction(anAction << pqSetName("actionToolsCreateCustomFilter"));
274 // Manage Custom Filters
275 anAction = new QAction(tr("MEN_MANAGE_CUSTOM_FILTERS"), this);
276 anAction->setToolTip(tr("TOP_MANAGE_CUSTOM_FILTERS"));
277 anAction->setStatusTip(tr("STB_MANAGE_CUSTOM_FILTERS"));
278 registerAction(ManageCustomFiltersId, anAction);
279 new pqManageCustomFiltersReaction(anAction << pqSetName("actionToolsManageCustomFilters"));
282 anAction = new QAction(tr("MEN_MANAGE_LINKS"), this);
283 anAction->setToolTip(tr("TOP_MANAGE_LINKS"));
284 anAction->setStatusTip(tr("STB_MANAGE_LINKS"));
285 registerAction(ManageLinksId, anAction);
286 new pqManageLinksReaction(anAction << pqSetName("actionToolsManageLinks"));
289 anAction = new QAction(tr("MEN_ADD_CAMERA_LINK"), this);
290 anAction->setToolTip(tr("TOP_ADD_CAMERA_LINK"));
291 anAction->setStatusTip(tr("STB_ADD_CAMERA_LINK"));
292 registerAction(AddCameraLinkId, anAction);
293 new pqCameraLinkReaction(anAction << pqSetName("actionToolsAddCameraLink"));
295 // Manage Plugins/Extensions
296 anAction = new QAction(tr("MEN_MANAGE_PLUGINS"), this);
297 anAction->setToolTip(tr("TOP_MANAGE_PLUGINS"));
298 anAction->setStatusTip(tr("STB_MANAGE_PLUGINS"));
299 registerAction(ManagePluginsExtensionsId, anAction);
300 new pqManagePluginsReaction(anAction << pqSetName("actionManage_Plugins"));
303 anAction = new QAction(tr("MEN_RECORD_TEST"), this);
304 anAction->setToolTip(tr("TOP_RECORD_TEST"));
305 anAction->setStatusTip(tr("STB_RECORD_TEST"));
306 registerAction(RecordTestId, anAction);
307 new pqTestingReaction(anAction << pqSetName("actionToolsRecordTest"), pqTestingReaction::RECORD);
310 anAction = new QAction(tr("MEN_PLAY_TEST"), this);
311 anAction->setToolTip(tr("TOP_PLAY_TEST"));
312 anAction->setStatusTip(tr("STB_PLAY_TEST"));
313 registerAction(PlayTestId, anAction);
314 new pqTestingReaction(anAction << pqSetName("actionToolsPlayTest"), pqTestingReaction::PLAYBACK);
317 anAction = new QAction(tr("MEN_MAX_WINDOW_SIZE"), this);
318 anAction->setToolTip(tr("TOP_MAX_WINDOW_SIZE"));
319 anAction->setStatusTip(tr("PRP_APP_MAX_WINDOW_SIZE"));
320 anAction->setCheckable(true);
321 registerAction(MaxWindowSizeId, anAction);
322 new pqTestingReaction(anAction << pqSetName("actionTesting_Window_Size"),
323 pqTestingReaction::LOCK_VIEW_SIZE);
326 anAction = new QAction(tr("MEN_TIMER_LOG"), this);
327 anAction->setToolTip(tr("TOP_TIMER_LOG"));
328 anAction->setStatusTip(tr("STB_TIMER_LOG"));
329 registerAction(TimerLogId, anAction);
330 new pqTimerLogReaction(anAction << pqSetName("actionToolsTimerLog"));
333 anAction = new QAction(tr("MEN_OUTPUT_WINDOW"), this);
334 anAction->setToolTip(tr("TOP_OUTPUT_WINDOW"));
335 anAction->setStatusTip(tr("STB_OUTPUT_WINDOW"));
336 registerAction(OutputWindowId, anAction);
337 anAction << pqSetName("actionToolsOutputWindow");
338 connect(anAction, SIGNAL(triggered()), pqApplicationCore::instance(), SLOT(showOutputWindow()));
341 anAction = new QAction(tr("MEN_PYTHON_SHELL"), this);
342 anAction->setToolTip(tr("TOP_PYTHON_SHELL"));
343 anAction->setStatusTip(tr("STB_PYTHON_SHELL"));
344 registerAction(PythonShellId, anAction);
345 new pqPythonShellReaction(anAction << pqSetName("actionToolsPythonShell"));
350 anAction = new QAction(tr("MEN_ABOUT"), this);
351 anAction->setToolTip(tr("TOP_ABOUT"));
352 anAction->setStatusTip(tr("STB_ABOUT"));
353 registerAction(AboutParaViewId, anAction);
354 new pqAboutDialogReaction(anAction << pqSetName("actionAbout"));
356 // Native ParaView user documentation
357 aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_PARAVIEW_HELP"), false );
358 anAction = new QAction(QIcon(aPixmap), tr("MEN_PARAVIEW_HELP"), this);
359 anAction->setToolTip(tr("TOP_PARAVIEW_HELP"));
360 anAction->setStatusTip(tr("STB_PARAVIEW_HELP"));
361 anAction->setShortcut(QKeySequence::HelpContents);
362 connect(anAction, SIGNAL(triggered()), this, SLOT(showParaViewHelp()));
363 registerAction(ParaViewHelpId, anAction);
364 //new pqHelpReaction(anAction << pqSetName("actionHelp"));
368 \brief Create menus for ParaView GUI operations
369 duplicating menus in pqMainWindow ParaView class
371 In particular, ParaView is responsible for updating "Sources" and "Filters" menus.
372 For this, specific menu managers created by pqMainWindowCore class are used, and PVGUI_Module
373 is responsible for creation of corresponding QMenu objects only.
375 void PVGUI_Module::pvCreateMenus()
377 SUIT_Desktop* desk = application()->desktop();
380 int aPVMnu = createMenu( tr( "MEN_DESK_FILE" ), -1, -1 );
382 createMenu( OpenFileId, aPVMnu, 5 );
385 int aMenuId = createMenu( tr( "MEN_RECENT_FILES" ), aPVMnu, -1, 5 );
386 QMenu* aMenu = menuMgr()->findMenu( aMenuId );
387 Implementation->RecentFilesMenu = new pqRecentFilesMenu( *aMenu, getApp()->desktop() );
388 QList<QAction*> anActns = aMenu->actions();
389 for (int i = 0; i < anActns.size(); ++i)
390 createMenu( anActns.at(i), aMenuId );
393 createMenu( separator(), aPVMnu, -1, 5 );
395 createMenu( LoadStateId, aPVMnu, 15 );
396 createMenu( SaveStateId, aPVMnu, 15 );
397 createMenu( separator(), aPVMnu, -1, 15 );
399 createMenu( SaveDataId, aPVMnu, 25 );
400 createMenu( SaveScreenshotId, aPVMnu, 25 );
401 createMenu( ExportId, aPVMnu, 25 );
402 createMenu( separator(), aPVMnu, -1, 25 );
404 createMenu( SaveAnimationId, aPVMnu, 35 );
405 createMenu( SaveGeometryId, aPVMnu, 35 );
406 createMenu( separator(), aPVMnu, -1, 35 );
408 createMenu( ConnectId, aPVMnu, 45 );
409 createMenu( DisconnectId, aPVMnu, 45 );
410 createMenu( separator(), aPVMnu, -1, 45 );
413 aPVMnu = createMenu( tr( "MEN_DESK_EDIT" ), -1, -1 );
415 createMenu( UndoId, aPVMnu );
416 createMenu( RedoId, aPVMnu );
417 createMenu( separator(), aPVMnu );
419 createMenu( CameraUndoId, aPVMnu );
420 createMenu( CameraRedoId, aPVMnu );
421 createMenu( separator(), aPVMnu );
423 createMenu( ChangeInputId, aPVMnu );
424 createMenu( IgnoreTimeId, aPVMnu );
425 createMenu( DeleteId, aPVMnu );
426 createMenu( DeleteAllId, aPVMnu );
427 createMenu( separator(), aPVMnu );
429 createMenu( SettingsId, aPVMnu );
430 createMenu( ViewSettingsId, aPVMnu );
431 createMenu( separator(), aPVMnu );
434 aPVMnu = createMenu( tr( "MEN_DESK_VIEW" ), -1, -1 );
435 myToolbarsMenuId = createMenu( "Toolbars", aPVMnu );
436 aMenu = getMenu( myToolbarsMenuId );
439 connect(aMenu, SIGNAL(aboutToShow()), this, SLOT(buildToolbarsMenu()));
441 createMenu( separator(), aPVMnu );
442 createMenu( FullScreenId, aPVMnu );
444 // --- Menu "Sources"
446 // Install ParaView managers for "Sources" menu
448 mySourcesMenuId = createMenu( tr( "MEN_DESK_SOURCES" ), -1, -1, 60);
449 if ( (aRes = getMenu( mySourcesMenuId )) ) {
450 pqParaViewMenuBuilders::buildSourcesMenu(*aRes, desk);
453 // --- Menu "Filters"
455 // Install ParaView managers for "Filters" menu
456 myFiltersMenuId = createMenu( tr( "MEN_DESK_FILTERS" ), -1, -1, 70 );
457 if ( (aRes = getMenu( myFiltersMenuId )) ) {
458 pqParaViewMenuBuilders::buildFiltersMenu(*aRes, desk);
462 myMacrosMenuId = createMenu( tr( "MEN_MACROS" ), -1, -1, 80 );
463 if ( (aRes = getMenu( myMacrosMenuId )) ) {
464 pqParaViewMenuBuilders::buildMacrosMenu(*aRes);
469 int aToolsMnu = createMenu( tr( "MEN_DESK_TOOLS" ), -1, -1, 90 );
471 createMenu( CreateCustomFilterId, aToolsMnu );
472 createMenu( AddCameraLinkId, aToolsMnu );
473 createMenu( separator(), aToolsMnu );
474 createMenu( ManageCustomFiltersId, aToolsMnu );
475 createMenu( ManageLinksId, aToolsMnu );
476 createMenu( ManagePluginsExtensionsId, aToolsMnu );
477 createMenu( separator(), aToolsMnu );
479 createMenu( RecordTestId, aToolsMnu );
480 createMenu( PlayTestId, aToolsMnu );
481 createMenu( MaxWindowSizeId, aToolsMnu );
482 createMenu( separator(), aToolsMnu );
484 createMenu( TimerLogId, aToolsMnu );
485 createMenu( OutputWindowId, aToolsMnu );
486 createMenu( separator(), aToolsMnu );
488 createMenu( PythonShellId, aToolsMnu );
492 int aHelpMnu = createMenu( tr( "MEN_DESK_HELP" ), -1, -1 );
493 createMenu( AboutParaViewId, aHelpMnu );
495 int aHelpModule = createMenu( LightApp_Application::tr( "MEN_DESK_MODULE_HELP" ), aHelpMnu, -1 );
496 createMenu( ParaViewHelpId, aHelpModule );
500 \brief Create toolbars for ParaView GUI operations
501 duplicating toolbars in pqMainWindow ParaView class
503 void PVGUI_Module::pvCreateToolBars()
505 SUIT_Desktop* desk = application()->desktop();
506 pqParaViewMenuBuilders::buildToolbars(*desk);
510 \brief Returns QMenu by its id.
512 QMenu* PVGUI_Module::getMenu( const int id )
515 SalomeApp_Application* anApp = getApp();
516 SUIT_Desktop* desk = anApp->desktop();
518 QtxActionMenuMgr* menuMgr = desk->menuMgr();
519 res = menuMgr->findMenu( id );
525 \brief Returns list of ParaView toolbars
527 QList<QToolBar*> PVGUI_Module::getParaViewToolbars()
529 QList<QToolBar*> all_toolbars = application()->desktop()->findChildren<QToolBar*>();
530 // First two toolbars has to be ignored because they are not from ParaView
531 if (all_toolbars.size() > 2) {
532 all_toolbars.removeFirst();
533 all_toolbars.removeFirst();
541 \brief Builds a menu which referred to toolbars
543 void PVGUI_Module::buildToolbarsMenu()
545 SUIT_Desktop* desk = application()->desktop();
546 QMenu* aMenu = menuMgr()->findMenu( myToolbarsMenuId );
549 QList<QMenu*> child_menus = aMenu->findChildren<QMenu*>();
550 foreach (QMenu* menu, child_menus) {
553 QList<QToolBar*> all_toolbars = getParaViewToolbars();
555 // Add menus for all toolbars and actions from them.
556 // This puts menu actions for all toolbars making it possible to access all
557 // toolbar actions even when the toolbar are not visible.
558 // I wonder if I should ignore the pqMainControlsToolbar since those actions
559 // are already placed at other places.
560 foreach (QToolBar* toolbar, all_toolbars) {
561 QMenu* sub_menu = new QMenu(aMenu) << pqSetName(toolbar->windowTitle());
563 foreach (QAction* action, toolbar->actions()) {
564 if (!action->text().isEmpty()) {
566 sub_menu->addAction(action);
570 QAction* menu_action = aMenu->addMenu(sub_menu);
571 menu_action->setText(toolbar->windowTitle());
576 disconnect(aMenu, SIGNAL(aboutToShow()), this, SLOT(buildToolbarsMenu()));