Salome HOME
Feature #86: The hierarchy in the Object Browser (T 19).
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ImportImageDlg.cxx
index eaba5358b72a56eabf55dbec193f8e7d8e1c71ce..d389433fa1bc9d865d9905f96e44b3956f160faa 100644 (file)
@@ -176,9 +176,12 @@ HYDROGUI_ImportImageDlg::HYDROGUI_ImportImageDlg( HYDROGUI_Module* theModule, co
     QLabel* aPointYMinLabel = new QLabel( "'", myTransformGroup );
     QLabel* aPointXSecLabel = new QLabel( "\"", myTransformGroup );
     QLabel* aPointYSecLabel = new QLabel( "\"", myTransformGroup );
+    QLabel* aPointLatLabel = new QLabel( tr( "POINT_LATITUDE" ), myTransformGroup );
+    QLabel* aPointLonLabel = new QLabel( tr( "POINT_LONGITUDE" ), myTransformGroup );
     myGeodesicLabels << aPointXDegLabel << aPointYDegLabel
                     << aPointXMinLabel << aPointYMinLabel
-                    << aPointXSecLabel << aPointYSecLabel;
+                    << aPointXSecLabel << aPointYSecLabel
+                    << aPointLatLabel << aPointLonLabel;
 
     QtxIntSpinBox* aPointXDeg = new QtxIntSpinBox( -180, 180, 1, myTransformGroup );
     QtxIntSpinBox* aPointYDeg = new QtxIntSpinBox( 0, 90, 1, myTransformGroup );
@@ -198,11 +201,11 @@ HYDROGUI_ImportImageDlg::HYDROGUI_ImportImageDlg( HYDROGUI_Module* theModule, co
     {
       myPointCEnabler = new QCheckBox( myTransformGroup );
       aTransformLayout->addWidget( myPointCEnabler, aRow,    0, 1, 2, Qt::AlignHCenter );
-      aTransformLayout->addWidget( aPointBtn,      aRow,     2, 1, 7 );
+      aTransformLayout->addWidget( aPointBtn,      aRow,     2, 1, 8 );
     }
     else
     {
-      aTransformLayout->addWidget( aPointBtn,      aRow,     0, 1, 9 );
+      aTransformLayout->addWidget( aPointBtn,      aRow,     0, 1, 10 );
     }
 
     aTransformLayout->addWidget( aPointXLabel,     aRow + 1, 0 );
@@ -214,6 +217,7 @@ HYDROGUI_ImportImageDlg::HYDROGUI_ImportImageDlg( HYDROGUI_Module* theModule, co
     aTransformLayout->addWidget( aPointXMinLabel,  aRow + 1, 6 );
     aTransformLayout->addWidget( aPointXSec,       aRow + 1, 7 );
     aTransformLayout->addWidget( aPointXSecLabel,  aRow + 1, 8 );
+    aTransformLayout->addWidget( aPointLatLabel,   aRow + 1, 9 );
 
     aTransformLayout->addWidget( aCartPointX,      aRow + 1, 3, 1, 6 );
     aTransformLayout->addWidget( aRefPointX,       aRow + 1, 3, 1, 6 );
@@ -226,6 +230,7 @@ HYDROGUI_ImportImageDlg::HYDROGUI_ImportImageDlg( HYDROGUI_Module* theModule, co
     aTransformLayout->addWidget( aPointYMinLabel,  aRow + 2, 6 );
     aTransformLayout->addWidget( aPointYSec,       aRow + 2, 7 );
     aTransformLayout->addWidget( aPointYSecLabel,  aRow + 2, 8 );
+    aTransformLayout->addWidget( aPointLonLabel,   aRow + 2, 9 );
 
     aTransformLayout->addWidget( aCartPointY,      aRow + 2, 3, 1, 6 );
     aTransformLayout->addWidget( aRefPointY,       aRow + 2, 3, 1, 6 );
@@ -235,7 +240,7 @@ HYDROGUI_ImportImageDlg::HYDROGUI_ImportImageDlg( HYDROGUI_Module* theModule, co
       QFrame* aLine = new QFrame( myTransformGroup );
       aLine->setFrameShape( QFrame::HLine );
       aLine->setFrameShadow( QFrame::Sunken );
-      aTransformLayout->addWidget( aLine, aRow + 3, 0, 1, 9 );
+      aTransformLayout->addWidget( aLine, aRow + 3, 0, 1, 10 );
     }
 
     myPointBtnMap[ aPointType ] = aPointBtn;
@@ -288,6 +293,8 @@ HYDROGUI_ImportImageDlg::HYDROGUI_ImportImageDlg( HYDROGUI_Module* theModule, co
   connect( myPointCEnabler, SIGNAL( toggled( bool ) ), myRefPointXMap[ HYDROGUI_PrsImage::PointC ], SLOT( setEnabled( bool ) ) );
   connect( myPointCEnabler, SIGNAL( toggled( bool ) ), myRefPointYMap[ HYDROGUI_PrsImage::PointC ], SLOT( setEnabled( bool ) ) );
 
+  connect( myPointCEnabler, SIGNAL( toggled( bool ) ), SLOT( onSetCIsUsed( bool ) ) );
+
   aTransformLayout->setColumnStretch( 1, 1 ); // double
   aTransformLayout->setColumnStretch( 3, 1 ); // degrees
   aTransformLayout->setColumnStretch( 5, 1 ); // minutes
@@ -316,6 +323,16 @@ HYDROGUI_ImportImageDlg::~HYDROGUI_ImportImageDlg()
 {
 }
 
+void HYDROGUI_ImportImageDlg::onSetCIsUsed( bool theCIsUsed )
+{
+  if ( !theCIsUsed  && myPointBtnMap[ HYDROGUI_PrsImage::PointC ]->isChecked() )
+  {
+    // Turn on point A selection if point C selection has been activated and we disable point C.
+    myPointBtnMap[ HYDROGUI_PrsImage::PointA ]->toggle();
+  }
+  emit setCIsUsed( theCIsUsed );
+}
+
 void HYDROGUI_ImportImageDlg::setIsEdit( const bool theIsEdit )
 {
   myFileNameGroup->setVisible( !theIsEdit );