X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_StandardMeshInfosDlg.cxx;h=012294dccc20a46f0fdbef08528e145809557380;hb=d2bb955929b996248443cf0afb9b89f5ffa6a94f;hp=8960524b3d909d19d37506fff201b059d381bc6a;hpb=a2f0f70d5912ea83c868916f06eaefb58a32ec2e;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_StandardMeshInfosDlg.cxx b/src/SMESHGUI/SMESHGUI_StandardMeshInfosDlg.cxx index 8960524b3..012294dcc 100644 --- a/src/SMESHGUI/SMESHGUI_StandardMeshInfosDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_StandardMeshInfosDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -41,8 +41,11 @@ #include "SUIT_Desktop.h" #include "SUIT_Session.h" #include "SUIT_OverrideCursor.h" +#include "SUIT_MessageBox.h" -#include "SalomeApp_SelectionMgr.h" +#include "LightApp_Application.h" + +#include "LightApp_SelectionMgr.h" #include "SALOME_ListIO.hxx" #include "utilities.h" @@ -144,12 +147,15 @@ SMESHGUI_StandardMeshInfosDlg::SMESHGUI_StandardMeshInfosDlg( SMESHGUI* theModul myButtonsGroupLayout->setAlignment(Qt::AlignTop); myButtonsGroupLayout->setSpacing(6); myButtonsGroupLayout->setMargin(11); - // buttons --> OK button + // buttons --> OK and Help buttons myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), myButtonsGroup, "myOkBtn"); myOkBtn->setAutoDefault(TRUE); myOkBtn->setDefault(TRUE); - myButtonsGroupLayout->addStretch(); + myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP" ), myButtonsGroup, "myHelpBtn"); + myHelpBtn->setAutoDefault(TRUE); + myButtonsGroupLayout->addWidget(myOkBtn); myButtonsGroupLayout->addStretch(); + myButtonsGroupLayout->addWidget(myHelpBtn); aDlgLayout->addWidget(myButtonsGroup, 2, 0); @@ -157,6 +163,7 @@ SMESHGUI_StandardMeshInfosDlg::SMESHGUI_StandardMeshInfosDlg( SMESHGUI* theModul // connect signals connect( myOkBtn, SIGNAL(clicked()), this, SLOT(close())); + connect( myHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp())); connect( mySelectBtn, SIGNAL(clicked()), this, SLOT(onStartSelection())); connect( mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(close())); connect( mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); @@ -164,15 +171,14 @@ SMESHGUI_StandardMeshInfosDlg::SMESHGUI_StandardMeshInfosDlg( SMESHGUI* theModul // resize and move dialog, then show this->setMinimumSize(270, 428); - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); this->show(); // init dialog with current selection myMeshFilter = new SMESH_TypeFilter (MESH); mySelectionMgr->installFilter(myMeshFilter); onSelectionChanged(); + + myHelpFileName = "mesh_infos_page.html#standard_mesh_infos_anchor"; } //================================================================================= @@ -444,3 +450,43 @@ void SMESHGUI_StandardMeshInfosDlg::onStartSelection() onSelectionChanged(); myStartSelection = true; } + +//================================================================================= +// function : onHelp() +// purpose : +//================================================================================= +void SMESHGUI_StandardMeshInfosDlg::onHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + +//================================================================================= +// function : keyPressEvent() +// purpose : +//================================================================================= +void SMESHGUI_StandardMeshInfosDlg::keyPressEvent( QKeyEvent* e ) +{ + QDialog::keyPressEvent( e ); + if ( e->isAccepted() ) + return; + + if ( e->key() == Key_F1 ) + { + e->accept(); + onHelp(); + } +}