From f3f52814ff87e2f393ee06739ce6cc79a5dbaff1 Mon Sep 17 00:00:00 2001 From: nds Date: Mon, 30 Dec 2013 10:47:00 +0000 Subject: [PATCH] Refs #137 - UZ plane should be used in profile Text correction in the curve creation widget to show U/Z instead of X/Y --- src/HYDROCurveCreator/CurveCreator_TableView.cxx | 10 +++++++--- src/HYDROCurveCreator/CurveCreator_TableView.h | 3 ++- src/HYDROCurveCreator/CurveCreator_Widget.cxx | 3 ++- src/HYDROCurveCreator/CurveCreator_Widget.h | 1 + src/HYDROGUI/HYDROGUI_ProfileDlg.cxx | 6 ++++-- src/HYDROGUI/resources/HYDROGUI_msg_en.ts | 12 ++++++++++++ 6 files changed, 28 insertions(+), 7 deletions(-) diff --git a/src/HYDROCurveCreator/CurveCreator_TableView.cxx b/src/HYDROCurveCreator/CurveCreator_TableView.cxx index 56d3a507..b7567ab5 100644 --- a/src/HYDROCurveCreator/CurveCreator_TableView.cxx +++ b/src/HYDROCurveCreator/CurveCreator_TableView.cxx @@ -93,7 +93,9 @@ void CurveCreator_TableItemDelegate::setModelData( QWidget* theEditor, QItemDelegate::setModelData( theEditor, theModel, theIndex ); } -CurveCreator_TableView::CurveCreator_TableView( CurveCreator_ICurve* theCurve, QWidget* theParent ) +CurveCreator_TableView::CurveCreator_TableView( CurveCreator_ICurve* theCurve, + QWidget* theParent, + const QStringList& theCoordTitles ) : QTableWidget( theParent ), myCurve( theCurve ) { setItemDelegate( new CurveCreator_TableItemDelegate( this ) ); @@ -102,8 +104,10 @@ CurveCreator_TableView::CurveCreator_TableView( CurveCreator_ICurve* theCurve, Q setColumnWidth( 0, SECTION_NAME_COLUMN_WIDTH ); setColumnWidth( 1, POINT_INDEX_COLUMN_WIDTH ); QStringList aLabels; - //aLabels << tr( "SECTION_LABEL" ) << tr( "IDENTIFIER_LABEL" ) << tr( "X_POSITION_LBL" ) << tr( "Y_POSITION_LBL" ); - aLabels << tr( "Section" ) << "Index" << tr( "X" ) << tr( "Y" ); + QString aCoord1 = theCoordTitles.size() > 0 ? theCoordTitles[0] : tr( "X" ); // tr( "X_POSITION_LBL" ) + QString aCoord2 = theCoordTitles.size() > 1 ? theCoordTitles[1] : tr( "Y" ); // tr( "Y_POSITION_LBL" ) + //aLabels << tr( "SECTION_LABEL" ) << tr( "IDENTIFIER_LABEL" ) << aCoord1 << aCoord2; + aLabels << tr( "Section" ) << "Index" << aCoord1 << aCoord2; setHorizontalHeaderLabels( aLabels ); } diff --git a/src/HYDROCurveCreator/CurveCreator_TableView.h b/src/HYDROCurveCreator/CurveCreator_TableView.h index 4cf381ba..4565ab5d 100644 --- a/src/HYDROCurveCreator/CurveCreator_TableView.h +++ b/src/HYDROCurveCreator/CurveCreator_TableView.h @@ -42,7 +42,8 @@ public: class CurveCreator_TableView : public QTableWidget { public: - CurveCreator_TableView( CurveCreator_ICurve* theCurve, QWidget* theParent = 0 ); + CurveCreator_TableView( CurveCreator_ICurve* theCurve, QWidget* theParent = 0, + const QStringList& theCoordTitles = QStringList() ); ~CurveCreator_TableView() {}; void setCurve( CurveCreator_ICurve* theCurve ); diff --git a/src/HYDROCurveCreator/CurveCreator_Widget.cxx b/src/HYDROCurveCreator/CurveCreator_Widget.cxx index af71520e..aab8b1d2 100644 --- a/src/HYDROCurveCreator/CurveCreator_Widget.cxx +++ b/src/HYDROCurveCreator/CurveCreator_Widget.cxx @@ -79,6 +79,7 @@ CurveCreator_Widget::CurveCreator_Widget(QWidget* parent, CurveCreator_ICurve *theCurve, const int theActionFlags, + const QStringList& theCoordTitles, Qt::WindowFlags fl, int theLocalPointRowLimit ) : QWidget(parent), myNewSectionEditor(NULL), myCurve(theCurve), mySection(0), @@ -100,7 +101,7 @@ CurveCreator_Widget::CurveCreator_Widget(QWidget* parent, connect( mySectionView, SIGNAL(sectionEntered(int)), this, SLOT(onEditSection(int)) ); connect( mySectionView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(onContextMenu(QPoint)) ); - myLocalPointView = new CurveCreator_TableView( myCurve, this ); + myLocalPointView = new CurveCreator_TableView( myCurve, this, theCoordTitles ); connect( myLocalPointView, SIGNAL( cellChanged( int, int ) ), this, SLOT( onCellChanged( int, int ) ) ); diff --git a/src/HYDROCurveCreator/CurveCreator_Widget.h b/src/HYDROCurveCreator/CurveCreator_Widget.h index 2d4348cc..31b4db03 100644 --- a/src/HYDROCurveCreator/CurveCreator_Widget.h +++ b/src/HYDROCurveCreator/CurveCreator_Widget.h @@ -71,6 +71,7 @@ public: explicit CurveCreator_Widget( QWidget* parent, CurveCreator_ICurve *theCurve, const int theActionFlags = NoFlags, + const QStringList& theCoordTitles = QStringList(), Qt::WindowFlags fl=0, int theLocalPointRowLimit = 20); diff --git a/src/HYDROGUI/HYDROGUI_ProfileDlg.cxx b/src/HYDROGUI/HYDROGUI_ProfileDlg.cxx index e1de6f5c..f3bc6b9a 100644 --- a/src/HYDROGUI/HYDROGUI_ProfileDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_ProfileDlg.cxx @@ -59,7 +59,9 @@ HYDROGUI_ProfileDlg::HYDROGUI_ProfileDlg( HYDROGUI_Module* theModule, const QStr int anActionFlags = CurveCreator_Widget::DisableNewSection | CurveCreator_Widget::DisableDetectionMode | CurveCreator_Widget::DisableClosedSection; - myEditorWidget = new CurveCreator_Widget( this, NULL, anActionFlags ); + QStringList aCoordTitles; + aCoordTitles << tr( "U_TITLE" ) << tr( "Z_TITLE" ); + myEditorWidget = new CurveCreator_Widget( this, NULL, anActionFlags, aCoordTitles ); addWidget( myEditorWidget, 3 ); myAddElementBox = new QGroupBox( tr( "ADD_ELEMENT" ), this ); @@ -220,7 +222,7 @@ void HYDROGUI_ProfileDlg::onMouseMove( SUIT_ViewWindow* theViewWindow, QMouseEve // Show the coordinates QString aX = HYDROGUI_Tool::GetCoordinateString( aPnt.X() ); QString anY = HYDROGUI_Tool::GetCoordinateString( aPnt.Y() ); - myCoordLabel->setText( tr("COORDINATES_INFO").arg( aX ).arg( anY ) ); + myCoordLabel->setText( tr("UZ_COORDINATES_INFO").arg( aX ).arg( anY ) ); } } diff --git a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts index 471fcaf4..229abe5f 100644 --- a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts +++ b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts @@ -1418,6 +1418,18 @@ Would you like to remove all references from the image? PROFILE_NAME_TLT Name + + UZ_COORDINATES_INFO + U: %1, Z: %2 + + + U_TITLE + U + + + Z_TITLE + Z + -- 2.39.2