X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_TransparencyDlg.cxx;h=6e187231173d3ad10b277a1a993db674c233c028;hp=283306aa4e90479e82792f8ed42ebaaacd63bac8;hb=c3dcb1d5ce71049bef3434d77e015095d92ff646;hpb=a2f0f70d5912ea83c868916f06eaefb58a32ec2e diff --git a/src/SMESHGUI/SMESHGUI_TransparencyDlg.cxx b/src/SMESHGUI/SMESHGUI_TransparencyDlg.cxx index 283306aa4..6e1872311 100644 --- a/src/SMESHGUI/SMESHGUI_TransparencyDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_TransparencyDlg.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 // // // @@ -35,13 +35,16 @@ #include "SUIT_Desktop.h" #include "SUIT_OverrideCursor.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" #include "SALOME_ListIO.hxx" #include "SALOME_ListIteratorOfListIO.hxx" #include "SALOME_InteractiveObject.hxx" #include "SalomeApp_Study.h" -#include "SalomeApp_SelectionMgr.h" +#include "LightApp_Application.h" +#include "LightApp_SelectionMgr.h" #include "SVTK_ViewWindow.h" @@ -129,9 +132,15 @@ SMESHGUI_TransparencyDlg::SMESHGUI_TransparencyDlg( SMESHGUI* theModule, buttonOk->setText(tr("SMESH_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("SMESH_BUT_HELP")); + buttonHelp->setAutoDefault(TRUE); + + //GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 0); + GroupButtonsLayout->addWidget(buttonOk, 0, 0); + GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1); + GroupButtonsLayout->addWidget(buttonHelp, 0, 2); + //GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 2); SMESHGUI_TransparencyDlgLayout->addWidget(GroupC1, 0, 0); SMESHGUI_TransparencyDlgLayout->addWidget(GroupButtons, 1, 0); @@ -141,15 +150,14 @@ SMESHGUI_TransparencyDlg::SMESHGUI_TransparencyDlg( SMESHGUI* 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(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnOk())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionChanged())); - /* Move widget on the botton right corner of main widget */ - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); + myHelpFileName = "transparency.htm"; + this->show(); } @@ -171,6 +179,23 @@ void SMESHGUI_TransparencyDlg::ClickOnOk() close(); } +//================================================================================= +// function : ClickOnHelp() +// purpose : +//================================================================================= +void SMESHGUI_TransparencyDlg::ClickOnHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //================================================================================= // function : SetTransparency() // purpose : Called when value of slider change