From: ouv Date: Fri, 14 May 2010 08:20:31 +0000 (+0000) Subject: Additional fix for issue 0020613: EDF 1106 : Modify Node Marker in SMESH and VISU X-Git-Tag: V5_1_4rc2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=146ccd682dac563dcfedd51f4f2a1c65d803ca1c;p=modules%2Fgui.git Additional fix for issue 0020613: EDF 1106 : Modify Node Marker in SMESH and VISU --- diff --git a/src/VTKViewer/VTKViewer_MarkerDlg.cxx b/src/VTKViewer/VTKViewer_MarkerDlg.cxx index baa4a1fda..5484bad62 100644 --- a/src/VTKViewer/VTKViewer_MarkerDlg.cxx +++ b/src/VTKViewer/VTKViewer_MarkerDlg.cxx @@ -20,8 +20,14 @@ #include "VTKViewer_MarkerDlg.h" #include "VTKViewer_MarkerWidget.h" +#include +#include +#include +#include + #include #include +#include /*! * Class : VTKViewer_MarkerDlg @@ -42,6 +48,8 @@ VTKViewer_MarkerDlg::VTKViewer_MarkerDlg( QWidget* theParent ) aTopLayout->setSpacing( 0 ); aTopLayout->setMargin( 0 ); aTopLayout->addWidget( myMarkerWidget ); + + connect( this, SIGNAL( dlgHelp() ), this, SLOT( onHelp() ) ); } /*! @@ -51,6 +59,48 @@ VTKViewer_MarkerDlg::~VTKViewer_MarkerDlg() { } +void VTKViewer_MarkerDlg::setHelpData( const QString& theModuleName, + const QString& theHelpFileName ) +{ + myModuleName = theModuleName; + myHelpFileName = theHelpFileName; +} + +void VTKViewer_MarkerDlg::keyPressEvent( QKeyEvent* e ) +{ + QtxDialog::keyPressEvent( e ); + if ( e->isAccepted() ) + return; + + if ( e->key() == Qt::Key_F1 ) { + e->accept(); + onHelp(); + } +} + +void VTKViewer_MarkerDlg::onHelp() +{ + if( myModuleName.isNull() || myHelpFileName.isNull() ) + return; + + SUIT_Application* app = SUIT_Session::session()->activeApplication(); + if (app) + app->onHelpContextModule(myModuleName, myHelpFileName); + else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif + SUIT_MessageBox::warning(this, tr("WRN_WARNING"), + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); + } +} + void VTKViewer_MarkerDlg::setCustomMarkerMap( VTK::MarkerMap theMarkerMap ) { myMarkerWidget->setCustomMarkerMap( theMarkerMap ); diff --git a/src/VTKViewer/VTKViewer_MarkerDlg.h b/src/VTKViewer/VTKViewer_MarkerDlg.h index 8cbe935e6..7e40c6131 100644 --- a/src/VTKViewer/VTKViewer_MarkerDlg.h +++ b/src/VTKViewer/VTKViewer_MarkerDlg.h @@ -39,6 +39,9 @@ public: VTKViewer_MarkerDlg( QWidget* = 0 ); virtual ~VTKViewer_MarkerDlg(); + void setHelpData( const QString& theModuleName, + const QString& theHelpFileName ); + void setCustomMarkerMap( VTK::MarkerMap ); VTK::MarkerMap getCustomMarkerMap(); @@ -48,8 +51,17 @@ public: VTK::MarkerScale getStandardMarkerScale() const; int getCustomMarkerID() const; +protected: + void keyPressEvent( QKeyEvent* ); + +private slots: + void onHelp(); + private: VTKViewer_MarkerWidget* myMarkerWidget; + + QString myModuleName; + QString myHelpFileName; }; #endif