From 865daac8ae13fec8067a6a0f0da3370f6f97333e Mon Sep 17 00:00:00 2001 From: mkr Date: Wed, 25 Nov 2015 17:18:35 +0300 Subject: [PATCH] refs #658: display warning message "Note that in current settings the attributes will NOT be written", if "Write Strickler type as attribute" check box is unchecked or no attribute (empty) is chosen. --- .../HYDROGUI_ExportLandCoverMapDlg.cxx | 22 ++++++++++++++++++- src/HYDROGUI/HYDROGUI_ExportLandCoverMapDlg.h | 2 ++ src/HYDROGUI/resources/HYDROGUI_msg_en.ts | 4 ++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/HYDROGUI/HYDROGUI_ExportLandCoverMapDlg.cxx b/src/HYDROGUI/HYDROGUI_ExportLandCoverMapDlg.cxx index 4c182536..30fcc0c2 100644 --- a/src/HYDROGUI/HYDROGUI_ExportLandCoverMapDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_ExportLandCoverMapDlg.cxx @@ -25,6 +25,7 @@ #include #include #include +#include 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 diff --git a/src/HYDROGUI/HYDROGUI_ExportLandCoverMapDlg.h b/src/HYDROGUI/HYDROGUI_ExportLandCoverMapDlg.h index 005914f2..71674c49 100644 --- a/src/HYDROGUI/HYDROGUI_ExportLandCoverMapDlg.h +++ b/src/HYDROGUI/HYDROGUI_ExportLandCoverMapDlg.h @@ -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 diff --git a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts index 31cc724d..76fc9857 100644 --- a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts +++ b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts @@ -2441,6 +2441,10 @@ file cannot be correctly imported for an Obstacle definition. WRITE_ST_AS_ATTRS_TO_DBF Write Strickler Types as attributes values to DBF file + + ATTRS_NOT_WRITTEN_TO_DBF + Note that in current settings the attributes will NOT be written + LCM_DISCR_LABEL Current Land Cover Map contains at least one non-linear border. It will be exported in the discretization mode -- 2.39.2