From: rkv Date: Wed, 4 Dec 2013 07:02:35 +0000 (+0000) Subject: Fix for the feature #6: Update of objects (T 1.2): For objects which need updating... X-Git-Tag: BR_hydro_v_0_4~66 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=141b5c32908e3f89f9d5cfaa46872274397d6b9d;p=modules%2Fhydro.git Fix for the feature #6: Update of objects (T 1.2): For objects which need updating show exclamation sign and set blue bold italic font. --- diff --git a/src/HYDROGUI/HYDROGUI_DataObject.cxx b/src/HYDROGUI/HYDROGUI_DataObject.cxx index 64f579ff..a201b3e6 100644 --- a/src/HYDROGUI/HYDROGUI_DataObject.cxx +++ b/src/HYDROGUI/HYDROGUI_DataObject.cxx @@ -68,7 +68,10 @@ QFont HYDROGUI_DataObject::font( const int theId ) const { Handle(HYDROData_Entity) aDataObject = modelObject(); if( !aDataObject.IsNull() && aDataObject->IsMustBeUpdated() ) + { aFont.setItalic( true ); + aFont.setBold( true ); + } } return aFont; } @@ -83,11 +86,11 @@ QColor HYDROGUI_DataObject::color( const ColorRole theRole, const int theId ) co case Text: case Foreground: case Highlight: - aColor = QColor( 255, 0, 0 ); // red + aColor = Qt::red; // red break; case HighlightedText: // text color for the highlighted item - aColor = QColor( 255, 255, 255 ); // white + aColor = Qt::white; // white break; default: @@ -95,6 +98,29 @@ QColor HYDROGUI_DataObject::color( const ColorRole theRole, const int theId ) co } } + if ( !aColor.isValid() ) + { + Handle(HYDROData_Entity) aDataObject = modelObject(); + if( !aDataObject.IsNull() && aDataObject->IsMustBeUpdated() ) + { + switch ( theRole ) + { + case Text: + case Foreground: + case Highlight: + aColor = Qt::blue; // color for objects which need updating + break; + case HighlightedText: + // text color for the highlighted item + aColor = Qt::white; // white + break; + + default: + break; + } + } + } + if ( !aColor.isValid() ) { aColor = LightApp_DataObject::color( theRole, theId ); } @@ -115,7 +141,12 @@ QPixmap HYDROGUI_DataObject::icon( const int theId ) const } else { - anIcon = QObject::tr( QString("HYDRO_TYPE%1_ICO").arg( (int)aDataObject->GetKind() ).toAscii() ); + QString aNeedUpdate = ""; + if ( aDataObject->IsMustBeUpdated() ) + { + aNeedUpdate = "M_"; + } + anIcon = QObject::tr( QString("HYDRO_%1TYPE%2_ICO").arg( aNeedUpdate ).arg( (int)aDataObject->GetKind() ).toAscii() ); } return aResMgr->loadPixmap( "HYDRO", anIcon ); diff --git a/src/HYDROGUI/resources/HYDROGUI_images.ts b/src/HYDROGUI/resources/HYDROGUI_images.ts index c2b9f7a8..95830219 100644 --- a/src/HYDROGUI/resources/HYDROGUI_images.ts +++ b/src/HYDROGUI/resources/HYDROGUI_images.ts @@ -110,5 +110,95 @@ HYDRO_TYPE20_ICO icon_hydro_obj.png + + + PARTITION_M_ICO + icon_mpartition.png + + + HYDRO_M_TYPE0_ICO + icon_mhydro_obj.png + + + HYDRO_M_TYPE1_ICO + icon_mimage.png + + + HYDRO_M_TYPE2_ICO + icon_mpolyline.png + + + HYDRO_M_TYPE3_ICO + icon_mbathymetry.png + + + HYDRO_M_TYPE4_ICO + icon_mhydro_obj.png + + + HYDRO_M_TYPE5_ICO + icon_mhydro_obj.png + + + HYDRO_M_TYPE6_ICO + icon_mriver.png + + + HYDRO_M_TYPE7_ICO + icon_mstream.png + + + HYDRO_M_TYPE8_ICO + icon_mhydro_obj.png + + + HYDRO_M_TYPE9_ICO + icon_mhydro_obj.png + + + HYDRO_M_TYPE10_ICO + icon_mobstacle.png + + + HYDRO_M_TYPE11_ICO + icon_mhydro_obj.png + + + HYDRO_M_TYPE12_ICO + icon_mprofile.png + + + HYDRO_M_TYPE13_ICO + icon_mhydro_obj.png + + + HYDRO_M_TYPE14_ICO + icon_mpolyline_xy.png + + + HYDRO_M_TYPE15_ICO + icon_mcalculation.png + + + HYDRO_M_TYPE16_ICO + icon_mhydro_obj.png + + + HYDRO_M_TYPE17_ICO + icon_mhydro_obj.png + + + HYDRO_M_TYPE18_ICO + icon_mvis_state.png + + + HYDRO_M_TYPE19_ICO + icon_martobj.png + + + HYDRO_M_TYPE20_ICO + icon_mhydro_obj.png + + diff --git a/src/HYDROGUI/resources/icon_martobj.png b/src/HYDROGUI/resources/icon_martobj.png new file mode 100644 index 00000000..270282ef Binary files /dev/null and b/src/HYDROGUI/resources/icon_martobj.png differ diff --git a/src/HYDROGUI/resources/icon_mbathymetry.png b/src/HYDROGUI/resources/icon_mbathymetry.png new file mode 100644 index 00000000..37df5fa5 Binary files /dev/null and b/src/HYDROGUI/resources/icon_mbathymetry.png differ diff --git a/src/HYDROGUI/resources/icon_mcalculation.png b/src/HYDROGUI/resources/icon_mcalculation.png new file mode 100644 index 00000000..bdda4dc2 Binary files /dev/null and b/src/HYDROGUI/resources/icon_mcalculation.png differ diff --git a/src/HYDROGUI/resources/icon_mhydro_obj.png b/src/HYDROGUI/resources/icon_mhydro_obj.png new file mode 100644 index 00000000..1d95b593 Binary files /dev/null and b/src/HYDROGUI/resources/icon_mhydro_obj.png differ diff --git a/src/HYDROGUI/resources/icon_mimage.png b/src/HYDROGUI/resources/icon_mimage.png new file mode 100644 index 00000000..e27c6bcd Binary files /dev/null and b/src/HYDROGUI/resources/icon_mimage.png differ diff --git a/src/HYDROGUI/resources/icon_mobstacle.png b/src/HYDROGUI/resources/icon_mobstacle.png new file mode 100644 index 00000000..397fb292 Binary files /dev/null and b/src/HYDROGUI/resources/icon_mobstacle.png differ diff --git a/src/HYDROGUI/resources/icon_mpartition.png b/src/HYDROGUI/resources/icon_mpartition.png new file mode 100644 index 00000000..4c249428 Binary files /dev/null and b/src/HYDROGUI/resources/icon_mpartition.png differ diff --git a/src/HYDROGUI/resources/icon_mpolyline.png b/src/HYDROGUI/resources/icon_mpolyline.png new file mode 100644 index 00000000..72cd0f6e Binary files /dev/null and b/src/HYDROGUI/resources/icon_mpolyline.png differ diff --git a/src/HYDROGUI/resources/icon_mpolyline_xy.png b/src/HYDROGUI/resources/icon_mpolyline_xy.png new file mode 100644 index 00000000..8c69bfd0 Binary files /dev/null and b/src/HYDROGUI/resources/icon_mpolyline_xy.png differ diff --git a/src/HYDROGUI/resources/icon_mprofile.png b/src/HYDROGUI/resources/icon_mprofile.png new file mode 100644 index 00000000..5f3d54a7 Binary files /dev/null and b/src/HYDROGUI/resources/icon_mprofile.png differ diff --git a/src/HYDROGUI/resources/icon_mriver.png b/src/HYDROGUI/resources/icon_mriver.png new file mode 100644 index 00000000..5cc452c3 Binary files /dev/null and b/src/HYDROGUI/resources/icon_mriver.png differ diff --git a/src/HYDROGUI/resources/icon_mstream.png b/src/HYDROGUI/resources/icon_mstream.png new file mode 100644 index 00000000..684a2b13 Binary files /dev/null and b/src/HYDROGUI/resources/icon_mstream.png differ diff --git a/src/HYDROGUI/resources/icon_mvis_state.png b/src/HYDROGUI/resources/icon_mvis_state.png new file mode 100644 index 00000000..c2d95eb1 Binary files /dev/null and b/src/HYDROGUI/resources/icon_mvis_state.png differ