diff --git a/Base/QTGUI/Resources/UI/qSlicerSettingsViewsPanel.ui b/Base/QTGUI/Resources/UI/qSlicerSettingsViewsPanel.ui index f88c3efb7ac..2dbf94c25ba 100644 --- a/Base/QTGUI/Resources/UI/qSlicerSettingsViewsPanel.ui +++ b/Base/QTGUI/Resources/UI/qSlicerSettingsViewsPanel.ui @@ -54,28 +54,7 @@ - - - - none - - - - - cube - - - - - human - - - - - axes - - - + diff --git a/Base/QTGUI/qSlicerSettingsViewsPanel.cxx b/Base/QTGUI/qSlicerSettingsViewsPanel.cxx index 671e6068ef0..b96add85283 100644 --- a/Base/QTGUI/qSlicerSettingsViewsPanel.cxx +++ b/Base/QTGUI/qSlicerSettingsViewsPanel.cxx @@ -83,6 +83,11 @@ void qSlicerSettingsViewsPanelPrivate::init() qSlicerSettingsViewsPanel::tr("Multisampling (MSAA)"), ctkSettingsPanel::OptionRequireRestart); + this->SliceOrientationMarkerTypeComboBox->addItem(qSlicerSettingsViewsPanel::tr("none"), QString(/*no tr*/"none")); + this->SliceOrientationMarkerTypeComboBox->addItem(qSlicerSettingsViewsPanel::tr("cube"), QString(/*no tr*/"cube")); + this->SliceOrientationMarkerTypeComboBox->addItem(qSlicerSettingsViewsPanel::tr("human"), QString(/*no tr*/"human")); + this->SliceOrientationMarkerTypeComboBox->addItem(qSlicerSettingsViewsPanel::tr("axes"), QString(/*no tr*/"axes")); + QObject::connect(this->SliceOrientationMarkerTypeComboBox, SIGNAL(currentIndexChanged(QString)), q, SIGNAL(currentSliceOrientationMarkerTypeChanged(QString))); q->registerProperty("DefaultSliceView/OrientationMarkerType", q, @@ -292,11 +297,12 @@ void qSlicerSettingsViewsPanel::sliceViewOrientationChangedByUser() Q_D(qSlicerSettingsViewsPanel); if (d->SliceViewOrientationComboBox->currentUserDataAsString() == "PatientRightIsScreenRight") { - if (d->SliceOrientationMarkerTypeComboBox->currentText() == tr("none")) + if (d->SliceOrientationMarkerTypeComboBox->currentData() == /*no tr*/"none") { // Non-default orientation is chosen and no orientation marker is displayed. // To ensure that there is no accidental mixup of orientations, show the orientation marker. - d->SliceOrientationMarkerTypeComboBox->setCurrentText(tr("axes")); + int index = d->SliceOrientationMarkerTypeComboBox->findData(/*no tr*/"axes"); + d->SliceOrientationMarkerTypeComboBox->setCurrentIndex(index); } } }