(ui): default confirmation message on action is redundant
Description
When activating confirmation dialog on an action, the default message Do you really want to execute this action ?
is displayed even if a custom message is configured.
Proposal
Use the default message only if the custom message is not configured.
@@ -304,13 +304,12 @@ bool IAction::confirmAction()
{
::fwGui::dialog::MessageDialog dialog;
dialog.setTitle("Confirmation");
- std::stringstream ss;
- ss << "Do you really want to execute this action ? ";
- if (!m_confirmMessage.empty())
+ std::string message = m_confirmMessage;
+ if (message.empty())
{
- ss << std::endl << m_confirmMessage;
+ message = "Do you really want to execute this action ?"
}
- dialog.setMessage( ss.str() );
+ dialog.setMessage( message );
if(m_defaultButton == "yes")
{
Outcomes
The message will be more readable.