Commit 5dd307fa authored by Andi Fischer's avatar Andi Fischer Committed by Ralf Habacker
Browse files

Double click on a state other than initial, normal or end crashed the application.

Fixed by using a string instead of an array.

BUG: 324192
CCBUG: 324192
FIXED-IN:4.11.3

Conflicts:
	umbrello/dialogs/statedialog.cpp
parent 4340fb1c
......@@ -111,9 +111,6 @@ void StateDialog::applyPage( KPageWidgetItem*item )
*/
void StateDialog::setupGeneralPage()
{
QString types[ ] = { i18nc("initial state in statechart", "Initial state"),
i18nc("state in statechart", "State"),
i18nc("end state in statechart", "End state") };
StateWidget::StateType type = m_pStateWidget->stateType();
KVBox * page = new KVBox();
......@@ -128,10 +125,43 @@ void StateDialog::setupGeneralPage()
generalLayout->setSpacing( spacingHint() );
generalLayout->setMargin( fontMetrics().height() );
Dialog_Utils::makeLabeledEditField( m_GenPageWidgets.generalGB, generalLayout, 0,
m_GenPageWidgets.typeL, i18n("State type:"),
m_GenPageWidgets.typeLE, types[ (int)type ] );
m_GenPageWidgets.typeLE->setEnabled( false );
QString typeStr;
switch (type) {
case StateWidget::Initial:
typeStr = i18nc("initial state in statechart", "Initial state");
break;
case StateWidget::Normal:
typeStr = i18nc("state in statechart", "State");
break;
case StateWidget::End:
typeStr = i18nc("end state in statechart", "End state");
break;
case StateWidget::Fork:
typeStr = i18nc("fork state in statechart", "Fork");
break;
case StateWidget::Join:
typeStr = i18nc("join state in statechart", "Join");
break;
case StateWidget::Junction:
typeStr = i18nc("junction state in statechart", "Junction");
break;
case StateWidget::DeepHistory:
typeStr = i18nc("deep history state in statechart", "DeepHistory");
break;
case StateWidget::ShallowHistory:
typeStr = i18nc("shallow history state in statechart", "ShallowHistory");
break;
case StateWidget::Choice:
typeStr = i18nc("choice state in statechart", "Choice");
break;
default:
typeStr = "???";
break;
}
Dialog_Utils::makeLabeledEditField(m_GenPageWidgets.generalGB, generalLayout, 0,
m_GenPageWidgets.typeL, i18n("State type:"),
m_GenPageWidgets.typeLE, typeStr);
m_GenPageWidgets.typeLE->setEnabled(false);
Dialog_Utils::makeLabeledEditField( m_GenPageWidgets.generalGB, generalLayout, 1,
m_GenPageWidgets.nameL, i18n("State name:"),
......
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