pref->addPreference( tr( QString().sprintf( "OBJ_BROWSER_COLUMN_%d", i-1 ).toLatin1() ), defCols,
LightApp_Preferences::Bool, "ObjectBrowser", QString().sprintf( "visibility_column_id_%d", i ) );
}
+ int nbGrp = pref->addPreference( tr( "PREF_NOTEBOOK" ), obTab );
+ pref->addPreference( tr( "SHOW_NOTEBOOK" ), nbGrp, LightApp_Preferences::Bool, "ObjectBrowser", "show_notebook" );
+
pref->setItemProperty( "orientation", Qt::Vertical, defCols );
// adding preference to LightApp_Application handled preferences.. a bit of hacking with resources..
pref->addPreference( tr( "PREF_STORE_VISUAL_STATE" ), studyGroup, LightApp_Preferences::Bool, "Study", "store_visual_state" );
}
+/*! Called when application preferenes are changed */
+void SalomeApp_Application::preferencesChanged( const QString& section, const QString& param )
+{
+ if ( section == "ObjectBrowser" ) {
+ if ( param == "show_notebook" ) {
+ updateObjectBrowser( false );
+ }
+ }
+}
+
/*!Update desktop title.*/
void SalomeApp_Application::updateDesktopTitle() {
QString aTitle = applicationName();
virtual void onSelectionChanged();
virtual void createPreferences( LightApp_Preferences* );
+ virtual void preferencesChanged( const QString&, const QString& );
virtual bool closeAction( const int, bool& );
virtual int closeChoice( const QString& );
#include "SalomeApp_Module.h"
#include "SalomeApp_Application.h"
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
#include <CAM_DataObject.h>
#include <SUIT_TreeSync.h>
private:
_PTR( Study ) myStudy;
SUIT_DataObject* myRoot;
+ bool myShowNoteBook;
};
/*!
: myStudy( aStudy ),
myRoot( aRoot )
{
+ myShowNoteBook = SUIT_Session::session()->resourceMgr()->booleanValue( "ObjectBrowser", "show_notebook", false );
}
/*!
_PTR(AttributeDrawable) aAttrDraw = anAttr;
isDraw = aAttrDraw->IsDrawable();
}
+ _PTR(SComponent) aSComp( so );
+ if ( aSComp && aSComp->ComponentDataType() == "NOTEBOOK" && !myShowNoteBook ) return false;
bool res = so && ( so->GetName().size() || so->ReferencedObject( refObj ) ) && isDraw;
return res;
}
</section>
<section name="ObjectBrowser" >
<!-- Object Browser preferences -->
- <parameter name="auto_hide_search_tool" value="true" />
- <parameter name="auto_size" value="false" />
- <parameter name="auto_size_first" value="true" />
- <parameter name="resize_on_expand_item" value="false" />
+ <parameter name="auto_hide_search_tool" value="true" />
+ <parameter name="auto_size" value="false" />
+ <parameter name="auto_size_first" value="true" />
+ <parameter name="resize_on_expand_item" value="false" />
<parameter name="visibility_column_id_1" value="false" />
<parameter name="visibility_column_id_2" value="false" />
<parameter name="visibility_column_id_3" value="false" />
<parameter name="visibility_column_id_4" value="false" />
+ <parameter name="show_notebook" value="false" />
</section>
<section name="PyConsole">
<!-- Python console preferences -->
<source>ACTIVATE_MODULE_OP_LOAD</source>
<translation>&Load...</translation>
</message>
+ <message>
+ <source>PREF_NOTEBOOK</source>
+ <translation>Notebook</translation>
+ </message>
+ <message>
+ <source>SHOW_NOTEBOOK</source>
+ <translation>Show Notebook item</translation>
+ </message>
</context>
<context>
<name>SalomeApp_StudyPropertiesDlg</name>