Salome HOME
refs #430: incorrect coordinates in dump polyline
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ZLevelsDlg.cxx
index aac2cc2e14b3374a6ca7dab1f32467d349e041f7..5511c6695edf50e91b0faf8a5ce38ab15a8410c5 100644 (file)
 HYDROGUI_ZLevelsDlg::HYDROGUI_ZLevelsDlg( QWidget* theParent, HYDROGUI_Module* theModule )
 : QDialog( theParent )
 {
+  // Change windows flags to remove minimize button
+  Qt::WindowFlags aFlags = windowFlags();
+  aFlags |= Qt::CustomizeWindowHint;
+  aFlags &= ~Qt::WindowMinimizeButtonHint;
+  aFlags &= ~Qt::WindowMaximizeButtonHint;
+  setWindowFlags( aFlags );
+
   // Dialog title
   setWindowTitle( tr( "CHANGE_LAYER_ORDER" ) );
 
@@ -57,6 +64,7 @@ HYDROGUI_ZLevelsDlg::HYDROGUI_ZLevelsDlg( QWidget* theParent, HYDROGUI_Module* t
 
   // Apply and close buttons
   myApply = new QPushButton( tr("APPLY") );
+  myApply->setDefault( true );
   myClose = new QPushButton( tr("CLOSE") );
   
   // Layout
@@ -74,14 +82,16 @@ HYDROGUI_ZLevelsDlg::HYDROGUI_ZLevelsDlg( QWidget* theParent, HYDROGUI_Module* t
   connect( myAllObjects, SIGNAL( stateChanged( int ) ), this, SLOT( onStateChanged() ) );
 
   connect( myApply, SIGNAL( clicked() ), this, SIGNAL( applyOrder() ) );
-  connect( myClose, SIGNAL( clicked() ), this, SLOT( close() ) );
+  connect( myClose, SIGNAL( clicked() ), this, SLOT( reject() ) );
 
   // Initialize
   onStateChanged();
 
   // Create selector
   if ( theModule ) {
-    new HYDROGUI_ListSelector( myListWidget, theModule->getApp()->selectionMgr() );
+    HYDROGUI_ListSelector* aListSelector = 
+      new HYDROGUI_ListSelector( myListWidget, theModule->getApp()->selectionMgr() );
+    aListSelector->setAutoBlock( true );
   }
 }
 
@@ -116,5 +126,10 @@ QList<Handle(HYDROData_Entity)> HYDROGUI_ZLevelsDlg::getObjects() const
 void HYDROGUI_ZLevelsDlg::onStateChanged()
 {
   bool isAll = myAllObjects->isChecked();
+
+  QString aToolTip = isAll ? tr( "ALL_OBJECTS_CHECKED_TLT" ) :
+                             tr( "ALL_OBJECTS_UNCHECKED_TLT" );
+  myAllObjects->setToolTip( aToolTip );
+
   myListWidget->setHiddenObjectsShown( isAll );
 }