bool prevBlock = myBathymetryChoice->blockSignals( true );
myCurrentZone = aZone;
myBathymetryChoice->clear();
- myBathymetryChoice->addItem( QObject::tr("MERGE_UNKNOWN"), HYDROData_Zone::Merge_UNKNOWN );
- myBathymetryChoice->addItem( QObject::tr("MERGE_ZMIN"), HYDROData_Zone::Merge_ZMIN );
- myBathymetryChoice->addItem( QObject::tr("MERGE_ZMAX"), HYDROData_Zone::Merge_ZMAX );
+ myBathymetryChoice->addItem( tr("MERGE_UNKNOWN"), HYDROData_Zone::Merge_UNKNOWN );
+ myBathymetryChoice->addItem( tr("MERGE_ZMIN"), HYDROData_Zone::Merge_ZMIN );
+ myBathymetryChoice->addItem( tr("MERGE_ZMAX"), HYDROData_Zone::Merge_ZMAX );
QStringList aList = aZone->getBathymetries();
for ( int i = 0; i < aList.length(); i++ )
{
aCurIndex = 2;
break;
case HYDROData_Zone::Merge_Object:
- aCurIndex = aList.indexOf( aZone->text( HYDROGUI_DataObject::BathymetryId ) );
+ aCurIndex = 3 + aList.indexOf( aZone->text( HYDROGUI_DataObject::BathymetryId ) );
break;
default:
aCurIndex = 0; // Select unknown by default
HYDROGUI_Zone* HYDROGUI_CalculationDlg::getCurrentZone() const
{
return myCurrentZone;
+}
+
+void HYDROGUI_CalculationDlg::refreshZonesBrowser()
+{
+ myBrowser->updateTree();
}
\ No newline at end of file
public slots:
void onEmptyName();
void onAlreadyExists( QString theName );
+ void refreshZonesBrowser();
/**
* Process items selection: hide/show bathymetry merge type selector.
*/
{
aZone->setMergeType( theMergeType, theBathymetryName );
}
+ aPanel->refreshZonesBrowser();
}
}
if ( !aZone.IsNull() )
{
HYDROData_SequenceOfObjects aSeq = aZone->GetGeometryObjects();
- if ( aZone->IsMergingNeed() || aSeq.Length() == 1 )
+ if ( ( aZone->IsMergingNeed() && aZone->GetMergeType() == HYDROData_Zone::Merge_UNKNOWN )
+ || aSeq.Length() == 1 )
{
// Collect all used bathymetries names when merging is necessary
// or just get the name of bathymetry of a single geometry object
{
// Implement red color for bathymetry conflicts in case creation dialog
QColor aRes;
- if( isMergingNeed() )
+ Handle(HYDROData_Zone) aZone = Handle(HYDROData_Zone)::DownCast( modelObject() );
+ if ( !aZone.IsNull() )
{
- switch( theColorRole )
+ if ( ( aZone->IsMergingNeed() && aZone->GetMergeType() == HYDROData_Zone::Merge_UNKNOWN ) )
{
- case Text: // editor foreground (text) color
- case Foreground: // foreground (text) color
- aRes = Qt::red;
- break;
- case HighlightedText: // highlighted foreground (text) color
- aRes = Qt::black;
- break;
- case Base: // editor background color
- case Background: // background color
- case Highlight: // highlight background color
- default:
- aRes = Qt::red;
+ switch( theColorRole )
+ {
+ case Text: // editor foreground (text) color
+ case Foreground: // foreground (text) color
+ aRes = Qt::red;
+ break;
+ case HighlightedText: // highlighted foreground (text) color
+ aRes = Qt::black;
+ break;
+ case Base: // editor background color
+ case Background: // background color
+ case Highlight: // highlight background color
+ default:
+ aRes = Qt::red;
+ }
}
}
- else
+ if ( !aRes.isValid() )
{
aRes = LightApp_DataObject::color( theColorRole, theColumnId );
}