Commit 8e593b1c authored by Manuel Grizonnet's avatar Manuel Grizonnet

BUG: fix issue !1639 Update UserValue flag when a parameter is modified in...

BUG: fix issue !1639 Update UserValue flag when a parameter is modified in QtWidgetParameterList widget

The QtWidgetParameterList widget should signal that an input parameter as been
modify by the user.Then, it set the UserValue flag from the corresponding parameter to
True.
It was spotted as the UserValue flag is used by the ParseApplication method used
to list parameter modified by the user in the GUI which is used to build the
corresponding command-line from the application GUI (displayed in the Log tab).
parent b5a80681
......@@ -135,6 +135,7 @@ signals:
/** */
void Updated();
void ValueChanged();
/*-[ PROTECTED SECTION ]---------------------------------------------------*/
//
......
......@@ -619,6 +619,11 @@ ListEditWidget
assert( GetItemModel()!=nullptr );
//Notify the ParameterList that the parameter has been modified (UserValue)
// ParameterList is not available in this class, transfer the signal to WidgetParameterList
emit ValueChanged();
//Then, trigger the update the application parameters
emit Updated();
}
......
......@@ -130,13 +130,13 @@ QtWidgetModel
OutputProcessXMLParameter::Pointer outXMLParam = OutputProcessXMLParameter::New();
TiXmlElement* XMLAppElement = outXMLParam->ParseApplication(m_Application);
//Create command line from the XML document
TiXmlElement * pName, *pParam;
std::ostringstream cmdLine;
cmdLine << "";
if(XMLAppElement)
{
pName = XMLAppElement->FirstChildElement("name");
......@@ -149,10 +149,10 @@ QtWidgetModel
//Parse application parameters
pParam = XMLAppElement->FirstChildElement("parameter");
while(pParam)
{
//Get pareter key
//Get parameter key
cmdLine << "-";
cmdLine << pParam->FirstChildElement("key")->GetText();
cmdLine << " ";
......@@ -169,8 +169,8 @@ QtWidgetModel
{
cmdLine << pValue->GetText();
cmdLine << " ";
pValue = pValue->NextSiblingElement(); // iteration over multiple values
pValue = pValue->NextSiblingElement(); // iteration over multiple values
}
}
else
......@@ -188,13 +188,13 @@ QtWidgetModel
cmdLine << " ";
}
}
pParam = pParam->NextSiblingElement(); // iteration over parameters
}
//Insert a new line character at the end of the command line
cmdLine << std::endl;
//Report the command line string to the application logger
m_Application->GetLogger()->Write(itk::LoggerBase::INFO, cmdLine.str());
}
......
......@@ -83,7 +83,13 @@ QtWidgetParameterList
setLayout( gLayout );
//
// Connections.
// Connections (Update UserValue flag).
QObject::connect(
widget, &ListEditWidget::ValueChanged,
this, [=] () { emit ParameterChanged( GetParam()->GetKey() ); }
);
// Connections (Update app parameters).
QObject::connect(
widget, SIGNAL( Updated() ),
this, SIGNAL( NotifyUpdate() )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment