From 3448308f5e905a2dac8963fe86a8a54b4fc25f09 Mon Sep 17 00:00:00 2001 From: mkr Date: Tue, 28 Mar 2006 07:43:56 +0000 Subject: [PATCH] Add references into VISU dialogs to the corresponding help page from GUI documentation. --- src/GUITOOLS/VisuGUI_TableDlg.cxx | 26 +++++++++- src/GUITOOLS/VisuGUI_TableDlg.h | 2 + src/VISUGUI/VISU_msg_en.po | 3 ++ src/VISUGUI/VisuGUI_BuildProgressDlg.cxx | 25 ++++++++++ src/VISUGUI/VisuGUI_BuildProgressDlg.h | 1 + src/VISUGUI/VisuGUI_ClippingDlg.cxx | 24 ++++++++++ src/VISUGUI/VisuGUI_ClippingDlg.h | 2 + src/VISUGUI/VisuGUI_CursorDlg.cxx | 34 +++++++++++++ src/VISUGUI/VisuGUI_CursorDlg.h | 5 ++ src/VISUGUI/VisuGUI_CutLinesDlg.cxx | 25 +++++++++- src/VISUGUI/VisuGUI_CutLinesDlg.h | 1 + src/VISUGUI/VisuGUI_CutPlanesDlg.cxx | 26 +++++++++- src/VISUGUI/VisuGUI_CutPlanesDlg.h | 1 + src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx | 26 ++++++++++ src/VISUGUI/VisuGUI_DeformedShapeDlg.h | 1 + src/VISUGUI/VisuGUI_EditContainerDlg.cxx | 22 +++++++++ src/VISUGUI/VisuGUI_EditContainerDlg.h | 1 + src/VISUGUI/VisuGUI_GaussPointsDlg.cxx | 21 +++++++- src/VISUGUI/VisuGUI_GaussPointsDlg.h | 1 + src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx | 24 +++++++++- src/VISUGUI/VisuGUI_IsoSurfacesDlg.h | 1 + src/VISUGUI/VisuGUI_NameDlg.cxx | 27 +++++++++++ src/VISUGUI/VisuGUI_NameDlg.h | 2 + src/VISUGUI/VisuGUI_OffsetDlg.cxx | 24 ++++++++++ src/VISUGUI/VisuGUI_OffsetDlg.h | 1 + src/VISUGUI/VisuGUI_Plot3DDlg.cxx | 28 +++++++++++ src/VISUGUI/VisuGUI_Plot3DDlg.h | 1 + src/VISUGUI/VisuGUI_ScalarBarDlg.cxx | 48 ++++++++++++++++++- src/VISUGUI/VisuGUI_ScalarBarDlg.h | 2 + .../VisuGUI_ScalarMapOnDeformedShapeDlg.cxx | 23 +++++++++ .../VisuGUI_ScalarMapOnDeformedShapeDlg.h | 1 + src/VISUGUI/VisuGUI_Selection.cxx | 19 ++++++++ src/VISUGUI/VisuGUI_Selection.h | 1 + src/VISUGUI/VisuGUI_SetupPlot2dDlg.cxx | 31 +++++++++++- src/VISUGUI/VisuGUI_SetupPlot2dDlg.h | 2 + src/VISUGUI/VisuGUI_StreamLinesDlg.cxx | 22 +++++++++ src/VISUGUI/VisuGUI_StreamLinesDlg.h | 1 + src/VISUGUI/VisuGUI_TimeAnimation.cxx | 22 ++++++++- src/VISUGUI/VisuGUI_TimeAnimation.h | 1 + src/VISUGUI/VisuGUI_TransparencyDlg.cxx | 36 ++++++++++++-- src/VISUGUI/VisuGUI_TransparencyDlg.h | 2 + src/VISUGUI/VisuGUI_VectorsDlg.cxx | 26 +++++++++- src/VISUGUI/VisuGUI_VectorsDlg.h | 2 + src/VVTK/VVTK_PickingDlg.cxx | 22 +++++++++ src/VVTK/VVTK_PickingDlg.h | 1 + src/VVTK/VVTK_RecorderDlg.cxx | 22 +++++++++ src/VVTK/VVTK_RecorderDlg.h | 1 + src/VVTK/VVTK_SegmentationCursorDlg.cxx | 20 ++++++++ src/VVTK/VVTK_SegmentationCursorDlg.h | 1 + 49 files changed, 648 insertions(+), 13 deletions(-) diff --git a/src/GUITOOLS/VisuGUI_TableDlg.cxx b/src/GUITOOLS/VisuGUI_TableDlg.cxx index 24443ef7..3ff5726a 100644 --- a/src/GUITOOLS/VisuGUI_TableDlg.cxx +++ b/src/GUITOOLS/VisuGUI_TableDlg.cxx @@ -12,6 +12,10 @@ #include "SUIT_Tools.h" #include "SUIT_MessageBox.h" +#include "SUIT_ResourceMgr.h" +#include "SUIT_Session.h" + +#include "LightApp_Application.h" #include "SALOMEDSClient_Study.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" @@ -130,20 +134,23 @@ VisuGUI_TableDlg::VisuGUI_TableDlg( QWidget* parent, btnLayout->setMargin( 0 ); btnLayout->setSpacing( SPACING_SIZE ); myOKBtn = new QPushButton( tr( "BUT_OK" ), this ); + myHelpBtn = new QPushButton( tr( "BUT_HELP" ), this ); if ( edit ) { myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), this ); btnLayout->addWidget( myOKBtn ); btnLayout->addItem( new QSpacerItem( SPACER_SIZE, SPACER_SIZE, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); btnLayout->addWidget( myCancelBtn ); + btnLayout->addWidget( myHelpBtn ); connect( myOKBtn, SIGNAL( clicked() ), this, SLOT( onOK() ) ); connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) ); } else { - btnLayout->addItem( new QSpacerItem( SPACER_SIZE, SPACER_SIZE, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); btnLayout->addWidget( myOKBtn ); btnLayout->addItem( new QSpacerItem( SPACER_SIZE, SPACER_SIZE, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); + btnLayout->addWidget( myHelpBtn ); connect( myOKBtn, SIGNAL( clicked() ), this, SLOT( accept() ) ); } + connect( myHelpBtn, SIGNAL( clicked() ), this, SLOT( onHelp() ) ); mainLayout->addWidget( top ); mainLayout->addLayout( btnLayout ); @@ -283,6 +290,23 @@ void VisuGUI_TableDlg::onOK() accept(); } +/*! + button slot, shows corresponding help page +*/ +void VisuGUI_TableDlg::onHelp() +{ + QString aHelpFileName = "/files/displaying_tables.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} + /*! Populates table with data */ diff --git a/src/GUITOOLS/VisuGUI_TableDlg.h b/src/GUITOOLS/VisuGUI_TableDlg.h index 82481f9e..5d98a002 100644 --- a/src/GUITOOLS/VisuGUI_TableDlg.h +++ b/src/GUITOOLS/VisuGUI_TableDlg.h @@ -38,6 +38,7 @@ public: public slots: void onOK(); + void onHelp(); private: void initDlg(); @@ -47,6 +48,7 @@ private: VisuGUI_TableWidget* myRealTable; QPushButton* myOKBtn; QPushButton* myCancelBtn; + QPushButton* myHelpBtn; _PTR(SObject) myObject; }; diff --git a/src/VISUGUI/VISU_msg_en.po b/src/VISUGUI/VISU_msg_en.po index 3a569991..3bf41a43 100644 --- a/src/VISUGUI/VISU_msg_en.po +++ b/src/VISUGUI/VISU_msg_en.po @@ -1620,6 +1620,9 @@ msgstr "Start" msgid "VisuGUI_BuildProgressDlg::CLOSE" msgstr "Close" +msgid "VisuGUI_BuildProgressDlg::HELP" +msgstr "Help" + msgid "VisuGUI_BuildProgressDlg::ERR_ERROR_IN_THE_FILE" msgstr "Error in the file" diff --git a/src/VISUGUI/VisuGUI_BuildProgressDlg.cxx b/src/VISUGUI/VisuGUI_BuildProgressDlg.cxx index 58f5180a..fc6b9f18 100644 --- a/src/VISUGUI/VisuGUI_BuildProgressDlg.cxx +++ b/src/VISUGUI/VisuGUI_BuildProgressDlg.cxx @@ -27,12 +27,16 @@ #include "VisuGUI_BuildProgressDlg.h" +#include "VisuGUI.h" #include "VisuGUI_Tools.h" #include "SUIT_FileDlg.h" +#include "SUIT_Session.h" #include "SUIT_MessageBox.h" #include "SUIT_ResourceMgr.h" +#include "LightApp_Application.h" + #include #include @@ -192,8 +196,13 @@ VisuGUI_BuildProgressDlg::VisuGUI_BuildProgressDlg( QWidget* theParent ): aCloseButton->setAutoDefault( true ); CommonGroupLayout->addWidget( aCloseButton, 0, 2 ); + QPushButton* aHelpButton = new QPushButton( tr( "HELP" ), CommonGroup ); + aHelpButton->setAutoDefault( true ); + CommonGroupLayout->addWidget( aHelpButton, 0, 3 ); + connect( myStartButton, SIGNAL( clicked() ), this, SLOT( onStart() ) ); connect( aCloseButton, SIGNAL( clicked() ), this, SLOT( onClose() ) ); + connect( aHelpButton, SIGNAL( clicked() ), this, SLOT( onHelp() ) ); myTimer = new QTimer( this ); connect( myTimer, SIGNAL( timeout() ), this, SLOT( onTimer() ) ); @@ -250,6 +259,22 @@ void VisuGUI_BuildProgressDlg::onClose() done( 0 ); } +void VisuGUI_BuildProgressDlg::onHelp() +{ + QString aHelpFileName = "/files/importing_med_objects.htm"; // ? + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + VisuGUI* aVisuGUI = dynamic_cast( app->activeModule() ); + app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); + } + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} + bool VisuGUI_BuildProgressDlg::onBrowseFile() { QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ); diff --git a/src/VISUGUI/VisuGUI_BuildProgressDlg.h b/src/VISUGUI/VisuGUI_BuildProgressDlg.h index aaabf442..eed85b22 100644 --- a/src/VISUGUI/VisuGUI_BuildProgressDlg.h +++ b/src/VISUGUI/VisuGUI_BuildProgressDlg.h @@ -61,6 +61,7 @@ protected slots: void onStart(); void onClose(); + void onHelp(); bool onBrowseFile(); void onTimer(); diff --git a/src/VISUGUI/VisuGUI_ClippingDlg.cxx b/src/VISUGUI/VisuGUI_ClippingDlg.cxx index 7efe4905..c2d918bd 100644 --- a/src/VISUGUI/VisuGUI_ClippingDlg.cxx +++ b/src/VISUGUI/VisuGUI_ClippingDlg.cxx @@ -30,6 +30,7 @@ #include "VISU_PipeLine.hxx" #include "LightApp_SelectionMgr.h" +#include "LightApp_Application.h" #include "SVTK_ViewWindow.h" @@ -320,6 +321,10 @@ VisuGUI_ClippingDlg::VisuGUI_ClippingDlg (VisuGUI* theModule, GroupButtonsLayout->setAlignment(Qt::AlignTop); GroupButtonsLayout->setSpacing(6); GroupButtonsLayout->setMargin(11); + buttonHelp = new QPushButton (GroupButtons, "buttonHelp"); + buttonHelp->setText(tr("BUT_HELP")); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 4); buttonCancel = new QPushButton (GroupButtons, "buttonCancel"); buttonCancel->setText(tr("BUT_CLOSE")); buttonCancel->setAutoDefault(TRUE); @@ -376,6 +381,7 @@ VisuGUI_ClippingDlg::VisuGUI_ClippingDlg (VisuGUI* theModule, connect(buttonOk , SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonApply , SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); + connect(buttonHelp , SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionChanged())); @@ -564,6 +570,24 @@ void VisuGUI_ClippingDlg::ClickOnCancel() close(); } +//================================================================================= +// function : ClickOnHelp() +// purpose : +//================================================================================= +void VisuGUI_ClippingDlg::ClickOnHelp() +{ + QString aHelpFileName = "clipping.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(myVisuGUI ? app->moduleName(myVisuGUI->moduleName()) : QString(""), aHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} + //================================================================================= // function : onSelectionChanged() // purpose : Called when selection is changed diff --git a/src/VISUGUI/VisuGUI_ClippingDlg.h b/src/VISUGUI/VisuGUI_ClippingDlg.h index 0a2b61b6..7fe98099 100644 --- a/src/VISUGUI/VisuGUI_ClippingDlg.h +++ b/src/VISUGUI/VisuGUI_ClippingDlg.h @@ -122,6 +122,7 @@ private: QPushButton* buttonOk; QPushButton* buttonCancel; QPushButton* buttonApply; + QPushButton* buttonHelp; bool myIsSelectPlane; @@ -146,6 +147,7 @@ public slots: void ClickOnOk(); void ClickOnCancel(); void ClickOnApply(); + void ClickOnHelp(); }; #endif // DIALOGBOX_TRANSPARENCYDLG_H diff --git a/src/VISUGUI/VisuGUI_CursorDlg.cxx b/src/VISUGUI/VisuGUI_CursorDlg.cxx index e1adefcf..8fb21497 100644 --- a/src/VISUGUI/VisuGUI_CursorDlg.cxx +++ b/src/VISUGUI/VisuGUI_CursorDlg.cxx @@ -27,7 +27,16 @@ // $Header$ using namespace std; + +#include "VisuGUI.h" #include "VisuGUI_CursorDlg.h" + +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" +#include "SUIT_ResourceMgr.h" + +#include "LightApp_Application.h" + #include /*! @@ -93,12 +102,17 @@ VisuGUI_CursorDlg::VisuGUI_CursorDlg( QWidget* parent, const char* name, bool m buttonCancel->setAutoDefault(TRUE); GroupButtonsLayout->addWidget(buttonCancel, 0, 2); + buttonHelp = new QPushButton(tr("&Help") , GroupButtons, "buttonHelp"); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 3); + TopLayout->addWidget(TopGroupBox, 0, 0); TopLayout->addWidget(GroupButtons, 1, 0); // signals and slots connections connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onHelp() ) ); } /*! @@ -107,3 +121,23 @@ VisuGUI_CursorDlg::VisuGUI_CursorDlg( QWidget* parent, const char* name, bool m VisuGUI_CursorDlg::~VisuGUI_CursorDlg() { } + +/*! + function : onHelp() + purpose : +*/ +void VisuGUI_CursorDlg::onHelp() +{ + QString aHelpFileName = "/files/changing_visualization_parameters_of_the_presenetation.htm#Width"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + VisuGUI* aVisuGUI = dynamic_cast( app->activeModule() ); + app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); + } + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} diff --git a/src/VISUGUI/VisuGUI_CursorDlg.h b/src/VISUGUI/VisuGUI_CursorDlg.h index 018709cf..f3afd0da 100644 --- a/src/VISUGUI/VisuGUI_CursorDlg.h +++ b/src/VISUGUI/VisuGUI_CursorDlg.h @@ -50,6 +50,11 @@ public: QGroupBox* GroupButtons; QPushButton* buttonOk; QPushButton* buttonCancel; + QPushButton* buttonHelp; + +private slots: + void onHelp(); + }; #endif // VISUGUI_CURSORDLG_H diff --git a/src/VISUGUI/VisuGUI_CutLinesDlg.cxx b/src/VISUGUI/VisuGUI_CutLinesDlg.cxx index 545e8c81..bdfe873e 100644 --- a/src/VISUGUI/VisuGUI_CutLinesDlg.cxx +++ b/src/VISUGUI/VisuGUI_CutLinesDlg.cxx @@ -23,10 +23,13 @@ #include "SVTK_ViewWindow.h" -#include "SalomeApp_Application.h" +#include "LightApp_Application.h" #include "SalomeApp_Study.h" #include "SUIT_Desktop.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" +#include "SUIT_ResourceMgr.h" #include "OB_Browser.h" @@ -220,6 +223,9 @@ VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule) QPushButton* aCloseBtn = new QPushButton(tr("BUT_CANCEL"), aBtnBox); aBtnLayout->addWidget(aCloseBtn); + QPushButton* aHelpBtn = new QPushButton(tr("BUT_HELP"), aBtnBox); + aBtnLayout->addWidget(aHelpBtn); + aMainLayout->addWidget(aBtnBox); myCutLines = NULL; @@ -244,6 +250,7 @@ VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule) connect(aOkBtn, SIGNAL(clicked()), this, SLOT(accept())); connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(reject())); + connect(aHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp())); //connect(myMgr, SIGNAL(closeAllViews()), this, SLOT(reject())); //connect(VisuGUI::application()->desktop(), // SIGNAL(windowActivated(SUIT_ViewWindow*)), @@ -885,6 +892,22 @@ void VisuGUI_CutLinesDlg::onPlanePos (const QString& theValue) } } +void VisuGUI_CutLinesDlg::onHelp() +{ + QString aHelpFileName = "/files/cut_lines_presentation.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + VisuGUI* aVisuGUI = dynamic_cast( app->activeModule() ); + app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); + } + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} + //jfa tmp:void VisuGUI_CutLinesDlg::onWindowActivated (SUIT_ViewWindow* theWnd) //jfa tmp:{ //jfa tmp: if (theWnd != myStudyWnd) diff --git a/src/VISUGUI/VisuGUI_CutLinesDlg.h b/src/VISUGUI/VisuGUI_CutLinesDlg.h index f196660e..8a74804e 100644 --- a/src/VISUGUI/VisuGUI_CutLinesDlg.h +++ b/src/VISUGUI/VisuGUI_CutLinesDlg.h @@ -52,6 +52,7 @@ private slots: void onAllCurvesInvertedCheck(bool theInvert); void onRotation (double theValue); void onPlanePos (const QString& theValue); + void onHelp(); //jfa tmp:void onWindowActivated (SUIT_ViewWindow*); private: diff --git a/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx b/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx index 486a475d..3d6989a5 100644 --- a/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx +++ b/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx @@ -39,12 +39,15 @@ #include "SVTK_ViewWindow.h" -#include "SalomeApp_Application.h" +#include "LightApp_Application.h" #include "SUIT_Application.h" #include "SUIT_Desktop.h" #include "SUIT_ViewWindow.h" #include "SUIT_ViewManager.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" +#include "SUIT_ResourceMgr.h" #include #include @@ -500,10 +503,15 @@ VisuGUI_CutPlanesDlg::VisuGUI_CutPlanesDlg (SalomeApp_Module* theModule) buttonCancel->setAutoDefault(TRUE); GroupButtonsLayout->addWidget(buttonCancel, 0, 2); + QPushButton* buttonHelp = new QPushButton(tr("&Help"), GroupButtons, "buttonHelp"); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 3); + TopLayout->addWidget(GroupButtons); connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp())); //connect(myMgr, SIGNAL(closeAllViews()), this, SLOT(reject())); //connect(VisuGUI::application()->desktop(), // SIGNAL(windowActivated(SUIT_ViewWindow*)), @@ -541,6 +549,22 @@ void VisuGUI_CutPlanesDlg::reject() { QDialog::reject(); } +void VisuGUI_CutPlanesDlg::onHelp() +{ + QString aHelpFileName = "/files/cut_lines_resentation.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + VisuGUI* aVisuGUI = dynamic_cast( app->activeModule() ); + app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); + } + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} + //void VisuGUI_CutPlanesDlg::onWindowActivated (SUIT_ViewWindow* theWnd) //{ // if (theWnd != myStudyWnd) diff --git a/src/VISUGUI/VisuGUI_CutPlanesDlg.h b/src/VISUGUI/VisuGUI_CutPlanesDlg.h index e5ccea9f..c7b61fce 100644 --- a/src/VISUGUI/VisuGUI_CutPlanesDlg.h +++ b/src/VISUGUI/VisuGUI_CutPlanesDlg.h @@ -115,6 +115,7 @@ protected slots: void accept(); void reject(); void onWindowActivated (SUIT_ViewWindow*); + void onHelp(); private: VisuGUI_CutPlanesPane* myCutPane; diff --git a/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx b/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx index da99973c..30dd4443 100644 --- a/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx +++ b/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx @@ -28,12 +28,17 @@ #include "VisuGUI_DeformedShapeDlg.h" +#include "VisuGUI.h" #include "VisuGUI_Tools.h" #include "VISU_DeformedShape_i.hh" #include "SalomeApp_Module.h" +#include "LightApp_Application.h" #include "SUIT_Desktop.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" +#include "SUIT_ResourceMgr.h" #include #include @@ -113,6 +118,10 @@ VisuGUI_DeformedShapeDlg::VisuGUI_DeformedShapeDlg (SalomeApp_Module* theModule) buttonCancel->setAutoDefault(TRUE); GroupButtonsLayout->addWidget(buttonCancel, 0, 2); + QPushButton* buttonHelp = new QPushButton (tr("&Help") , GroupButtons, "buttonHelp"); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 3); + // Add Tab box and Buttons to the top layout TopLayout->addWidget(aTabBox); TopLayout->addWidget(GroupButtons); @@ -120,6 +129,7 @@ VisuGUI_DeformedShapeDlg::VisuGUI_DeformedShapeDlg (SalomeApp_Module* theModule) // signals and slots connections connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp())); } void VisuGUI_DeformedShapeDlg::initFromPrsObject (VISU::DeformedShape_i* thePrs) @@ -149,3 +159,19 @@ void VisuGUI_DeformedShapeDlg::reject() myScalarPane->deletePreview(); QDialog::reject(); } + +void VisuGUI_DeformedShapeDlg::onHelp() +{ + QString aHelpFileName = "/files/deformed_shape_presentation.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + VisuGUI* aVisuGUI = dynamic_cast( app->activeModule() ); + app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); + } + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} diff --git a/src/VISUGUI/VisuGUI_DeformedShapeDlg.h b/src/VISUGUI/VisuGUI_DeformedShapeDlg.h index 573c439a..5a907e9a 100644 --- a/src/VISUGUI/VisuGUI_DeformedShapeDlg.h +++ b/src/VISUGUI/VisuGUI_DeformedShapeDlg.h @@ -67,6 +67,7 @@ public: protected slots: void accept(); void reject(); + void onHelp(); private: QtxDblSpinBox* ScalFact; diff --git a/src/VISUGUI/VisuGUI_EditContainerDlg.cxx b/src/VISUGUI/VisuGUI_EditContainerDlg.cxx index eed32a53..89203f9a 100644 --- a/src/VISUGUI/VisuGUI_EditContainerDlg.cxx +++ b/src/VISUGUI/VisuGUI_EditContainerDlg.cxx @@ -18,6 +18,9 @@ #include "SalomeApp_Application.h" #include "SUIT_Desktop.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" +#include "SUIT_ResourceMgr.h" #include #include @@ -280,10 +283,15 @@ VisuGUI_EditContainerDlg::VisuGUI_EditContainerDlg (VisuGUI* theModule, bool the buttonCancel->setAutoDefault(TRUE); GroupButtonsLayout->addWidget(buttonCancel, 0, 2); + QPushButton* buttonHelp = new QPushButton(tr("&Help") , GroupButtons, "buttonHelp"); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 3); + TopLayout->addWidget(GroupButtons); connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp())); } void VisuGUI_EditContainerDlg::initFromPrsObject (VISU::Container_i* theContainer) @@ -427,3 +435,17 @@ void VisuGUI_EditContainerDlg::onRightSelected() } myLeftBtn->setEnabled(isSelected); } + +void VisuGUI_EditContainerDlg::onHelp() +{ + QString aHelpFileName = "/files/creating_xy_plot.htm"; + SalomeApp_Application* app = (SalomeApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(myVisuGUI ? app->moduleName(myVisuGUI->moduleName()) : QString(""), aHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} diff --git a/src/VISUGUI/VisuGUI_EditContainerDlg.h b/src/VISUGUI/VisuGUI_EditContainerDlg.h index 8493d0ff..7aa9034d 100644 --- a/src/VISUGUI/VisuGUI_EditContainerDlg.h +++ b/src/VISUGUI/VisuGUI_EditContainerDlg.h @@ -48,6 +48,7 @@ class VisuGUI_EditContainerDlg: public QDialog void onRightClicked(); void onLeftSelected(); void onRightSelected(); + void onHelp(); private: QString getSObjectName (_PTR(SObject) theSObject); diff --git a/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx b/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx index bfe5bb0d..dfbe850f 100644 --- a/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx +++ b/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx @@ -39,7 +39,7 @@ #include "VVTK_PrimitiveBox.h" #include "VVTK_SizeBox.h" -#include "SalomeApp_Application.h" +#include "LightApp_Application.h" #include "SalomeApp_Module.h" #include "SUIT_Desktop.h" #include "SUIT_ResourceMgr.h" @@ -594,12 +594,17 @@ VisuGUI_GaussPointsDlg::VisuGUI_GaussPointsDlg(SalomeApp_Module* theModule, bool buttonCancel->setAutoDefault( TRUE ); GroupButtonsLayout->addWidget( buttonCancel, 0, 2 ); + QPushButton* buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons, "buttonHelp" ); + buttonHelp->setAutoDefault( TRUE ); + GroupButtonsLayout->addWidget( buttonHelp, 0, 3 ); + TopLayout->addWidget( PrsGroup ); TopLayout->addWidget( aTabBox ); TopLayout->addWidget( GroupButtons ); connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onHelp() ) ); } void VisuGUI_GaussPointsDlg::initFromPrsObject( VISU::GaussPoints_i* thePrs ) @@ -731,3 +736,17 @@ void VisuGUI_GaussPointsDlg::accept() //if( myScalarPane->check() ) QDialog::accept(); } + +void VisuGUI_GaussPointsDlg::onHelp() +{ + QString aHelpFileName = "types_of_gauss_points_presentations.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} diff --git a/src/VISUGUI/VisuGUI_GaussPointsDlg.h b/src/VISUGUI/VisuGUI_GaussPointsDlg.h index c845d013..64bcc7fa 100644 --- a/src/VISUGUI/VisuGUI_GaussPointsDlg.h +++ b/src/VISUGUI/VisuGUI_GaussPointsDlg.h @@ -141,6 +141,7 @@ public: protected slots: void onToggleDefShape( bool ); + void onHelp(); void accept(); diff --git a/src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx b/src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx index 34d170b9..e80ff194 100644 --- a/src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx +++ b/src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx @@ -31,10 +31,12 @@ #include "VisuGUI.h" #include "VisuGUI_Tools.h" -#include "SalomeApp_Application.h" +#include "LightApp_Application.h" #include "SUIT_Desktop.h" +#include "SUIT_Session.h" #include "SUIT_MessageBox.h" +#include "SUIT_ResourceMgr.h" #include @@ -201,12 +203,16 @@ VisuGUI_IsoSurfacesDlg::VisuGUI_IsoSurfacesDlg (SalomeApp_Module* theModule) QPushButton* buttonCancel = new QPushButton( tr( "&Cancel" ) , GroupButtons, "buttonCancel" ); buttonCancel->setAutoDefault( TRUE ); GroupButtonsLayout->addWidget( buttonCancel, 0, 2 ); + QPushButton* buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons, "buttonHelp" ); + buttonHelp->setAutoDefault( TRUE ); + GroupButtonsLayout->addWidget( buttonHelp, 0, 3 ); TopLayout->addWidget(GroupButtons); // signals and slots connections connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onHelp() ) ); } void VisuGUI_IsoSurfacesDlg::accept() @@ -223,3 +229,19 @@ void VisuGUI_IsoSurfacesDlg::reject() myScalarPane->deletePreview(); QDialog::reject(); } + +void VisuGUI_IsoSurfacesDlg::onHelp() +{ + QString aHelpFileName = "/files/iso_surfaces_presentation.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + VisuGUI* aVisuGUI = dynamic_cast( app->activeModule() ); + app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); + } + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} diff --git a/src/VISUGUI/VisuGUI_IsoSurfacesDlg.h b/src/VISUGUI/VisuGUI_IsoSurfacesDlg.h index dc0547f1..dbe12991 100644 --- a/src/VISUGUI/VisuGUI_IsoSurfacesDlg.h +++ b/src/VISUGUI/VisuGUI_IsoSurfacesDlg.h @@ -86,6 +86,7 @@ class VisuGUI_IsoSurfacesDlg : public QDialog protected slots: void accept(); void reject(); + void onHelp(); private: VisuGUI_IsoSurfPane* myIsoPane; diff --git a/src/VISUGUI/VisuGUI_NameDlg.cxx b/src/VISUGUI/VisuGUI_NameDlg.cxx index c847861f..deecabdc 100644 --- a/src/VISUGUI/VisuGUI_NameDlg.cxx +++ b/src/VISUGUI/VisuGUI_NameDlg.cxx @@ -10,11 +10,16 @@ // $Header$ #include "VisuGUI_NameDlg.h" +#include "VisuGUI.h" #include #include #include #include +#include +#include + +#include #include #include @@ -73,6 +78,11 @@ VisuGUI_NameDlg::VisuGUI_NameDlg( QWidget* parent ) myButtonCancel->setText( tr( "BUT_CANCEL" ) ); myButtonCancel->setAutoDefault( TRUE ); GroupButtonsLayout->addWidget( myButtonCancel ); + + myButtonHelp = new QPushButton( GroupButtons, "buttonHelp" ); + myButtonHelp->setText( tr( "BUT_HELP" ) ); + myButtonHelp->setAutoDefault( TRUE ); + GroupButtonsLayout->addWidget( myButtonHelp ); /***************************************************************/ topLayout->addWidget( GroupC1 ); @@ -81,6 +91,7 @@ VisuGUI_NameDlg::VisuGUI_NameDlg( QWidget* parent ) // signals and slots connections connect( myButtonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( myButtonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( myButtonHelp, SIGNAL( clicked() ), this, SLOT( onHelp() ) ); /* Move widget on the botton right corner of main widget */ SUIT_Tools::centerWidget( this, parent ); @@ -118,6 +129,22 @@ void VisuGUI_NameDlg::accept() QDialog::accept(); } +void VisuGUI_NameDlg::onHelp() +{ + QString aHelpFileName = "/files/renaming_presentations.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + VisuGUI* aVisuGUI = dynamic_cast( app->activeModule() ); + app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); + } + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} + /*! Creates modal dialog and returns name entered [ static ] */ diff --git a/src/VISUGUI/VisuGUI_NameDlg.h b/src/VISUGUI/VisuGUI_NameDlg.h index 56a9819b..b12231db 100644 --- a/src/VISUGUI/VisuGUI_NameDlg.h +++ b/src/VISUGUI/VisuGUI_NameDlg.h @@ -36,10 +36,12 @@ public: protected slots: void accept(); + void onHelp(); private: QPushButton* myButtonOk; QPushButton* myButtonCancel; + QPushButton* myButtonHelp; QLineEdit* myLineEdit; }; diff --git a/src/VISUGUI/VisuGUI_OffsetDlg.cxx b/src/VISUGUI/VisuGUI_OffsetDlg.cxx index 3fca41a1..ed732b9c 100644 --- a/src/VISUGUI/VisuGUI_OffsetDlg.cxx +++ b/src/VISUGUI/VisuGUI_OffsetDlg.cxx @@ -26,10 +26,14 @@ #include "VISU_ViewManager_i.hh" #include "VISU_Actor.h" +#include "LightApp_Application.h" #include "SalomeApp_Application.h" #include "SVTK_ViewWindow.h" #include "SVTK_ViewModel.h" #include "SUIT_Desktop.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" +#include "SUIT_ResourceMgr.h" #include "QtxDblSpinBox.h" @@ -115,12 +119,18 @@ myModule(theModule) QPushButton* buttonCancel = new QPushButton(tr("&Cancel") , GroupButtons, "buttonCancel"); buttonCancel->setAutoDefault(TRUE); GroupButtonsLayout->addWidget(buttonCancel, 0, 4); + GroupButtonsLayout->addItem(new QSpacerItem(5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 5); + + QPushButton* buttonHelp = new QPushButton(tr("&Help") , GroupButtons, "buttonHelp"); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 6); TopLayout->addWidget(GroupButtons); connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(onApply())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp())); } void VisuGUI_OffsetDlg::addPresentation (VISU::Prs3d_i* thePrs) @@ -227,3 +237,17 @@ void VisuGUI_OffsetDlg::onApply() updateOffset(myPrsList.at(i), aOffset); } } + +void VisuGUI_OffsetDlg::onHelp() +{ + QString aHelpFileName = "/files/scaling_presentations.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(myModule ? app->moduleName(myModule->moduleName()) : QString(""), aHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} diff --git a/src/VISUGUI/VisuGUI_OffsetDlg.h b/src/VISUGUI/VisuGUI_OffsetDlg.h index b06092f9..98a0bdb0 100644 --- a/src/VISUGUI/VisuGUI_OffsetDlg.h +++ b/src/VISUGUI/VisuGUI_OffsetDlg.h @@ -56,6 +56,7 @@ class VisuGUI_OffsetDlg: public QDialog virtual void accept(); virtual void reject(); void onApply(); + void onHelp(); private: void updateOffset (VISU::Prs3d_i* thePrs, float* theOffset); diff --git a/src/VISUGUI/VisuGUI_Plot3DDlg.cxx b/src/VISUGUI/VisuGUI_Plot3DDlg.cxx index 04ba4334..ed955d7f 100644 --- a/src/VISUGUI/VisuGUI_Plot3DDlg.cxx +++ b/src/VISUGUI/VisuGUI_Plot3DDlg.cxx @@ -39,6 +39,10 @@ #include "SALOME_Actor.h" #include "SUIT_Desktop.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" +#include "SUIT_ResourceMgr.h" +#include "LightApp_Application.h" #include #include @@ -539,12 +543,16 @@ VisuGUI_Plot3DDlg::VisuGUI_Plot3DDlg (SalomeApp_Module* theModule) QPushButton* buttonCancel = new QPushButton (tr("&Cancel") , GroupButtons, "buttonCancel"); buttonCancel->setAutoDefault(TRUE); GroupButtonsLayout->addWidget(buttonCancel, 0, 2); + QPushButton* buttonHelp = new QPushButton (tr("&Help") , GroupButtons, "buttonHelp"); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 3); TopLayout->addWidget(GroupButtons); // signals and slots connections connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp())); } //======================================================================= @@ -571,3 +579,23 @@ void VisuGUI_Plot3DDlg::reject() QDialog::reject(); } + +//======================================================================= +//function : onHelp +//purpose : +//======================================================================= +void VisuGUI_Plot3DDlg::onHelp() +{ + QString aHelpFileName = "plot_3d_presentation.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + VisuGUI* aVisuGUI = dynamic_cast( app->activeModule() ); + app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); + } + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} diff --git a/src/VISUGUI/VisuGUI_Plot3DDlg.h b/src/VISUGUI/VisuGUI_Plot3DDlg.h index a1e59f90..325441f5 100644 --- a/src/VISUGUI/VisuGUI_Plot3DDlg.h +++ b/src/VISUGUI/VisuGUI_Plot3DDlg.h @@ -110,6 +110,7 @@ class VisuGUI_Plot3DDlg : public QDialog protected slots: void accept(); void reject(); + void onHelp(); private: VisuGUI_Plot3DPane* myIsoPane; diff --git a/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx b/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx index c3f9bcf7..bf91604a 100644 --- a/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx +++ b/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx @@ -42,8 +42,9 @@ #include "VISU_ScalarMap_i.hh" #include "VISU_ScalarMapAct.h" -#include "SalomeApp_Application.h" +#include "LightApp_Application.h" +#include "SUIT_Session.h" #include "SUIT_MessageBox.h" #include "SUIT_ResourceMgr.h" @@ -1095,10 +1096,15 @@ VisuGUI_ScalarBarDlg::VisuGUI_ScalarBarDlg (SalomeApp_Module* theModule, bool Se buttonCancel->setAutoDefault( TRUE ); GroupButtonsLayout->addWidget( buttonCancel, 0, 2 ); + QPushButton* buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons, "buttonHelp" ); + buttonHelp->setAutoDefault( TRUE ); + GroupButtonsLayout->addWidget( buttonHelp, 0, 3 ); + TopLayout->addWidget( GroupButtons ); connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onHelp() ) ); } /*! @@ -1122,6 +1128,25 @@ void VisuGUI_ScalarBarDlg::reject() QDialog::reject(); } +/*! + Called when button is clicked, shows the corresponding help page in defined browser +*/ +void VisuGUI_ScalarBarDlg::onHelp() +{ + QString aHelpFileName = "/files/scalar_map_presentation.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + VisuGUI* aVisuGUI = dynamic_cast( app->activeModule() ); + app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); + } + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} + //####################################################################################### VisuGUI_TextPrefDlg::VisuGUI_TextPrefDlg (QWidget* parent) @@ -1178,10 +1203,31 @@ VisuGUI_TextPrefDlg::VisuGUI_TextPrefDlg (QWidget* parent) buttonCancel->setAutoDefault( TRUE ); GroupButtonsLayout->addWidget( buttonCancel, 0, 2 ); + QPushButton* buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons, "buttonHelp" ); + buttonHelp->setAutoDefault( TRUE ); + GroupButtonsLayout->addWidget( buttonHelp, 0, 3 ); + TopLayout->addWidget( GroupButtons ); connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp())); +} + +void VisuGUI_TextPrefDlg::onHelp() +{ + QString aHelpFileName = "/files/scalar_map_presentation.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + VisuGUI* aVisuGUI = dynamic_cast( app->activeModule() ); + app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); + } + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } } void VisuGUI_TextPrefDlg::storeBeginValues() diff --git a/src/VISUGUI/VisuGUI_ScalarBarDlg.h b/src/VISUGUI/VisuGUI_ScalarBarDlg.h index 02ac4462..7a6adbf6 100644 --- a/src/VISUGUI/VisuGUI_ScalarBarDlg.h +++ b/src/VISUGUI/VisuGUI_ScalarBarDlg.h @@ -86,6 +86,7 @@ class VisuGUI_TextPrefDlg: public QDialog protected slots: void accept(); void reject(); + void onHelp(); private: QLineEdit* myTitleEdt; @@ -203,6 +204,7 @@ class VisuGUI_ScalarBarDlg : public QDialog protected slots: void accept(); void reject(); + void onHelp(); protected: VisuGUI_ScalarBarPane* myScalarPane; diff --git a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx index 3aac42a0..d2358033 100644 --- a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx +++ b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx @@ -38,8 +38,12 @@ #include "VISU_Convertor.hxx" #include "SalomeApp_Module.h" +#include "LightApp_Application.h" #include "LightApp_SelectionMgr.h" #include "SUIT_Desktop.h" +#include "SUIT_ResourceMgr.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" #include "SALOME_ListIO.hxx" @@ -139,6 +143,10 @@ VisuGUI_ScalarMapOnDeformedShapeDlg::VisuGUI_ScalarMapOnDeformedShapeDlg (Salome buttonCancel->setAutoDefault(TRUE); GroupButtonsLayout->addWidget(buttonCancel, 0, 2); + QPushButton* buttonHelp = new QPushButton (tr("&Help") , GroupButtons, "buttonHelp"); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 3); + // Add Tab box and Buttons to the top layout TopLayout->addWidget(aTabBox); TopLayout->addWidget(GroupButtons); @@ -146,6 +154,7 @@ VisuGUI_ScalarMapOnDeformedShapeDlg::VisuGUI_ScalarMapOnDeformedShapeDlg (Salome // signals and slots connections connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp())); connect(myFieldsCombo, SIGNAL(activated(int)), this, SLOT(onFieldChanged(int))); connect(myTimeStampsCombo, SIGNAL(activated(int)), this, SLOT(onTimeStampChanged(int))); } @@ -379,6 +388,20 @@ void VisuGUI_ScalarMapOnDeformedShapeDlg::reject() QDialog::reject(); } +void VisuGUI_ScalarMapOnDeformedShapeDlg::onHelp() +{ + QString aHelpFileName = "scalar_map_on_deformed_shape_presentation.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(myVisuGUI ? app->moduleName(myVisuGUI->moduleName()) : QString(""), aHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} + void VisuGUI_ScalarMapOnDeformedShapeDlg::AddAllFieldNames(){ TMF::const_iterator aIterMesh = myMeshFieldsTimes.begin(); for(;aIterMesh != myMeshFieldsTimes.end();aIterMesh++){ diff --git a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h index 6bc817c6..720a470e 100644 --- a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h +++ b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h @@ -74,6 +74,7 @@ public: protected slots: void accept(); void reject(); + void onHelp(); private slots: void onFieldChanged(int i=0); diff --git a/src/VISUGUI/VisuGUI_Selection.cxx b/src/VISUGUI/VisuGUI_Selection.cxx index 371d50a5..7e5e658e 100644 --- a/src/VISUGUI/VisuGUI_Selection.cxx +++ b/src/VISUGUI/VisuGUI_Selection.cxx @@ -39,12 +39,14 @@ #include "SalomeApp_Study.h" #include "SalomeApp_Application.h" +#include "LightApp_Application.h" #include "LightApp_SelectionMgr.h" #include "LightApp_VTKSelector.h" #include "SUIT_MessageBox.h" #include "SUIT_ViewWindow.h" #include "SUIT_Session.h" +#include "SUIT_ResourceMgr.h" #include "SALOME_ListIO.hxx" #include "SALOME_ListIteratorOfListIO.hxx" @@ -250,6 +252,9 @@ VisuGUI_SelectionDlg::VisuGUI_SelectionDlg (const SalomeApp_Module* theModule): QPushButton* aCloseBtn = new QPushButton (tr("BUT_CLOSE"), aBtnBox); connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(close())); + QPushButton* aHelpBtn = new QPushButton (tr("BUT_HELP"), aBtnBox); + connect(aHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp())); + TopLayout->addWidget(aBtnBox, 3, 0); SalomeApp_Application* anApp = dynamic_cast @@ -617,3 +622,17 @@ void VisuGUI_SelectionDlg::onCellIdEdit (const QString& theText) else clearFields(); } + +void VisuGUI_SelectionDlg::onHelp() +{ + QString aHelpFileName = "/files/getting_elements_attributes.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(myModule ? app->moduleName(myModule->moduleName()) : QString(""), aHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} diff --git a/src/VISUGUI/VisuGUI_Selection.h b/src/VISUGUI/VisuGUI_Selection.h index 467e9c18..0e1f873d 100644 --- a/src/VISUGUI/VisuGUI_Selection.h +++ b/src/VISUGUI/VisuGUI_Selection.h @@ -55,6 +55,7 @@ private slots: void onSelectionEvent (); void onPointIdEdit (const QString& theText); void onCellIdEdit (const QString& theText); + void onHelp(); private: void clearFields (); diff --git a/src/VISUGUI/VisuGUI_SetupPlot2dDlg.cxx b/src/VISUGUI/VisuGUI_SetupPlot2dDlg.cxx index 120785fa..1d85acf0 100644 --- a/src/VISUGUI/VisuGUI_SetupPlot2dDlg.cxx +++ b/src/VISUGUI/VisuGUI_SetupPlot2dDlg.cxx @@ -8,10 +8,15 @@ // $Header$ #include "VisuGUI_SetupPlot2dDlg.h" +#include "VisuGUI.h" #include "SPlot2d_Curve.h" #include "SUIT_Tools.h" #include "SUIT_MessageBox.h" +#include "SUIT_ResourceMgr.h" +#include "SUIT_Session.h" + +#include "LightApp_Application.h" #include #include @@ -183,20 +188,24 @@ VisuGUI_SetupPlot2dDlg::VisuGUI_SetupPlot2dDlg( _PTR(SObject) object, QWidget* p myView->setMinimumWidth( frame->sizeHint().width() + MARGIN_SIZE * 2 ); - /* OK/Cancel buttons */ + /* OK/Cancel/Help buttons */ myOkBtn = new QPushButton( tr( "BUT_OK" ), this, "buttonOk" ); myOkBtn->setAutoDefault( TRUE ); myOkBtn->setDefault( TRUE ); myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), this, "buttonCancel" ); myCancelBtn->setAutoDefault( TRUE ); + myHelpBtn = new QPushButton( tr( "BUT_HELP" ), this, "buttonHelp" ); + myHelpBtn->setAutoDefault( TRUE ); - topLayout->addMultiCellWidget( myView, 0, 0, 0, 2 ); + topLayout->addMultiCellWidget( myView, 0, 0, 0, 3 ); topLayout->addWidget( myOkBtn, 1, 0 ); topLayout->setColStretch( 1, 5 ); topLayout->addWidget( myCancelBtn, 1, 2 ); + topLayout->addWidget( myHelpBtn, 1, 3 ); connect( myOkBtn, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( myHelpBtn, SIGNAL( clicked() ), this, SLOT( onHelp() ) ); enableControls(); @@ -426,6 +435,24 @@ void VisuGUI_SetupPlot2dDlg::onVBtnToggled( bool on ) } enableControls(); } +/*! + Slot, called when button is clicked +*/ +void VisuGUI_SetupPlot2dDlg::onHelp() +{ + QString aHelpFileName = "/files/creating_curves.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + VisuGUI* aVisuGUI = dynamic_cast( app->activeModule() ); + app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); + } + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} /*! Enables/disables buttons */ diff --git a/src/VISUGUI/VisuGUI_SetupPlot2dDlg.h b/src/VISUGUI/VisuGUI_SetupPlot2dDlg.h index 1ce1e2aa..616fc1ad 100644 --- a/src/VISUGUI/VisuGUI_SetupPlot2dDlg.h +++ b/src/VISUGUI/VisuGUI_SetupPlot2dDlg.h @@ -46,12 +46,14 @@ public: private slots: void onHBtnToggled( bool ); void onVBtnToggled( bool ); + void onHelp(); void enableControls(); private: QScrollView* myView; QPushButton* myOkBtn; QPushButton* myCancelBtn; + QPushButton* myHelpBtn; QPtrList myItems; _PTR(SObject) myObject; diff --git a/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx b/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx index e6fa3cc2..6d4196ba 100644 --- a/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx +++ b/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx @@ -20,11 +20,13 @@ #include "VISU_Actor.h" #include "SalomeApp_Application.h" +#include "LightApp_Application.h" #include "LightApp_SelectionMgr.h" #include "SVTK_ViewWindow.h" #include "SUIT_Desktop.h" +#include "SUIT_Session.h" #include "SUIT_ResourceMgr.h" #include "SUIT_MessageBox.h" @@ -277,8 +279,14 @@ VisuGUI_StreamLinesDlg::VisuGUI_StreamLinesDlg (SalomeApp_Module* theModule) QPushButton* aCancelBtn = new QPushButton( tr( "&Cancel" ) , aGroupButtons, "buttonCancel" ); aCancelBtn->setAutoDefault( TRUE ); aGroupButtonsLayout->addWidget( aCancelBtn, 0, 2 ); + + QPushButton* aHelpBtn = new QPushButton( tr( "&Help" ) , aGroupButtons, "buttonHelp" ); + aHelpBtn->setAutoDefault( TRUE ); + aGroupButtonsLayout->addWidget( aHelpBtn, 0, 3 ); + connect( aOkBtn, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( aCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( aHelpBtn, SIGNAL( clicked() ), this, SLOT( onHelp() ) ); aBoxLayout->addWidget(aGroupButtons); @@ -593,3 +601,17 @@ void VisuGUI_StreamLinesDlg::reject() myScalarPane->deletePreview(); QDialog::reject(); } + +void VisuGUI_StreamLinesDlg::onHelp() +{ + QString aHelpFileName = "/files/stream_lines_presentation.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(myVisuGUI ? app->moduleName(myVisuGUI->moduleName()) : QString(""), aHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} diff --git a/src/VISUGUI/VisuGUI_StreamLinesDlg.h b/src/VISUGUI/VisuGUI_StreamLinesDlg.h index c5f45e20..1c5a336f 100644 --- a/src/VISUGUI/VisuGUI_StreamLinesDlg.h +++ b/src/VISUGUI/VisuGUI_StreamLinesDlg.h @@ -40,6 +40,7 @@ public: protected slots: void accept(); void reject(); + void onHelp(); private slots: void onSelectionActive(bool theActive); diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.cxx b/src/VISUGUI/VisuGUI_TimeAnimation.cxx index 92a3b4ab..e22eca42 100644 --- a/src/VISUGUI/VisuGUI_TimeAnimation.cxx +++ b/src/VISUGUI/VisuGUI_TimeAnimation.cxx @@ -42,12 +42,14 @@ #include "VISU_Actor.h" #include "SalomeApp_Study.h" -#include "SalomeApp_Application.h" +#include "LightApp_Application.h" #include "SVTK_ViewWindow.h" #include "SUIT_OverrideCursor.h" #include "SUIT_MessageBox.h" +#include "SUIT_ResourceMgr.h" +#include "SUIT_Session.h" #include "SUIT_Desktop.h" #include "SUIT_FileDlg.h" @@ -1151,6 +1153,9 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Stu QPushButton* aCloseBtn = new QPushButton(tr("BUT_CLOSE"), aBtnBox); connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(close())); + QPushButton* aHelpBtn = new QPushButton(tr("BUT_HELP"), aBtnBox); + connect(aHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp())); + SUIT_Study* aStudy = VISU::GetAppStudy(myModule); connect(aStudy, SIGNAL(destroyed()), this, SLOT(close())); @@ -1367,6 +1372,21 @@ void VisuGUI_TimeAnimationDlg::onStop() } } +//------------------------------------------------------------------------ +void VisuGUI_TimeAnimationDlg::onHelp() +{ + QString aHelpFileName = "/files/animating_presentations.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(myModule ? app->moduleName(myModule->moduleName()) : QString(""), aHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} + //------------------------------------------------------------------------ void VisuGUI_TimeAnimationDlg::saveToStudy() { diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.h b/src/VISUGUI/VisuGUI_TimeAnimation.h index 4d2cea5f..3c58b2b3 100644 --- a/src/VISUGUI/VisuGUI_TimeAnimation.h +++ b/src/VISUGUI/VisuGUI_TimeAnimation.h @@ -156,6 +156,7 @@ class VisuGUI_TimeAnimationDlg: public QDialog void onExecution(long theNewFrame, double theTime); void onBrowse(); void onStop(); + void onHelp(); void saveToStudy(); void publishToStudy(); diff --git a/src/VISUGUI/VisuGUI_TransparencyDlg.cxx b/src/VISUGUI/VisuGUI_TransparencyDlg.cxx index b9556c4c..9c093759 100644 --- a/src/VISUGUI/VisuGUI_TransparencyDlg.cxx +++ b/src/VISUGUI/VisuGUI_TransparencyDlg.cxx @@ -35,6 +35,9 @@ #include "SUIT_Desktop.h" #include "SUIT_OverrideCursor.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" +#include "SUIT_ResourceMgr.h" #include "SALOME_ListIO.hxx" #include "SALOME_ListIteratorOfListIO.hxx" @@ -42,6 +45,7 @@ #include "LightApp_Study.h" #include "LightApp_SelectionMgr.h" +#include "LightApp_Application.h" #include "SVTK_ViewWindow.h" @@ -128,9 +132,14 @@ VisuGUI_TransparencyDlg::VisuGUI_TransparencyDlg( VisuGUI* theModule, buttonOk->setText(tr("BUT_CLOSE")); buttonOk->setAutoDefault(TRUE); buttonOk->setDefault(TRUE); - GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 0); - GroupButtonsLayout->addWidget(buttonOk, 0, 1); - GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 2); + + buttonHelp = new QPushButton(GroupButtons, "buttonHelp"); + buttonHelp->setText(tr("BUT_HELP")); + buttonHelp->setAutoDefault(TRUE); + + GroupButtonsLayout->addWidget(buttonOk, 0, 0); + GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1); + GroupButtonsLayout->addWidget(buttonHelp, 0, 2); VisuGUI_TransparencyDlgLayout->addWidget(GroupC1, 0, 0); VisuGUI_TransparencyDlgLayout->addWidget(GroupButtons, 1, 0); @@ -140,6 +149,7 @@ VisuGUI_TransparencyDlg::VisuGUI_TransparencyDlg( VisuGUI* theModule, // signals and slots connections : after ValueHasChanged() connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(Slider1, SIGNAL(valueChanged(int)), this, SLOT(SetTransparency())); connect(Slider1, SIGNAL(sliderMoved(int)), this, SLOT(ValueHasChanged())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionChanged())); @@ -163,6 +173,26 @@ void VisuGUI_TransparencyDlg::ClickOnOk() close(); } +//======================================================================= +// function : ClickOnHelp() +// purpose : +//======================================================================= +void VisuGUI_TransparencyDlg::ClickOnHelp() +{ + QString aHelpFileName = "/files/changing_visualization_parameters_of_the_presenetation.htm#Changing3"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + VisuGUI* aVisuGUI = dynamic_cast( app->activeModule() ); + app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); + } + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} + //================================================================================= // function : SetTransparency() // purpose : Called when value of slider change diff --git a/src/VISUGUI/VisuGUI_TransparencyDlg.h b/src/VISUGUI/VisuGUI_TransparencyDlg.h index 6dbc9437..7787d70b 100644 --- a/src/VISUGUI/VisuGUI_TransparencyDlg.h +++ b/src/VISUGUI/VisuGUI_TransparencyDlg.h @@ -61,6 +61,7 @@ private : SVTK_ViewWindow* myViewWindow; QPushButton* buttonOk; + QPushButton* buttonHelp; QLabel* TextLabelOpaque; QLabel* ValueLab; QLabel* TextLabelTransparent; @@ -68,6 +69,7 @@ private : public slots: void ClickOnOk(); + void ClickOnHelp(); void ValueHasChanged(); void SetTransparency(); void onSelectionChanged(); diff --git a/src/VISUGUI/VisuGUI_VectorsDlg.cxx b/src/VISUGUI/VisuGUI_VectorsDlg.cxx index a5e2f2c5..e16e94bc 100644 --- a/src/VISUGUI/VisuGUI_VectorsDlg.cxx +++ b/src/VISUGUI/VisuGUI_VectorsDlg.cxx @@ -33,9 +33,13 @@ #include "VisuGUI_Tools.h" #include "VISU_Vectors_i.hh" - +#include "LightApp_Application.h" #include "SalomeApp_Module.h" + #include "SUIT_Desktop.h" +#include "SUIT_MessageBox.h" +#include "SUIT_ResourceMgr.h" +#include "SUIT_Session.h" #include #include @@ -162,6 +166,9 @@ VisuGUI_VectorsDlg::VisuGUI_VectorsDlg (SalomeApp_Module* theModule) buttonCancel = new QPushButton( tr( "&Cancel" ) , GroupButtons, "buttonCancel" ); buttonCancel->setAutoDefault( TRUE ); GroupButtonsLayout->addWidget( buttonCancel, 0, 2 ); + buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons, "buttonHelp" ); + buttonHelp->setAutoDefault( TRUE ); + GroupButtonsLayout->addWidget( buttonHelp, 0, 3 ); // top layout aTabBox->addTab(aBox, "Vectors"); @@ -178,6 +185,7 @@ VisuGUI_VectorsDlg::VisuGUI_VectorsDlg (SalomeApp_Module* theModule) connect( UseMagn, SIGNAL( clicked() ), this, SLOT( enableSetColor() ) ); connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onHelp() ) ); // default values UseMagn->setChecked( TRUE ); @@ -420,3 +428,19 @@ void VisuGUI_VectorsDlg::reject() myScalarPane->deletePreview(); QDialog::reject(); } + +void VisuGUI_VectorsDlg::onHelp() +{ + QString aHelpFileName = "/files/vectors_presentation.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + VisuGUI* aVisuGUI = dynamic_cast( app->activeModule() ); + app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); + } + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} diff --git a/src/VISUGUI/VisuGUI_VectorsDlg.h b/src/VISUGUI/VisuGUI_VectorsDlg.h index 2abdf591..5d6d9f3b 100644 --- a/src/VISUGUI/VisuGUI_VectorsDlg.h +++ b/src/VISUGUI/VisuGUI_VectorsDlg.h @@ -82,6 +82,7 @@ public: protected slots: void accept(); void reject(); + void onHelp(); private: QGroupBox* TopGroup; @@ -104,6 +105,7 @@ private: QGroupBox* GroupButtons; QPushButton* buttonOk; QPushButton* buttonCancel; + QPushButton* buttonHelp; QColor myColor; VisuGUI_ScalarBarPane* myScalarPane; diff --git a/src/VVTK/VVTK_PickingDlg.cxx b/src/VVTK/VVTK_PickingDlg.cxx index 06e1dabb..ba848025 100644 --- a/src/VVTK/VVTK_PickingDlg.cxx +++ b/src/VVTK/VVTK_PickingDlg.cxx @@ -13,6 +13,7 @@ #include "VISU_GaussPtsAct.h" #include "VISU_GaussPtsSettings.h" +#include "SUIT_MessageBox.h" #include "SUIT_ResourceMgr.h" #include "SUIT_Session.h" @@ -40,6 +41,8 @@ #include "QtxDblSpinBox.h" #include "QtxIntSpinBox.h" +#include "LightApp_Application.h" + using namespace std; VVTK_PickingDlg::VVTK_PickingDlg( QWidget* parent, const char* name ) @@ -206,11 +209,16 @@ VVTK_PickingDlg::VVTK_PickingDlg( QWidget* parent, const char* name ) buttonClose->setAutoDefault( TRUE ); GroupButtonsLayout->addWidget( buttonClose, 0, 2 ); + QPushButton* buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons, "buttonHelp" ); + buttonHelp->setAutoDefault( TRUE ); + GroupButtonsLayout->addWidget( buttonHelp, 0, 3 ); + TopLayout->addWidget( aBox ); TopLayout->addWidget( GroupButtons ); connect( buttonApply, SIGNAL( clicked() ), this, SLOT( onClickApply() ) ); connect( buttonClose, SIGNAL( clicked() ), this, SLOT( onClickClose() ) ); + connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onClickHelp() ) ); } VVTK_PickingDlg::~VVTK_PickingDlg() @@ -364,6 +372,20 @@ void VVTK_PickingDlg::onClickClose() reject(); } +void VVTK_PickingDlg::onClickHelp() +{ + QString aHelpFileName = "picking.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} + void VVTK_PickingDlg::done( int r ) { myAction->setOn( false ); diff --git a/src/VVTK/VVTK_PickingDlg.h b/src/VVTK/VVTK_PickingDlg.h index 72d3a4ec..a2099bb4 100644 --- a/src/VVTK/VVTK_PickingDlg.h +++ b/src/VVTK/VVTK_PickingDlg.h @@ -66,6 +66,7 @@ protected slots: void onClickApply(); void onClickClose(); + void onClickHelp(); void onColorButtonPressed(); diff --git a/src/VVTK/VVTK_RecorderDlg.cxx b/src/VVTK/VVTK_RecorderDlg.cxx index b188c99e..98624038 100644 --- a/src/VVTK/VVTK_RecorderDlg.cxx +++ b/src/VVTK/VVTK_RecorderDlg.cxx @@ -29,12 +29,15 @@ #include "VVTK_Recorder.h" #include "SUIT_FileDlg.h" +#include "SUIT_MessageBox.h" #include "SUIT_ResourceMgr.h" #include "SUIT_Session.h" #include "QtxDblSpinBox.h" #include "QtxIntSpinBox.h" +#include "LightApp_Application.h" + #include #include #include @@ -127,8 +130,13 @@ VVTK_RecorderDlg::VVTK_RecorderDlg( QWidget* theParent, VVTK_Recorder* theRecord aCloseButton->setAutoDefault( true ); CommonGroupLayout->addWidget( aCloseButton, 0, 2 ); + QPushButton* aHelpButton = new QPushButton( tr( "HELP" ), CommonGroup ); + aHelpButton->setAutoDefault( true ); + CommonGroupLayout->addWidget( aHelpButton, 0, 3 ); + connect( aStartButton, SIGNAL( clicked() ), this, SLOT( onStart() ) ); connect( aCloseButton, SIGNAL( clicked() ), this, SLOT( onClose() ) ); + connect( aHelpButton, SIGNAL( clicked() ), this, SLOT( onHelp() ) ); } VVTK_RecorderDlg::~VVTK_RecorderDlg() @@ -162,6 +170,20 @@ void VVTK_RecorderDlg::onClose() reject(); } +void VVTK_RecorderDlg::onHelp() +{ + QString aHelpFileName = "animation_in_gauss_viewer.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} + bool VVTK_RecorderDlg::onBrowseFile() { QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ); diff --git a/src/VVTK/VVTK_RecorderDlg.h b/src/VVTK/VVTK_RecorderDlg.h index f46ef1b1..ee31cf1d 100644 --- a/src/VVTK/VVTK_RecorderDlg.h +++ b/src/VVTK/VVTK_RecorderDlg.h @@ -61,6 +61,7 @@ public: protected slots: void onStart(); void onClose(); + void onHelp(); bool onBrowseFile(); diff --git a/src/VVTK/VVTK_SegmentationCursorDlg.cxx b/src/VVTK/VVTK_SegmentationCursorDlg.cxx index c5803543..6b49cc5c 100644 --- a/src/VVTK/VVTK_SegmentationCursorDlg.cxx +++ b/src/VVTK/VVTK_SegmentationCursorDlg.cxx @@ -22,6 +22,7 @@ #include "VISU_GaussPointsPL.hxx" #include "VISU_OpenGLPointSpriteMapper.hxx" +#include "LightApp_Application.h" #include "SUIT_MessageBox.h" #include "SUIT_ResourceMgr.h" #include "SUIT_Session.h" @@ -381,11 +382,16 @@ VVTK_SegmentationCursorDlg::VVTK_SegmentationCursorDlg( QWidget* parent, const c buttonClose->setAutoDefault( TRUE ); GroupButtonsLayout->addWidget( buttonClose, 0, 2 ); + QPushButton* buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons, "buttonHelp" ); + buttonHelp->setAutoDefault( TRUE ); + GroupButtonsLayout->addWidget( buttonHelp, 0, 3 ); + TopLayout->addWidget( myTabBox ); TopLayout->addWidget( GroupButtons ); connect( buttonApply, SIGNAL( clicked() ), this, SLOT( onClickApply() ) ); connect( buttonClose, SIGNAL( clicked() ), this, SLOT( onClickClose() ) ); + connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onClickHelp() ) ); } VVTK_SegmentationCursorDlg::~VVTK_SegmentationCursorDlg() @@ -803,6 +809,20 @@ void VVTK_SegmentationCursorDlg::onClickClose() reject(); } +void VVTK_SegmentationCursorDlg::onClickHelp() +{ + QString aHelpFileName = "segmentation.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} + void VVTK_SegmentationCursorDlg::done( int r ) { myPlaneAction->setOn( false ); diff --git a/src/VVTK/VVTK_SegmentationCursorDlg.h b/src/VVTK/VVTK_SegmentationCursorDlg.h index edac2165..3ca4a195 100644 --- a/src/VVTK/VVTK_SegmentationCursorDlg.h +++ b/src/VVTK/VVTK_SegmentationCursorDlg.h @@ -116,6 +116,7 @@ protected slots: void onClickApply(); void onClickClose(); + void onClickHelp(); signals: void scgClose(); -- 2.39.2