From 4bcaa06896658cb71c67c796599aa4c11e479ad7 Mon Sep 17 00:00:00 2001 From: dnk-88 Date: Thu, 11 Nov 2010 16:44:01 +0200 Subject: [PATCH] Update: (ovqt) CBinOpDialogT not supported all operations. --- .../3d/object_viewer_qt/src/bin_op_dialog.cpp | 8 +------- .../tools/3d/object_viewer_qt/src/bin_op_dialog.h | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/bin_op_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/bin_op_dialog.cpp index 0093f6aa1..25d7b703a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/bin_op_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/bin_op_dialog.cpp @@ -39,13 +39,7 @@ CBinOpDialog::CBinOpDialog(QWidget *widget1, QWidget *widget2, QWidget *parent) setWindowTitle(tr("Bin operator")); _comboBox->clear(); - _comboBox->insertItems(0, QStringList() - << tr("SelectArg1") - << tr("SelectArg2") - << tr("Modulate") - << tr("Add") - << tr("Subtract")); - + qobject_cast(widget1)->setTitle(tr("Arg1")); qobject_cast(widget2)->setTitle(tr("Arg2")); connect(_comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setNewOp(int))); diff --git a/code/nel/tools/3d/object_viewer_qt/src/bin_op_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/bin_op_dialog.h index 67de55f6a..d95da0554 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/bin_op_dialog.h +++ b/code/nel/tools/3d/object_viewer_qt/src/bin_op_dialog.h @@ -96,14 +96,28 @@ public: _AttrbDlg[k]->setSchemeWrapper(&_SchemeWrapper[k]) ; _AttrbDlg[k]->init(); } + + static const char * const operators[] = + { + QT_TR_NOOP("Select Arg1"), + QT_TR_NOOP("Select Arg2"), + QT_TR_NOOP("Modulate"), + QT_TR_NOOP("Add"), + QT_TR_NOOP("Subtract"), + 0 + }; + _comboBox->blockSignals(true); for (k = 0 ; k < (uint) NL3D::CPSBinOp::last ; ++k) { if (_EditedScheme->supportOp( (NL3D::CPSBinOp::BinOp) k)) { + _comboBox->insertItem(_comboBox->count(), operators[k]); + if ((uint) _EditedScheme->getOp() == k) _comboBox->setCurrentIndex(k); } } + _comboBox->blockSignals(false); } ~CBinOpDialogT()