+
+ if( isRoot )
+ theMenu->addAction( action( EditLocalCSId ) );
+
+ if( anIsObjectBrowser && anOwners.size()==1 )
+ {
+ if( aSeq.Size() > 0 )
+ {
+ Handle( HYDROData_Object ) anObject = Handle( HYDROData_Object )::DownCast( aSeq.First() );
+ if( !anObject.IsNull() )
+ {
+ theMenu->addSeparator();
+ theMenu->addAction( action( SubmersibleId ) );
+ action( SubmersibleId )->setCheckable( true );
+ action( SubmersibleId )->setChecked( anObject->IsSubmersible() );
+ }
+ }
+ }
+}
+
+void HYDROGUI_Module::createPreferences()
+{
+ int genTab = addPreference( tr( "PREF_TAB_GENERAL" ) );
+ int CursorGroup = addPreference( tr( "PREF_GROUP_CURSOR" ), genTab );
+
+ int typeOfCursor = addPreference( tr( "PREF_TYPE_OF_CURSOR" ), CursorGroup,
+ LightApp_Preferences::Selector, "preferences", "type_of_cursor" );
+
+ // Set property cursor type
+ QList<QVariant> aCursorTypeIndicesList;
+ QList<QVariant> aCursorTypeIconsList;
+
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+ for ( int i = CT_ArrowCursor; i < CT_User; i++ ) {
+ QString icoFile = QString( "ICON_CURSOR_%1" ).arg( i+1 );
+ QPixmap pixmap = resMgr->loadPixmap( "HYDRO", tr( qPrintable( icoFile ) ) );
+ aCursorTypeIndicesList << i;
+ aCursorTypeIconsList << pixmap;
+ }
+
+ setPreferenceProperty( typeOfCursor, "indexes", aCursorTypeIndicesList );
+ setPreferenceProperty( typeOfCursor, "icons", aCursorTypeIconsList );
+
+ int viewerGroup = addPreference( tr( "PREF_GROUP_VIEWER" ), genTab );
+ addPreference( tr( "PREF_VIEWER_AUTO_FITALL" ), viewerGroup,
+ LightApp_Preferences::Bool, "HYDRO", "auto_fit_all" );
+
+ int StricklerTableGroup = addPreference( tr( "PREF_GROUP_STRICKLER_TABLE" ), genTab );
+ int defaultStricklerCoef = addPreference( tr( "PREF_DEFAULT_STRICKLER_COEFFICIENT" ), StricklerTableGroup,
+ LightApp_Preferences::DblSpin, "preferences", "default_strickler_coefficient" );
+ setPreferenceProperty( defaultStricklerCoef, "precision", 2 );
+ setPreferenceProperty( defaultStricklerCoef, "min", 0.00 );
+ setPreferenceProperty( defaultStricklerCoef, "max", 1000000.00 );
+ setPreferenceProperty( defaultStricklerCoef, "step", 0.01 );
+}
+
+void HYDROGUI_Module::preferencesChanged( const QString& theSection, const QString& thePref )
+{
+ if ( theSection == "preferences" && thePref == "default_strickler_coefficient" )
+ {
+ SUIT_ResourceMgr* resMgr = application()->resourceMgr();
+ Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( application()->activeStudy()->id() );
+ if ( resMgr && !aDoc.IsNull() )
+ aDoc->SetDefaultStricklerCoefficient( resMgr->doubleValue( theSection, thePref, 0 ) );
+ }
+ else
+ LightApp_Module::preferencesChanged( theSection, thePref );
+}
+
+QCursor HYDROGUI_Module::getPrefEditCursor() const
+{
+ int aCursorType = SUIT_Session::session()->resourceMgr()->integerValue("preferences", "type_of_cursor", (int)CT_CrossCursor );
+ if ( aCursorType >= Qt::BlankCursor)
+ aCursorType++;
+ QCursor aCursor = QCursor( Qt::CursorShape(aCursorType) );
+ return aCursor;