From 59237058431fe5ed487edf337bba858fbe8508c9 Mon Sep 17 00:00:00 2001 From: mkr Date: Tue, 22 Nov 2005 15:00:48 +0000 Subject: [PATCH] Fix for bug IPAL10387 : Supervisor viewer has no "View Operations" toolbar. --- src/SUPERVGraph/Makefile.in | 9 +++- src/SUPERVGraph/SUPERVGraph_ViewFrame.cxx | 40 ++++++++++++++++++ src/SUPERVGraph/SUPERVGraph_ViewFrame.h | 14 +++++- .../resources/SUPERVGraph_images.po | 11 +++++ .../resources/SUPERVGraph_msg_en.po | 19 +++++++++ src/SUPERVGraph/resources/view_pan.png | Bin 0 -> 545 bytes src/SUPERVGraph/resources/view_reset.png | Bin 0 -> 477 bytes src/SalomeApp/resources/SalomeApp.xml | 1 + 8 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 src/SUPERVGraph/resources/SUPERVGraph_images.po create mode 100644 src/SUPERVGraph/resources/SUPERVGraph_msg_en.po create mode 100644 src/SUPERVGraph/resources/view_pan.png create mode 100644 src/SUPERVGraph/resources/view_reset.png diff --git a/src/SUPERVGraph/Makefile.in b/src/SUPERVGraph/Makefile.in index 6c6b88452..149feb93f 100755 --- a/src/SUPERVGraph/Makefile.in +++ b/src/SUPERVGraph/Makefile.in @@ -2,7 +2,7 @@ top_srcdir=@top_srcdir@ top_builddir=../.. srcdir=@srcdir@ -VPATH=.:@srcdir@:@top_srcdir@/idl +VPATH=.:@srcdir@:@top_srcdir@/idl:@srcdir@/resources @COMMENCE@ @@ -12,6 +12,10 @@ EXPORT_HEADERS = SUPERVGraph_ViewFrame.h \ SUPERVGraph_ViewModel.h \ SUPERVGraph.h +# .po files to transmit in .qm +PO_FILES = SUPERVGraph_images.po \ + SUPERVGraph_msg_en.po + # Libraries targets LIB = libSUPERVGraph.la @@ -25,6 +29,9 @@ LIB_MOC = SUPERVGraph_moc.cxx \ SUPERVGraph_ViewManager_moc.cxx \ SUPERVGraph_ViewModel_moc.cxx +RESOURCES_FILES = view_pan.png \ + view_reset.png + LIB_CLIENT_IDL = CPPFLAGS+=$(QT_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) $(BOOST_CPPFLAGS) -I${KERNEL_ROOT_DIR}/include/salome diff --git a/src/SUPERVGraph/SUPERVGraph_ViewFrame.cxx b/src/SUPERVGraph/SUPERVGraph_ViewFrame.cxx index 297be488d..1a8362daa 100755 --- a/src/SUPERVGraph/SUPERVGraph_ViewFrame.cxx +++ b/src/SUPERVGraph/SUPERVGraph_ViewFrame.cxx @@ -28,6 +28,9 @@ #include "SUPERVGraph_ViewFrame.h" +#include +#include + //QT Include #include #include @@ -77,6 +80,43 @@ SUPERVGraph_ViewFrame::SUPERVGraph_ViewFrame( SUIT_Desktop* theDesktop ) int G = QAD_CONFIG->getSetting("SUPERVGraph:BackgroundColorGreen").toInt(); int B = QAD_CONFIG->getSetting("SUPERVGraph:BackgroundColorBlue").toInt(); setBackgroundColor(QColor(R,G,B));*/ + + myToolBar = new QToolBar(this); + myToolBar->setCloseMode(QDockWindow::Undocked); + myToolBar->setLabel(tr("LBL_TOOLBAR_LABEL")); + createActions(); + createToolBar(); +} + +void SUPERVGraph_ViewFrame::createActions() +{ + if (!myActionsMap.isEmpty()) return; + SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr(); + QAction* aAction; + + // Panning + aAction = new QAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "SUPERVGraph", tr( "ICON_SUPERVGraph_PAN" ) ), + tr( "MNU_PAN_VIEW" ), 0, this); + aAction->setStatusTip(tr("DSC_PAN_VIEW")); + connect(aAction, SIGNAL(activated()), this, SLOT(onViewPan())); + myActionsMap[ PanId ] = aAction; + + // Reset + aAction = new QAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "SUPERVGraph", tr( "ICON_SUPERVGraph_RESET" ) ), + tr( "MNU_RESET_VIEW" ), 0, this); + aAction->setStatusTip(tr("DSC_RESET_VIEW")); + connect(aAction, SIGNAL(activated()), this, SLOT(onViewReset())); + myActionsMap[ ResetId ] = aAction; +} + +//================================================================ +// Function : createToolBar +// Purpose : +//================================================================ +void SUPERVGraph_ViewFrame::createToolBar() +{ + myActionsMap[PanId]->addTo(myToolBar); + myActionsMap[ResetId]->addTo(myToolBar); } SUPERVGraph_ViewFrame::~SUPERVGraph_ViewFrame() {} diff --git a/src/SUPERVGraph/SUPERVGraph_ViewFrame.h b/src/SUPERVGraph/SUPERVGraph_ViewFrame.h index ea0bf5629..985c57085 100755 --- a/src/SUPERVGraph/SUPERVGraph_ViewFrame.h +++ b/src/SUPERVGraph/SUPERVGraph_ViewFrame.h @@ -35,6 +35,8 @@ #include "SUIT_PopupClient.h" #include "SUIT_ViewWindow.h" +#include + class SUPERVGRAPH_EXPORT SUPERVGraph_View: public QWidget, public SUIT_PopupClient { Q_OBJECT; public: @@ -109,9 +111,19 @@ class SUPERVGRAPH_EXPORT SUPERVGraph_ViewFrame : public SUIT_ViewWindow { void onViewTrihedron(); protected: - void resizeEvent( QResizeEvent* theEvent ); + void resizeEvent( QResizeEvent* theEvent ); private: + void createActions(); + void createToolBar(); + + //! Actions ID + enum { PanId, ResetId }; + typedef QMap ActionsMap; + + ActionsMap myActionsMap; + QToolBar* myToolBar; + SUPERVGraph_View* myView; }; #endif diff --git a/src/SUPERVGraph/resources/SUPERVGraph_images.po b/src/SUPERVGraph/resources/SUPERVGraph_images.po new file mode 100644 index 000000000..3b41ded0f --- /dev/null +++ b/src/SUPERVGraph/resources/SUPERVGraph_images.po @@ -0,0 +1,11 @@ +// File: SUPERVGraph_images.po +// Created: 11/22/2005 10:52:37 PM +// Author: Margarita Karpunina +// Copyright (C) CEA 2005 + +msgid "ICON_SUPERVGraph_PAN" +msgstr "view_pan.png" + +msgid "ICON_SUPERVGraph_RESET" +msgstr "view_reset.png" + diff --git a/src/SUPERVGraph/resources/SUPERVGraph_msg_en.po b/src/SUPERVGraph/resources/SUPERVGraph_msg_en.po new file mode 100644 index 000000000..b9ac39b42 --- /dev/null +++ b/src/SUPERVGraph/resources/SUPERVGraph_msg_en.po @@ -0,0 +1,19 @@ +// File: SUPERVGraph_msg_en.po +// Created: 11/22/2005 10:55:36 PM +// Author: Margarita Karpunina +// Copyright (C) CEA 2005 + +msgid "LBL_TOOLBAR_LABEL" +msgstr "View Operations" + +msgid "DSC_RESET_VIEW" +msgstr "Reset View Point" + +msgid "MNU_RESET_VIEW" +msgstr "Reset" + +msgid "DSC_PAN_VIEW" +msgstr "Panning the view" + +msgid "MNU_PAN_VIEW" +msgstr "Panning" diff --git a/src/SUPERVGraph/resources/view_pan.png b/src/SUPERVGraph/resources/view_pan.png new file mode 100644 index 0000000000000000000000000000000000000000..038fba118736ff3732a97e0e62ea4420022560ff GIT binary patch literal 545 zcmV++0^a?JP)BjE7>1uK9zKDF6S$E4l!kVRaE6$4Xf~VvvDRH$!HE9XPz1Z$vi!vUUz@DL`3!kYtP=iy&zkp=%%I{0NeTtoDI(ah_7On-TAd!lpGY-d%JO%@!%DiVZEgRb(KYiRlo=qu7Yl1y{SK zy}w&x41D=K^XYHt6@$N+u9!KPU5bdHI#2_85YZsxw7e`anCfhV=`LxAq-=b5A) z8p7SrJ6^nc$^5E9RS^+J!!ZE!s|v{k5lH~{GC}}jqVGzFEiA9!zM;Hykby01dWF@z zVl*7{^>hZn^y3s)IslrwA(tE}B)x~K+WC8S4}hb06GVi(h%m{7EENb*ZV1x|dmrD8 zhGWX_uIpiPg_ENR)x6^3>>Oi=eFHAe&S~lf-9!axJ^Vwa`{r2tbtilO`F^_O#g7HP z_B3_F@rPq(UuLZR8Xyit3~h zU1AGWRdk~rSVXXe?Q(Vk%S(q84?pNv-1`04&K|DrR}2`SnLdjBen4wG*G5%obh{EM z)&bigv~oXvK1qi3?SbT*>jmC>R`)9)-YB``NGAUW6cMBl1`KF)`@^?8mSVpEcL1+S TU5X{h00000NkvXXu0mjf?E%y8 literal 0 HcmV?d00001 diff --git a/src/SalomeApp/resources/SalomeApp.xml b/src/SalomeApp/resources/SalomeApp.xml index 9e5af471f..3597a8e21 100644 --- a/src/SalomeApp/resources/SalomeApp.xml +++ b/src/SalomeApp/resources/SalomeApp.xml @@ -38,6 +38,7 @@ + -- 2.39.2