From 81784bf6dd319382bc1bba0b0af21e46c32dc242 Mon Sep 17 00:00:00 2001 From: asl Date: Thu, 21 Sep 2017 11:50:55 +0300 Subject: [PATCH] refs #1330: draft preferences implementation for polyline arrow --- src/HYDROGUI/HYDROGUI_Module.cxx | 22 ++++++++++++++++++++++ src/HYDROGUI/resources/HYDROGUI_msg_en.ts | 13 ++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/HYDROGUI/HYDROGUI_Module.cxx b/src/HYDROGUI/HYDROGUI_Module.cxx index 4f8eeafd..aca7491c 100644 --- a/src/HYDROGUI/HYDROGUI_Module.cxx +++ b/src/HYDROGUI/HYDROGUI_Module.cxx @@ -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 indices; + indices.append( 0 ); + indices.append( 1 ); + indices.append( 2 ); + setPreferenceProperty( polylineArrow, "indexes", indices ); + QList 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 ); } diff --git a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts index 82ce2e0f..0ce36266 100644 --- a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts +++ b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts @@ -1819,7 +1819,18 @@ Would you like to remove all references from the image? STB_LC_SCALARMAP_COLORING_OFF Scalar map mode off - + + PREF_GROUP_POLYLINES + Polylines + + + PREF_POLYLINE_ARROW + Polyline arrow + + + PREF_POLYLINE_ARROW_SIZE + Polyline arrow size + -- 2.39.2