Salome HOME
Refs #137 - UZ plane should be used in profile
authornds <nds@opencascade.com>
Mon, 30 Dec 2013 10:47:00 +0000 (10:47 +0000)
committernds <nds@opencascade.com>
Mon, 30 Dec 2013 10:47:00 +0000 (10:47 +0000)
Text correction in the curve creation widget to show U/Z instead of X/Y

src/HYDROCurveCreator/CurveCreator_TableView.cxx
src/HYDROCurveCreator/CurveCreator_TableView.h
src/HYDROCurveCreator/CurveCreator_Widget.cxx
src/HYDROCurveCreator/CurveCreator_Widget.h
src/HYDROGUI/HYDROGUI_ProfileDlg.cxx
src/HYDROGUI/resources/HYDROGUI_msg_en.ts

index 56d3a507e9f7cbcf01a4a80ad54bf042068aebbc..b7567ab5752ec3ec826212f43329660f5e057eb8 100644 (file)
@@ -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 );
 }
 
index 4cf381ba7d1baf683ff4a81184a2e05347afda94..4565ab5d7ad4774e48cfae5f993c64381066bfa0 100644 (file)
@@ -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 );
index af71520e178ac355e8bc459b3aa03cf3f61831ad..aab8b1d2ce3cf46fc11e7e005e0190e4f6b9990b 100644 (file)
@@ -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 ) ) );
 
index 2d4348cc2152b18e7af00416684274b8fe392f60..31b4db039e842234c039fda0e007ce125c1378f1 100644 (file)
@@ -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);
 
index e1de6f5c6ce552b3459ba7e8adda12e8be6fecbc..f3bc6b9aef7e89239bb8041ab96ec8f2036df3c1 100644 (file)
@@ -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 ) );
   }
 }
 
index 471fcaf4be233fcfbda93d64b9a522788e630cd4..229abe5fcb6f411eaae6839dc81129053fa02b57 100644 (file)
@@ -1418,6 +1418,18 @@ Would you like to remove all references from the image?</translation>
       <source>PROFILE_NAME_TLT</source>
       <translation>Name</translation>
     </message>
+    <message>
+      <source>UZ_COORDINATES_INFO</source>
+      <translation>U: %1, Z: %2</translation>
+    </message>
+    <message>
+      <source>U_TITLE</source>
+      <translation>U</translation>
+    </message>
+    <message>
+      <source>Z_TITLE</source>
+      <translation>Z</translation>
+    </message>
   </context>
 
   <context>