X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_Preferences_ColorDlg.cxx;h=7d03f277971f3154a7b0fa844f746c322e335fc9;hb=396a60d4bb68195f8f05b626598f0ad46c636aff;hp=9a01ad34e7719e6bf154bced7de93910ee091f6d;hpb=845309d9194395babe18cf4fa92cc958879e0b5d;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.cxx b/src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.cxx index 9a01ad34e..7d03f2779 100644 --- a/src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -19,6 +19,7 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // SMESH SMESHGUI : GUI for SMESH component // File : SMESHGUI_Preferences_ColorDlg.cxx // Author : Nicolas REJNERI, Open CASCADE S.A.S. @@ -32,8 +33,12 @@ // SALOME GUI includes #include +#include +#include +#include #include #include +#include #include // Qt includes @@ -44,6 +49,7 @@ #include #include #include +#include #define SPACING 6 #define MARGIN 11 @@ -185,10 +191,14 @@ SMESHGUI_Preferences_ColorDlg::SMESHGUI_Preferences_ColorDlg( SMESHGUI* theModul QPushButton* buttonCancel = new QPushButton( tr( "&Cancel" ), GroupButtons ); buttonCancel->setAutoDefault( true ); + QPushButton* buttonHelp = new QPushButton( tr( "&Help" ), GroupButtons ); + buttonHelp->setAutoDefault( true ); + GroupButtonsLayout->addWidget( buttonOk ); GroupButtonsLayout->addSpacing( 10 ); GroupButtonsLayout->addStretch(); GroupButtonsLayout->addWidget( buttonCancel ); + GroupButtonsLayout->addWidget( buttonHelp ); // ------------------------------- topLayout->addWidget( ButtonGroup1 ); @@ -199,9 +209,12 @@ SMESHGUI_Preferences_ColorDlg::SMESHGUI_Preferences_ColorDlg( SMESHGUI* theModul // ------------------------------- mySMESHGUI->SetActiveDialogBox( this ); + myHelpFileName = "colors_size_page.html"; + /* signals and slots connections */ connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ); + connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( ClickOnHelp() ) ); connect( mySMESHGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ); @@ -238,6 +251,30 @@ void SMESHGUI_Preferences_ColorDlg::ClickOnCancel() reject(); } +//================================================================================= +// function : ClickOnHelp() +// purpose : +//================================================================================= +void SMESHGUI_Preferences_ColorDlg::ClickOnHelp() +{ + 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::warning(this, tr("WRN_WARNING"), + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); + } +} + //================================================================================= // function : DeactivateActiveDialog() // purpose : @@ -446,3 +483,19 @@ int SMESHGUI_Preferences_ColorDlg::getCustomMarkerID() const { return MarkerWidget->getCustomMarkerID(); } + +//================================================================================= +// function : keyPressEvent() +// purpose : +//================================================================================= +void SMESHGUI_Preferences_ColorDlg::keyPressEvent( QKeyEvent* e ) +{ + QDialog::keyPressEvent( e ); + if ( e->isAccepted() ) + return; + + if ( e->key() == Qt::Key_F1 ) { + e->accept(); + ClickOnHelp(); + } +}