31 #include <SalomeApp_Module.h>
32 #include <SalomeApp_Application.h>
33 #include "SUIT_Session.h"
34 #include "SUIT_ResourceMgr.h"
36 #include <QxScene_ViewManager.h>
37 #include <QxScene_ViewModel.h>
38 #include <QxScene_ViewWindow.h>
39 #include <QtxActionToolMgr.h>
49 SuitWrapper::SuitWrapper(
QObject* wrapped) : _wrapped(wrapped)
66 QxScene_ViewWindow *svw =
dynamic_cast<QxScene_ViewWindow*
>(viewWindow);
71 QObject::disconnect(svw->toolMgr()->action(QxScene_ViewWindow::FitAllId),
72 SIGNAL(triggered(
bool)),
73 svw, SLOT(onViewFitAll()));
74 QObject::connect(svw->toolMgr()->action(QxScene_ViewWindow::FitAllId),
75 SIGNAL(triggered(
bool)),
76 wgv, SLOT(onViewFitAll()));
78 QObject::disconnect(svw->toolMgr()->action(QxScene_ViewWindow::FitRectId),
79 SIGNAL(triggered(
bool)),
80 svw, SLOT(onViewFitArea()));
81 QObject::connect(svw->toolMgr()->action(QxScene_ViewWindow::FitRectId),
82 SIGNAL(triggered(
bool)),
83 wgv, SLOT(onViewFitArea()));
85 QObject::disconnect(svw->toolMgr()->action(QxScene_ViewWindow::ZoomId),
86 SIGNAL(triggered(
bool)),
87 svw, SLOT(onViewZoom()));
88 QObject::connect(svw->toolMgr()->action(QxScene_ViewWindow::ZoomId),
89 SIGNAL(triggered(
bool)),
90 wgv, SLOT(onViewZoom()));
92 QObject::disconnect(svw->toolMgr()->action(QxScene_ViewWindow::PanId),
93 SIGNAL(triggered(
bool)),
94 svw, SLOT(onViewPan()));
95 QObject::connect(svw->toolMgr()->action(QxScene_ViewWindow::PanId),
96 SIGNAL(triggered(
bool)),
97 wgv, SLOT(onViewPan()));
99 QObject::disconnect(svw->toolMgr()->action(QxScene_ViewWindow::GlobalPanId),
100 SIGNAL(triggered(
bool)),
101 svw, SLOT(onViewGlobalPan()));
102 QObject::connect(svw->toolMgr()->action(QxScene_ViewWindow::GlobalPanId),
103 SIGNAL(triggered(
bool)),
104 wgv, SLOT(onViewGlobalPan()));
106 QObject::disconnect(svw->toolMgr()->action(QxScene_ViewWindow::ResetId),
107 SIGNAL(triggered(
bool)),
108 svw, SLOT(onViewReset()));
109 QObject::connect(svw->toolMgr()->action(QxScene_ViewWindow::ResetId),
110 SIGNAL(triggered(
bool)),
111 wgv, SLOT(onViewReset()));
121 const QString& toolTip,
124 const QString& status,
132 return module->
wCreateAction(
id, toolTip, icon, menu, status, shortCut,
133 parent, checkable, receiver, member);
137 const int parentMenuId,
143 return module->
wCreateMenu(subMenu, parentMenuId, menuId, groupId, index);
147 const QString& parentMenu,
153 return module->
wCreateMenu(subMenu, parentMenu, menuId, groupId, index);
162 return module->
wCreateMenu(actionId, menuId, groupId, index);
171 return module->
wCreateMenu(actionId, menu, groupId, index);
181 return module->
wCreateMenu(action, menuId, actionId, groupId, index);
191 return module->
wCreateMenu(action, menu, actionId, groupId, index);
205 return module->
wCreateTool(actionId, toolbarId, index);
209 const QString& toolbar,
213 return module->
wCreateTool(actionId, toolbar, index);
222 return module->
wCreateTool(action, toolbarId, actionId, index);
226 const QString& toolbar,
231 return module->
wCreateTool(action, toolbar, actionId, index);
242 module->setMenuShown(act, show);
248 module->setToolShown(act, show);
259 const QString& newName,
273 const QString& runName,
284 SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
286 dirList = resMgr->stringValue(
"FileDlg",
"QuickDirList" ).split(
';', QString::SkipEmptyParts );
292 LightApp_Application*
app = (LightApp_Application*)( SUIT_Session::session()->activeApplication() );
294 app->onHelpContextModule( theComponentName, theFileName, theContext );
#define YASSERT(val)
YASSERT macro is always defined, used like assert, but throw a YACS::Exception instead of abort.
virtual void createNewSchema(const QString &schemaName, QWidget *viewWindow)
virtual bool renameSchema(const QString &oldName, const QString &newName, QWidget *viewWindow)
virtual void createNewRun(const QString &schemaName, const QString &runName, QWidget *refWindow, QWidget *viewWindow)
virtual bool deleteSchema(QWidget *viewWindow)
SalomeWrap_DataModel * getDataModel()
int wCreateMenu(const QString &subMenu, const int parentMenuId, const int menuId=-1, const int groupId=-1, const int index=-1)
QxScene_ViewWindow * getNewWindow(QGraphicsScene *scene)
static QAction * wSeparator()
QAction * wCreateAction(const int id, const QString &toolTip, const QIcon &icon, const QString &menu, const QString &status, const int shortCut, QObject *parent=0, bool checkable=false, QObject *receiver=0, const char *member=0)
QDockWidget * objectBrowser()
int wCreateTool(const QString &title, const QString &name=QString())
void AssociateViewToWindow(QGraphicsView *gView, QxScene_ViewWindow *viewWindow)
void AssociateViewToWindow(QGraphicsView *gView, QWidget *viewWindow)
void createNewRun(const QString &schemaName, const QString &runName, QWidget *refWindow, QWidget *viewWindow)
bool deleteSchema(QWidget *viewWindow)
QAction * createAction(const int id, const QString &toolTip, const QIcon &icon, const QString &menu, const QString &status, const int shortCut, QObject *parent=0, bool checkable=false, QObject *receiver=0, const char *member=0)
int createMenu(const QString &subMenu, const int parentMenuId, const int menuId=-1, const int groupId=-1, const int index=-1)
virtual void onHelpContextModule(const QString &, const QString &, const QString &=QString())
void setMenuShown(QAction *act, bool show)
QDockWidget * objectBrowser()
QWidget * getNewWindow(QGraphicsScene *scene)
static QAction * separator()
void createNewSchema(const QString &schemaName, QWidget *viewWindow)
int createTool(const QString &title, const QString &name=QString())
bool renameSchema(const QString &oldName, const QString &newName, QWidget *viewWindow)
QStringList getQuickDirList()
void setToolShown(QAction *act, bool show)