X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_SingleEditDlg.cxx;h=201b1c126cffb91d3e43be3480ae5305a4fcbbc7;hb=d2bb955929b996248443cf0afb9b89f5ffa6a94f;hp=223dbaad8a565864f3c31f4e8dbaec0b84519000;hpb=544a24fb7fd4dc55a61ffac82c8001d84d9d6f6b;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx b/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx index 223dbaad8..201b1c126 100755 --- a/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SingleEditDlg.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 // // // @@ -36,10 +36,12 @@ #include "SMESH_Actor.h" #include "SMDS_Mesh.hxx" -#include "SalomeApp_SelectionMgr.h" +#include "LightApp_SelectionMgr.h" +#include "LightApp_Application.h" #include "SUIT_ResourceMgr.h" #include "SUIT_MessageBox.h" #include "SUIT_Desktop.h" +#include "SUIT_Session.h" #include "SVTK_Selector.h" #include "SVTK_ViewWindow.h" @@ -158,6 +160,7 @@ QFrame* SMESHGUI_SingleEditDlg::createButtonFrame (QWidget* theParent) myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), aFrame); myApplyBtn = new QPushButton(tr("SMESH_BUT_APPLY"), aFrame); myCloseBtn = new QPushButton(tr("SMESH_BUT_CLOSE"), aFrame); + myHelpBtn = new QPushButton (tr("SMESH_BUT_HELP"), aFrame); QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); @@ -167,6 +170,7 @@ QFrame* SMESHGUI_SingleEditDlg::createButtonFrame (QWidget* theParent) aLay->addWidget(myApplyBtn); aLay->addItem(aSpacer); aLay->addWidget(myCloseBtn); + aLay->addWidget(myHelpBtn); return aFrame; } @@ -222,6 +226,7 @@ void SMESHGUI_SingleEditDlg::Init() connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk())); connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose())); connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply())); + connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp())); // selection and SMESHGUI connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); @@ -233,9 +238,6 @@ void SMESHGUI_SingleEditDlg::Init() myApplyBtn->setEnabled(false); setEnabled(true); - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); this->show(); // set selection mode @@ -264,13 +266,36 @@ void SMESHGUI_SingleEditDlg::onClose() { if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) aViewWindow->SetSelectionMode(ActorSelection); - mySelectionMgr->clearSelected(); + //mySelectionMgr->clearSelected(); disconnect(mySelectionMgr, 0, this, 0); disconnect(mySMESHGUI, 0, this, 0); mySMESHGUI->ResetState(); reject(); } +//================================================================================= +// function : onHelp() +// purpose : +//================================================================================= +void SMESHGUI_SingleEditDlg::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 : findTriangles() //purpose : find triangles sharing theNode1-theNode2 link @@ -507,13 +532,32 @@ bool SMESHGUI_SingleEditDlg::onApply() // update actor if (aResult) { + mySelector->ClearIndex(); mySelectionMgr->setSelectedObjects(aList, false); + onSelectionDone(); SMESH::UpdateView(); } return aResult; } +//================================================================================= +// function : keyPressEvent() +// purpose : +//================================================================================= +void SMESHGUI_SingleEditDlg::keyPressEvent( QKeyEvent* e ) +{ + QDialog::keyPressEvent( e ); + if ( e->isAccepted() ) + return; + + if ( e->key() == Key_F1 ) + { + e->accept(); + onHelp(); + } +} + /*! * Class : SMESHGUI_TrianglesInversionDlg * Description : Inversion of the diagonal of a pseudo-quadrangle formed by @@ -526,6 +570,7 @@ SMESHGUI_TrianglesInversionDlg : SMESHGUI_SingleEditDlg(theModule,theName) { setCaption(tr("CAPTION")); + myHelpFileName = "diagonal_inversion_of_elements_page.html"; } SMESHGUI_TrianglesInversionDlg::~SMESHGUI_TrianglesInversionDlg() @@ -550,6 +595,7 @@ SMESHGUI_UnionOfTwoTrianglesDlg : SMESHGUI_SingleEditDlg(theModule,theName) { setCaption(tr("CAPTION")); + myHelpFileName = "uniting_two_triangles_page.html"; } SMESHGUI_UnionOfTwoTrianglesDlg::~SMESHGUI_UnionOfTwoTrianglesDlg()