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" );
}
void HYDROGUI_Module::update( const int flags )
{
- if( !isUpdateEnabled() )
+ if ( !isUpdateEnabled() )
return;
QApplication::setOverrideCursor( Qt::WaitCursor );
QStringList aSelectedEntries = storeSelection();
bool aDoFitAll = flags & UF_FitAll;
+ if ( aDoFitAll )
+ {
+ SUIT_ResourceMgr* aResMgr = getApp()->resourceMgr();
+ aDoFitAll = aResMgr->booleanValue( "HYDRO", "auto_fit_all", false );
+ }
+
if( ( flags & UF_Viewer ) )
updateViewer( getDisplayer(), flags & UF_GV_Init, flags & UF_GV_Forced, aDoFitAll );
anObjectState.Visibility = theState;
HYDROGUI_DataObject* hydroObject = getDataModel()->getDataObject( theObject );
-
- SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>( getApp()->objectBrowser()->model() );
- QString id = hydroObject->text( hydroObject->customData( Qtx::IdType ).toInt() );
- Qtx::VisibilityState visState = treeModel->visibilityState( id );
- if ( visState != Qtx::UnpresentableState )
- treeModel->setVisibilityState( id, theState ? Qtx::ShownState : Qtx::HiddenState );
+ if ( hydroObject )
+ {
+ SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>( getApp()->objectBrowser()->model() );
+ QString id = hydroObject->text( hydroObject->customData( Qtx::IdType ).toInt() );
+ Qtx::VisibilityState visState = treeModel->visibilityState( id );
+ if ( visState != Qtx::UnpresentableState )
+ treeModel->setVisibilityState( id, theState ? Qtx::ShownState : Qtx::HiddenState );
+ }
}
}
setObjectVisible( HYDROGUI_Tool::GetActiveViewId( this ), hydroObject->modelObject(), vis );
- update( UF_OCCViewer | UF_FitAll );
+ update( UF_OCCViewer | ( visState == Qtx::ShownState ? UF_FitAll : 0 ) );
}