]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #1400 + refs# 1399
authorisn <isn@opencascade.com>
Fri, 10 Nov 2017 10:31:20 +0000 (13:31 +0300)
committerisn <isn@opencascade.com>
Fri, 10 Nov 2017 10:31:20 +0000 (13:31 +0300)
src/HYDROGUI/HYDROGUI_ProfileOp.cxx
src/HYDROGUI/resources/HYDROGUI_msg_en.ts
src/HYDRO_tests/TestViewer.cxx
src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx

index c51ed3861cb1e8466b373924dc8ee4efacadbea6..fc470e6bf94d1dafcdb1206173cd5359863d7bbf 100644 (file)
@@ -269,13 +269,24 @@ void HYDROGUI_ProfileOp::onAddProfiles()
   }
 
   int NewLen = myEditedObjects.Length();
+  bool IsNewPoly = NewLen - ExistingProfLen;
+  if (aSelectedObj.IsEmpty())
+  {
+    SUIT_MessageBox::warning( module()->getApp()->desktop(), tr( "PROFILEOP_WARNING" ), tr ("PROFILES_ARE_NOT_SELECTED") );
+    return;
+  }
+  if (!IsNewPoly)
+  {
+    SUIT_MessageBox::warning( module()->getApp()->desktop(), tr( "PROFILEOP_WARNING" ), tr ("PROFILES_ALREADY_PRESENT") );
+    return;
+  }
   myProfiles.resize(myEditedObjects.Length());
   for (int i = myProfiles.size() - 1; i < myEditedObjects.Length(); i++)
     myProfiles[i] = new HYDROGUI_CurveCreatorProfile();
     
   HYDROGUI_ProfileDlg* aPanel = (HYDROGUI_ProfileDlg*)inputPanel();  
   QMap<HYDROGUI_CurveCreatorProfile*, QColor> CurveToColor;
-  if( NewLen - ExistingProfLen )
+  if( IsNewPoly )
   {
     //TODO move to ext func!
     for (int i = ExistingProfLen + 1; i <= NewLen; i++)
index 1d5d46a163a716a011d44737560c57228d40ae44..a2b588fe38848fbb686c905b99bb1997d4e2edcc 100644 (file)
@@ -2013,6 +2013,14 @@ Would you like to remove all references from the image?</translation>
       <source>PROFILEOP_WARNING</source>
       <translation>Warning</translation>
     </message>
+    <message>
+      <source>PROFILES_ALREADY_PRESENT</source>
+      <translation>All selected profile(s) are already present</translation>
+    </message>
+    <message>
+      <source>PROFILES_ARE_NOT_SELECTED</source>
+      <translation>Profile(s) are not selected</translation>
+    </message>
     <message>
       <source>PROFILE_RENAMING_NOTIF</source>
       <translation>The next profile(s) have been renamed:</translation>
@@ -2133,7 +2141,7 @@ Would you like to remove all references from the image?</translation>
       <translation>Z</translation>
     </message>
     <message>
-      <source>ADD_PROFILE</source>
+      <source>ADD_PROFILES</source>
       <translation>Add Profile(s)</translation>
     </message>
     <message>
index 080f9b9ddd8ad042c2c3f28c2defc55f125a90e8..28292718ec99f8ab7e760d84eb68e3aa2d188988 100644 (file)
@@ -367,6 +367,8 @@ void TestViewer::select( int theViewX, int theViewY )
   Handle(V3d_View) aView = myViewWindow->getViewPort()->getView();
   context()->MoveTo( theViewX, theViewY, aView );
   context()->Select();
+  // context()->ClearLocalContext();
+  // context()->CloseAllContexts();
 }
 
 QString GetLine( QFile& theFile, bool isUtf8 )
index ca87d407b85ea2fa8c8ac81c1c602a9a029f5447..21e0440a271663141dc04ffc731c644dd8578c62 100644 (file)
@@ -600,7 +600,7 @@ void test_HYDROData_LandCoverMap::test_land_cover_prs_by_types()
   TestViewer::show( aPrs, AIS_Shaded, 4, true, "LandCoverMap_PrsByTypes" );
   // select one of faces (first)
   TestViewer::select( 200, 300 );
-  CPPUNIT_ASSERT_IMAGES
// CPPUNIT_ASSERT_IMAGES
 
   aDoc->Close();
 }
@@ -807,7 +807,7 @@ void test_HYDROData_LandCoverMap::test_assign_to_calc_case()
 
   aDoc->Close();
 }
-
+#include <QTest>
 void test_HYDROData_LandCoverMap::test_shp_import_cyp()
 {
   Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1);
@@ -834,6 +834,7 @@ void test_HYDROData_LandCoverMap::test_shp_import_cyp()
 
   LCM->StoreLandCovers(aMapFace2ST);
   TestViewer::show( LCM->GetShape(), AIS_Shaded, true, "cyprus_natural_all" );
+  QTest::qWait(100000);
   CPPUNIT_ASSERT_IMAGES
   aDoc->Close();
 }