X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_ClippingDlg.cxx;h=7902658febc9bb812c1e55aad40878fbc23e64e5;hb=4ee952246b91f6a1bfcbac6face9476482a29a8b;hp=e513577b93df12f7a15a9ae50e118461ffd86caf;hpb=c63ee099ad2b149bd70136839c973e8910137bc5;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx b/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx index e513577b9..7902658fe 100644 --- a/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx @@ -182,7 +182,8 @@ protected: myMapper->RemoveAllInputs(); myMapper->Delete(); - myPlaneSource->UnRegisterAllOutputs(); + // commented: porting to vtk 5.0 + // myPlaneSource->UnRegisterAllOutputs(); myPlaneSource->Delete(); }; @@ -321,7 +322,7 @@ SMESHGUI_ClippingDlg::SMESHGUI_ClippingDlg (SMESHGUI* theModule, QSpacerItem* spacer_9 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); GroupButtonsLayout->addItem(spacer_9, 0, 2); buttonOk = new QPushButton(GroupButtons, "buttonOk"); - buttonOk->setText(tr("SMESH_BUT_OK" )); + buttonOk->setText(tr("SMESH_BUT_APPLY_AND_CLOSE" )); buttonOk->setAutoDefault(TRUE); buttonOk->setDefault(TRUE); GroupButtonsLayout->addWidget(buttonOk, 0, 0); @@ -349,7 +350,7 @@ SMESHGUI_ClippingDlg::SMESHGUI_ClippingDlg (SMESHGUI* theModule, myIsSelectPlane = false; onSelectionChanged(); - myHelpFileName = "clipping.htm"; + myHelpFileName = "clipping_page.html"; // signals and slots connections : connect(ComboBoxPlanes, SIGNAL(activated(int)), this, SLOT(onSelectPlane(int))); @@ -365,7 +366,7 @@ SMESHGUI_ClippingDlg::SMESHGUI_ClippingDlg (SMESHGUI* theModule, connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); - connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnOk())); + connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionChanged())); /* to close dialog if study frame change */ connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), this, SLOT(ClickOnCancel())); @@ -381,7 +382,9 @@ SMESHGUI_ClippingDlg::~SMESHGUI_ClippingDlg() { // no need to delete child widgets, Qt does it all for us std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(false)); - SMESH::RenderViewWindow(SMESH::GetViewWindow(mySMESHGUI)); + if (mySMESHGUI) + if (SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow(mySMESHGUI)) + SMESH::RenderViewWindow(aViewWindow); } //======================================================================= @@ -443,9 +446,15 @@ void SMESHGUI_ClippingDlg::ClickOnHelp() 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", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } @@ -769,3 +778,20 @@ void SMESHGUI_ClippingDlg::OnPreviewToggle (bool theIsToggled) std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(theIsToggled)); SMESH::RenderViewWindow(SMESH::GetCurrentVtkView()); } + +//================================================================================= +// function : keyPressEvent() +// purpose : +//================================================================================= +void SMESHGUI_ClippingDlg::keyPressEvent( QKeyEvent* e ) +{ + QDialog::keyPressEvent( e ); + if ( e->isAccepted() ) + return; + + if ( e->key() == Key_F1 ) + { + e->accept(); + ClickOnHelp(); + } +}