myWindows[flag]->setName( QString( "dock_window_%1" ).arg( flag ) );
}
+ QFont f;
+ if( wid->inherits( "PythonConsole" ) )
+ f = ( ( PythonConsole* )wid )->font();
+ else
+ f = wid->font();
+
myWindows[flag]->insert( sId, wid );
+ wid->setFont( f );
setWindowShown( flag, !myWindows[flag]->isEmpty() );
}
ob->setNameTitle( tr( "OBJ_BROWSER_NAME" ) );
+ bool autoSize = resMgr->booleanValue( "ObjectBrowser", "auto_size", false );
for ( int i = SalomeApp_DataObject::CT_Value; i <= SalomeApp_DataObject::CT_RefEntry; i++ )
{
ob->addColumn( tr( QString().sprintf( "OBJ_BROWSER_COLUMN_%d", i ) ), i );
ob->setColumnShown( i, resMgr->booleanValue( "ObjectBrowser",
QString().sprintf( "visibility_column_%d", i ), true ) );
+ //ob->listView()->setColumnWidthMode( i, autoSize ? QListView::Maximum : QListView::Manual );
}
// Create OBSelector
{
PythonConsole* pyCons = new PythonConsole( desktop(), new SalomeApp_PyInterp() );
pyCons->setCaption( tr( "PYTHON_CONSOLE" ) );
+ pyCons->setFont( resMgr->fontValue( "PyConsole", "font" ) );
wid = pyCons;
// pyCons->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
int salomeCat = pref->addPreference( tr( "PREF_CATEGORY_SALOME" ) );
int genTab = pref->addPreference( tr( "PREF_TAB_GENERAL" ), salomeCat );
+ int studyGroup = pref->addPreference( tr( "PREF_GROUP_STUDY" ), genTab );
+ pref->setItemProperty( studyGroup, "columns", 1 );
+
+ pref->addPreference( tr( "PREF_MULTI_FILE" ), studyGroup, SalomeApp_Preferences::Bool, "Study", "multi_file" );
+ pref->addPreference( tr( "PREF_ASCII_FILE" ), studyGroup, SalomeApp_Preferences::Bool, "Study", "ascii_file" );
+ int undoPref = pref->addPreference( tr( "PREF_UNDO_LEVEL" ), studyGroup, SalomeApp_Preferences::IntSpin, "Study", "undo_level" );
+ pref->setItemProperty( undoPref, "min", 1 );
+ pref->setItemProperty( undoPref, "max", 100 );
+
+ int extgroup = pref->addPreference( tr( "PREF_GROUP_EXT_BROWSER" ), genTab );
+ pref->setItemProperty( extgroup, "columns", 1 );
+ int apppref = pref->addPreference( tr( "PREF_APP" ), extgroup, SalomeApp_Preferences::File, "ExternalBrowser", "application" );
+ pref->setItemProperty( apppref, "existing", true );
+ pref->setItemProperty( apppref, "flags", QFileInfo::ExeUser );
+
+ pref->addPreference( tr( "PREF_PARAM" ), extgroup, SalomeApp_Preferences::String, "ExternalBrowser", "parameters" );
+
+ int pythonConsoleGroup = pref->addPreference( tr( "PREF_GROUP_PY_CONSOLE" ), genTab );
+ pref->setItemProperty( pythonConsoleGroup, "columns", 1 );
+ pref->addPreference( tr( "PREF_FONT" ), pythonConsoleGroup, SalomeApp_Preferences::Font, "PyConsole", "font" );
+
+
- int obGroup = pref->addPreference( tr( "PREF_GROUP_OBJBROWSER" ), genTab );
+ int obTab = pref->addPreference( tr( "PREF_TAB_OBJBROWSER" ), salomeCat );
+ int defCols = pref->addPreference( tr( "PREF_GROUP_DEF_COLUMNS" ), obTab );
for ( int i = SalomeApp_DataObject::CT_Value; i <= SalomeApp_DataObject::CT_RefEntry; i++ )
{
- pref->addPreference( tr( QString().sprintf( "OBJ_BROWSER_COLUMN_%d", i ) ), obGroup,
+ pref->addPreference( tr( QString().sprintf( "OBJ_BROWSER_COLUMN_%d", i ) ), defCols,
SalomeApp_Preferences::Bool, "ObjectBrowser", QString().sprintf( "visibility_column_%d", i ) );
}
- pref->setItemProperty( obGroup, "columns", 1 );
+ pref->setItemProperty( defCols, "columns", 1 );
+
+ int objSetGroup = pref->addPreference( tr( "PREF_OBJ_BROWSER_SETTINGS" ), obTab );
+ pref->addPreference( tr( "PREF_AUTO_SIZE" ), objSetGroup, SalomeApp_Preferences::Bool, "ObjectBrowser", "auto_size" );
int viewTab = pref->addPreference( tr( "PREF_TAB_VIEWERS" ), salomeCat );
for ( QPtrListIterator<SUIT_ViewManager> it( lst ); it.current(); ++it )
((OCCViewer_Viewer*)it.current())->setIsos( u, v );
}
-
+
+ if( sec=="ObjectBrowser" )
+ {
+ if( param=="auto_size" )
+ {
+ OB_Browser* ob = objectBrowser();
+ if( !ob )
+ return;
+
+ bool autoSize = resMgr->booleanValue( "ObjectBrowser", "auto_size", false );
+ /*for ( int i = SalomeApp_DataObject::CT_Value; i <= SalomeApp_DataObject::CT_RefEntry; i++ )
+ ob->listView()->setColumnWidthMode( i, autoSize ? QListView::Maximum : QListView::Manual );
+
+ if( autoSize )
+ ob->listView()->adjustSize();*/
+ }
+ }
+
+ if( sec=="PyConsole" )
+ {
+ if( param=="font" )
+ if( pythonConsole() )
+ pythonConsole()->setFont( resMgr->fontValue( "PyConsole", "font" ) );
+ }
}
void SalomeApp_Application::updateDesktopTitle() {
msgid "SalomeApp_Application::PREFERENCES_NOT_LOADED"
msgstr "Preferences for module \"<b>%1</b>\" will be available when the module will be loaded"
+msgid "SalomeApp_Application::PREF_FONT"
+msgstr "Font"
+
msgid "SalomeApp_Application::PREF_CATEGORY_SALOME"
msgstr "SALOME"
msgid "SalomeApp_Application::PREF_TAB_GENERAL"
msgstr "General"
-msgid "SalomeApp_Application::PREF_GROUP_OBJBROWSER"
+msgid "SalomeApp_Application::PREF_TAB_OBJBROWSER"
msgstr "Object browser"
+msgid "SalomeApp_Application::PREF_GROUP_EXT_BROWSER"
+msgstr "External browser"
+
+msgid "SalomeApp_Application::PREF_APP"
+msgstr "Application"
+
+msgid "SalomeApp_Application::PREF_PARAM"
+msgstr "Parameters"
+
+msgid "SalomeApp_Application::PREF_GROUP_DEF_COLUMNS"
+msgstr "Default columns"
+
+msgid "SalomeApp_Application::PREF_OBJ_BROWSER_SETTINGS"
+msgstr "Settings"
+
+msgid "SalomeApp_Application::PREF_AUTO_SIZE"
+msgstr "Auto size columns"
+
+msgid "SalomeApp_Application::PREF_GROUP_STUDY"
+msgstr "Study properties"
+
+msgid "SalomeApp_Application::PREF_GROUP_PY_CONSOLE"
+msgstr "Python console properties"
+
msgid "SalomeApp_Application::PREF_TAB_VIEWERS"
msgstr "Viewers"
msgid "SalomeApp_Application::PREF_GROUP_OCCVIEWER"
msgstr "OCC Viewer 3d"
+msgid "SalomeApp_Application::PREF_MULTI_FILE"
+msgstr "Multi file save"
+
+msgid "SalomeApp_Application::PREF_ASCII_FILE"
+msgstr "ASCII save"
+
+msgid "SalomeApp_Application::PREF_UNDO_LEVEL"
+msgstr "Undo level"
+
msgid "SalomeApp_Application::PREF_GROUP_VTKVIEWER"
msgstr "VTK Viewer 3d"