From: vsv Date: Fri, 27 May 2016 14:53:02 +0000 (+0300) Subject: Issue #1527:Do not disable remove button on input wrong name X-Git-Tag: V_2.3.1~42 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e4a16dde635cce639d6a58dab9f1812af18f037e;p=modules%2Fshaper.git Issue #1527:Do not disable remove button on input wrong name --- diff --git a/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp b/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp index a340cdb3e..81f851319 100644 --- a/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp +++ b/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp @@ -417,7 +417,7 @@ void ParametersPlugin_WidgetParamsMgr::onCloseEditor(QWidget* theEditor, aText.replace(" ", ""); } if (hasName(aText)) { - myMessage = tr("Name %1 already exists.").arg(aText); + myMessage = tr("Name '%1' already exists.").arg(aText); QTimer::singleShot(50, this, SLOT(sendWarning())); return; } @@ -457,6 +457,8 @@ void ParametersPlugin_WidgetParamsMgr::onCloseEditor(QWidget* theEditor, if (aColumn == Col_Equation) updateParametersPart(); updateFeaturesPart(); + + onSelectionChanged(); } void ParametersPlugin_WidgetParamsMgr::updateItem(QTreeWidgetItem* theItem, @@ -700,9 +702,9 @@ void ParametersPlugin_WidgetParamsMgr::sendWarning() void ParametersPlugin_WidgetParamsMgr::onSelectionChanged() { + QList aItemsList = myTable->selectedItems(); bool isValid = checkIsValid(); if (isValid) { - QList aItemsList = myTable->selectedItems(); bool isParameter = false; foreach(QTreeWidgetItem* aItem, aItemsList) { if (aItem->parent() == myParameters) { @@ -711,15 +713,16 @@ void ParametersPlugin_WidgetParamsMgr::onSelectionChanged() } } myInsertBtn->setEnabled(isParameter); - myRemoveBtn->setEnabled(isParameter); + //myRemoveBtn->setEnabled(isParameter); myUpBtn->setEnabled(isParameter); myDownBtn->setEnabled(isParameter); } else { myInsertBtn->setEnabled(false); - myRemoveBtn->setEnabled(false); + //myRemoveBtn->setEnabled(false); myUpBtn->setEnabled(false); myDownBtn->setEnabled(false); } + myRemoveBtn->setEnabled(!aItemsList.isEmpty()); } void ParametersPlugin_WidgetParamsMgr::enableButtons(bool theEnable)