]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #1330: draft preferences implementation for polyline arrow
authorasl <asl@opencascade.com>
Thu, 21 Sep 2017 08:50:55 +0000 (11:50 +0300)
committerasl <asl@opencascade.com>
Thu, 21 Sep 2017 08:50:55 +0000 (11:50 +0300)
src/HYDROGUI/HYDROGUI_Module.cxx
src/HYDROGUI/resources/HYDROGUI_msg_en.ts

index 4f8eeafda2d0bed2919de47c478ef355ea9609ab..aca7491c21c4ddfd4ddc716aa3d334ac9566d566 100644 (file)
@@ -831,6 +831,24 @@ void HYDROGUI_Module::createPreferences()
   setPreferenceProperty( defaultStricklerCoef, "min", 0.00 );
   setPreferenceProperty( defaultStricklerCoef, "max", 1000000.00 );
   setPreferenceProperty( defaultStricklerCoef, "step", 0.01 );
+
+  int polylinesGroup = addPreference( tr( "PREF_GROUP_POLYLINES" ), genTab );
+  int polylineArrow = addPreference( tr( "PREF_POLYLINE_ARROW" ), polylinesGroup,
+    LightApp_Preferences::Selector, "polyline", "arrow_type" );
+
+  QList<QVariant> indices;
+  indices.append( 0 );
+  indices.append( 1 );
+  indices.append( 2 );
+  setPreferenceProperty( polylineArrow, "indexes", indices );
+  QList<QVariant> arrow_types;
+  arrow_types.append( tr( "No" ) );
+  arrow_types.append( tr( "Triangle" ) );
+  arrow_types.append( tr( "Cone" ) );
+  setPreferenceProperty( polylineArrow, "strings", arrow_types );
+
+  int polylineSize = addPreference( tr( "PREF_POLYLINE_ARROW_SIZE" ), polylinesGroup,
+    LightApp_Preferences::IntSpin, "polyline", "arrow_size" );
 }
 
 void HYDROGUI_Module::preferencesChanged( const QString& theSection, const QString& thePref )
@@ -842,6 +860,10 @@ void HYDROGUI_Module::preferencesChanged( const QString& theSection, const QStri
         if ( resMgr && !aDoc.IsNull() )
             aDoc->SetDefaultStricklerCoefficient( resMgr->doubleValue( theSection, thePref, 0 ) );
     }
+    else if( theSection == "polyline" )
+    {
+      //TODO: update polylines
+    }
     else
         LightApp_Module::preferencesChanged( theSection, thePref );
 }
index 82ce2e0f3f976d573a6453fa8db135b699b1052f..0ce362666ad6b6abcf69da15e3f2bfedc1137d3f 100644 (file)
@@ -1819,7 +1819,18 @@ Would you like to remove all references from the image?</translation>
       <source>STB_LC_SCALARMAP_COLORING_OFF</source>
       <translation>Scalar map mode off</translation>
     </message>
-
+    <message>
+      <source>PREF_GROUP_POLYLINES</source>
+      <translation>Polylines</translation>
+    </message>
+    <message>
+      <source>PREF_POLYLINE_ARROW</source>
+      <translation>Polyline arrow</translation>
+    </message>
+    <message>
+      <source>PREF_POLYLINE_ARROW_SIZE</source>
+      <translation>Polyline arrow size</translation>
+    </message>
   </context>
   
   <context>