1) IPAL15174 (Dump study works wrong for Concatenate):

fix of Problem 1 (no icon ?Build compound? in dialog box).
2) add the checking of the study lock.
3) change the help file name.
This commit is contained in:
akl 2007-03-09 09:21:56 +00:00
parent c4b1359adb
commit 28c7a65f90

View File

@ -67,20 +67,16 @@
// name : SMESHGUI_BuildCompoundDlg // name : SMESHGUI_BuildCompoundDlg
// Purpose : // Purpose :
//================================================================================= //=================================================================================
SMESHGUI_BuildCompoundDlg::SMESHGUI_BuildCompoundDlg( SMESHGUI* theModule, SMESHGUI_BuildCompoundDlg::SMESHGUI_BuildCompoundDlg( SMESHGUI* theModule)
const char* title,
const char* icon,
int theAction)
: QDialog(SMESH::GetDesktop(theModule), "SMESHGUI_BuildCompoundDlg", false, WStyle_Customize | : QDialog(SMESH::GetDesktop(theModule), "SMESHGUI_BuildCompoundDlg", false, WStyle_Customize |
WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose), WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
mySMESHGUI(theModule), mySMESHGUI(theModule),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)), mySelectionMgr(SMESH::GetSelectionMgr(theModule))
myAction(theAction)
{ {
setCaption(tr(title)); setCaption(tr("SMESH_BUILD_COMPOUND_TITLE"));
SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr(); SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
QPixmap image0 (aResMgr->loadPixmap("SMESH", tr(icon))); QPixmap image0 (aResMgr->loadPixmap("SMESH", tr("ICON_DLG_BUILD_COMPOUND_MESH")));
QPixmap image1 (aResMgr->loadPixmap("SMESH", tr("ICON_SELECT"))); QPixmap image1 (aResMgr->loadPixmap("SMESH", tr("ICON_SELECT")));
setSizeGripEnabled(TRUE); setSizeGripEnabled(TRUE);
@ -200,7 +196,7 @@ SMESHGUI_BuildCompoundDlg::SMESHGUI_BuildCompoundDlg( SMESHGUI* theModule,
GroupButtonsLayout->addWidget(buttonOk, 0, 0); GroupButtonsLayout->addWidget(buttonOk, 0, 0);
SMESHGUI_BuildCompoundDlgLayout->addWidget(GroupButtons, 3, 0); SMESHGUI_BuildCompoundDlgLayout->addWidget(GroupButtons, 3, 0);
myHelpFileName = "build_compound.htm"; myHelpFileName = "building_compounds.htm";
Init(); // Initialisations Init(); // Initialisations
} }
@ -307,8 +303,10 @@ QString SMESHGUI_BuildCompoundDlg::GetDefaultName(const QString& theOperation)
// function : ClickOnApply() // function : ClickOnApply()
// purpose : // purpose :
//================================================================================= //=================================================================================
void SMESHGUI_BuildCompoundDlg::ClickOnApply() bool SMESHGUI_BuildCompoundDlg::ClickOnApply()
{ {
if (mySMESHGUI->isActiveStudyLocked())
return false;
if (!myMesh->_is_nil()) { if (!myMesh->_is_nil()) {
try { try {
QApplication::setOverrideCursor(Qt::waitCursor); QApplication::setOverrideCursor(Qt::waitCursor);
@ -325,13 +323,16 @@ void SMESHGUI_BuildCompoundDlg::ClickOnApply()
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
mySMESHGUI->updateObjBrowser(); mySMESHGUI->updateObjBrowser();
} catch(...) { } catch(...) {
return false;
} }
LineEditName->setText(GetDefaultName(tr("COMPOUND_MESH"))); LineEditName->setText(GetDefaultName(tr("COMPOUND_MESH")));
//mySelectionMgr->clearSelected(); //mySelectionMgr->clearSelected();
SMESH::UpdateView(); SMESH::UpdateView();
return true;
} }
return false;
} }
//================================================================================= //=================================================================================
@ -340,7 +341,7 @@ void SMESHGUI_BuildCompoundDlg::ClickOnApply()
//================================================================================= //=================================================================================
void SMESHGUI_BuildCompoundDlg::ClickOnOk() void SMESHGUI_BuildCompoundDlg::ClickOnOk()
{ {
ClickOnApply(); if (ClickOnApply())
ClickOnCancel(); ClickOnCancel();
} }