]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #658: display warning message "Note that in current settings the attributes...
authormkr <mkr@opencascade.com>
Wed, 25 Nov 2015 14:18:35 +0000 (17:18 +0300)
committermkr <mkr@opencascade.com>
Wed, 25 Nov 2015 14:18:35 +0000 (17:18 +0300)
src/HYDROGUI/HYDROGUI_ExportLandCoverMapDlg.cxx
src/HYDROGUI/HYDROGUI_ExportLandCoverMapDlg.h
src/HYDROGUI/resources/HYDROGUI_msg_en.ts

index 4c18253687d04cfb38a47a6de23f3e996c94887c..30fcc0c2b38f2869d07b75dff1e1b05c101ed617 100644 (file)
@@ -25,6 +25,7 @@
 #include <QComboBox>
 #include <QLabel>
 #include <QDoubleSpinBox>
+#include <QVBoxLayout>
 
 HYDROGUI_ExportLandCoverMapDlg::HYDROGUI_ExportLandCoverMapDlg( QWidget* theParent, bool IsLinear, const QStringList& theAttrItems )
   : QtxDialog( theParent, false, true, QtxDialog::OKCancel )
@@ -39,7 +40,11 @@ HYDROGUI_ExportLandCoverMapDlg::HYDROGUI_ExportLandCoverMapDlg( QWidget* thePare
   myAvFields->setEnabled(false);
   myAvFields->addItems( theAttrItems );
 
-  QGridLayout* aLayout = new QGridLayout( mainFrame() );
+  QVBoxLayout* aSketchLayout = new QVBoxLayout( mainFrame() );
+  aSketchLayout->setMargin( 0 );
+  aSketchLayout->setSpacing( 5 );
+
+  QGridLayout* aLayout = new QGridLayout();
   aLayout->setMargin( 5 );
   aLayout->setSpacing( 5 );
   aLayout->addWidget( myAttrCheckBox, 0, 0 );
@@ -64,9 +69,17 @@ HYDROGUI_ExportLandCoverMapDlg::HYDROGUI_ExportLandCoverMapDlg( QWidget* thePare
     myDiscrLabel = NULL;
   }
 
+  myWarningLabel = new QLabel( tr( "ATTRS_NOT_WRITTEN_TO_DBF" ), mainFrame() );
+  myWarningLabel->setStyleSheet("QLabel { font: italic; color : blue; }");
+  
+  aSketchLayout->addLayout( aLayout );
+  aSketchLayout->addWidget( myWarningLabel, 1, Qt::AlignHCenter );
+  aSketchLayout->addStretch(1);
+
   setMinimumSize( 300, 100 );
 
   connect( myAttrCheckBox, SIGNAL(clicked(bool)), this, SLOT(onAttrCBChecked(bool)));
+  connect( myAvFields, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(onAvFieldsChanged(const QString&)));
 
 }
 
@@ -80,6 +93,13 @@ void HYDROGUI_ExportLandCoverMapDlg::onAttrCBChecked( bool theState )
     myAvFields->setEnabled(true);
   else
     myAvFields->setEnabled(false);
+
+  myWarningLabel->setVisible( !theState || getCurrentItem().isEmpty() );
+}
+
+void HYDROGUI_ExportLandCoverMapDlg::onAvFieldsChanged(const QString& theText)
+{
+  myWarningLabel->setVisible( theText.isEmpty() );
 }
 
 QString HYDROGUI_ExportLandCoverMapDlg::getCurrentItem() const
index 005914f2957124c3375ae1b4dac06eaa1e27832e..71674c493cfb2911c62a552005bf37fb950b6131 100644 (file)
@@ -37,6 +37,7 @@ public:
 
 protected slots:
   void             onAttrCBChecked(bool theState);
+  void             onAvFieldsChanged(const QString& theText);
 
 public:
   QString          getCurrentItem() const; 
@@ -49,6 +50,7 @@ private:
   QLabel*          myDiscrLabel;
   QLabel*          myDeflLabel;
   QDoubleSpinBox*  myDeflSpinBox;
+  QLabel*          myWarningLabel;
 };
 
 #endif
index 31cc724d44470d92070f3c16a3ced8c6b7971c53..76fc98571891ab4ef45fb6997d7e388a0db0316e 100644 (file)
@@ -2441,6 +2441,10 @@ file cannot be correctly imported for an Obstacle definition.</translation>
       <source>WRITE_ST_AS_ATTRS_TO_DBF</source>
       <translation>Write Strickler Types as attributes values to DBF file</translation>
     </message>
+    <message>
+      <source>ATTRS_NOT_WRITTEN_TO_DBF</source>
+      <translation>Note that in current settings the attributes will NOT be written</translation>
+    </message>
     <message>
       <source>LCM_DISCR_LABEL</source>
       <translation>Current Land Cover Map contains at least one non-linear border. It will be exported in the discretization mode</translation>