? GUI_SRC_3.2.2/aclocal.m4 ? GUI_SRC_3.2.2/autom4te.cache ? GUI_SRC_3.2.2/configure ? GUI_SRC_3.2.2/configure.in ? GUI_SRC_3.2.2/configure.in_new ? GUI_SRC_3.2.2/configure.in_old Index: GUI_SRC_3.2.2/adm_local/unix/config_files/check_pyqt.m4 =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/adm_local/unix/config_files/check_pyqt.m4,v retrieving revision 1.3 retrieving revision 1.3.4.1 diff -c -u -r1.3 -r1.3.4.1 --- GUI_SRC_3.2.2/adm_local/unix/config_files/check_pyqt.m4 6 May 2006 08:40:44 -0000 1.3 +++ GUI_SRC_3.2.2/adm_local/unix/config_files/check_pyqt.m4 23 Oct 2006 11:13:59 -0000 1.3.4.1 @@ -50,6 +50,16 @@ fi fi if test "x$pyqt_uic_ok" == "xno"; then + dnl try in $PATH + AC_PATH_PROG(PYUIC, pyuic) + if test "x$PYUIC" != x; then + PYQTDIR=$PYUIC + PYQTDIR=`dirname $PYQTDIR` + PYQTDIR=`dirname $PYQTDIR` + pyqt_uic_ok=yes + fi +fi +if test "x$pyqt_uic_ok" == "xno"; then dnl try ${SIPDIR} if test "x${SIPDIR}" != "x"; then if test -d ${SIPDIR} ; then @@ -106,8 +116,8 @@ fi fi if test "x$pyqt_lib_ok" == "xno"; then - dnl try {PYQTDIR}/lib - if test -d {PYQTDIR}/lib; then + dnl try ${PYQTDIR}/lib + if test -d ${PYQTDIR}/lib; then AC_CHECK_FILE(${PYQTDIR}/lib/libqtcmodule.so,pyqt_lib_ok=yes,pyqt_lib_ok=no) if test "x$pyqt_lib_ok" == "xyes"; then PYQT_LIBS="-L${PYQTDIR}/lib -lqtcmodule" @@ -120,8 +130,8 @@ fi fi if test "x$pyqt_lib_ok" == "xno"; then - dnl try {PYQTDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages - if test -d {PYQTDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages; then + dnl try ${PYQTDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages + if test -d ${PYQTDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages; then AC_CHECK_FILE(${PYQTDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/libqtcmodule.so,pyqt_lib_ok=yes,pyqt_lib_ok=no) if test "x$pyqt_lib_ok" == "xyes"; then PYQT_LIBS="-L${PYQTDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages -lqtcmodule" @@ -221,6 +231,17 @@ fi fi if test "x$pyqt_sips_ok" == "xno"; then + dnl try ${PYQTDIR}/share/sip/qt + if test "x${PYQTDIR}" != "x"; then + if test -d ${PYQTDIR}/share/sip/qt ; then + AC_CHECK_FILE(${PYQTDIR}/share/sip/qt/qglobal.sip,pyqt_sips_ok=yes,pyqt_sips_ok=no) + if test "x$pyqt_sips_ok" == "xyes"; then + PYQT_SIPS="${PYQTDIR}/share/sip/qt" + fi + fi + fi +fi +if test "x$pyqt_sips_ok" == "xno"; then dnl try ${SIPDIR}/sip if test "x${SIPDIR}" != "x"; then if test -d ${SIPDIR}/sip ; then Index: GUI_SRC_3.2.2/adm_local/unix/config_files/check_sip.m4 =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/adm_local/unix/config_files/check_sip.m4,v retrieving revision 1.3 retrieving revision 1.3.4.1 diff -c -u -r1.3 -r1.3.4.1 --- GUI_SRC_3.2.2/adm_local/unix/config_files/check_sip.m4 6 May 2006 08:40:44 -0000 1.3 +++ GUI_SRC_3.2.2/adm_local/unix/config_files/check_sip.m4 23 Oct 2006 11:03:44 -0000 1.3.4.1 @@ -44,11 +44,20 @@ SIP_VERS=v4_old ;; 4.2*) SIP_VERS=v4_new ;; + 4.3*) + SIP_VERS=v4_new ;; + 4.4*) + SIP_VERS=v4_new ;; *) AC_MSG_RESULT(sip version $version not supported) SIP_VERS=unsupported ;; esac + if test "x$SIPDIR" = "x" ; then + SIPDIR=`dirname $SIP` + SIPDIR=`dirname $SIPDIR` + fi + sip_ok=no dnl Search sip.h file if test "x$SIPDIR" != "x" ; then Index: GUI_SRC_3.2.2/src/Makefile.in =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/Makefile.in,v retrieving revision 1.14 retrieving revision 1.14.2.1 diff -c -u -r1.14 -r1.14.2.1 --- GUI_SRC_3.2.2/src/Makefile.in 1 Jun 2006 11:27:47 -0000 1.14 +++ GUI_SRC_3.2.2/src/Makefile.in 22 Sep 2006 11:29:05 -0000 1.14.2.1 @@ -32,7 +32,7 @@ @COMMENCE@ -SUBDIRS = Qtx DDS QDS SUIT STD CAF CAM SUITApp LogWindow ObjBrowser Prs +SUBDIRS = Qtx Style DDS QDS SUIT STD CAF CAM SUITApp LogWindow ObjBrowser Prs ifneq ($(DISABLE_SALOMEOBJECT),yes) SUBDIRS += OBJECT @@ -66,7 +66,7 @@ ifneq ($(DISABLE_SUPERVGRAPHVIEWER),yes) SUBDIRS += SUPERVGraph endif -SUBDIRS += LightApp Style ResExporter +SUBDIRS += LightApp ResExporter ifneq ($(GUI_DISABLE_CORBA),yes) SUBDIRS += RegistryDisplay TOOLSGUI \ Index: GUI_SRC_3.2.2/src/LightApp/LightApp_Application.cxx =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/LightApp/LightApp_Application.cxx,v retrieving revision 1.24.2.4 retrieving revision 1.24.2.5 diff -c -u -r1.24.2.4 -r1.24.2.5 --- GUI_SRC_3.2.2/src/LightApp/LightApp_Application.cxx 8 Sep 2006 11:05:11 -0000 1.24.2.4 +++ GUI_SRC_3.2.2/src/LightApp/LightApp_Application.cxx 22 Sep 2006 06:05:46 -0000 1.24.2.5 @@ -233,7 +233,7 @@ myAccel->setActionKey( SUIT_Accel::RotateUp, ALT+Key_Up, VTKViewer_Viewer::Type() ); myAccel->setActionKey( SUIT_Accel::RotateDown, ALT+Key_Down, VTKViewer_Viewer::Type() ); #endif -#ifndef DISABLE_PLOT2DKVIEWER +#ifndef DISABLE_PLOT2DVIEWER myAccel->setActionKey( SUIT_Accel::PanLeft, CTRL+Key_Left, Plot2d_Viewer::Type() ); myAccel->setActionKey( SUIT_Accel::PanRight, CTRL+Key_Right, Plot2d_Viewer::Type() ); myAccel->setActionKey( SUIT_Accel::PanUp, CTRL+Key_Up, Plot2d_Viewer::Type() ); @@ -522,51 +522,53 @@ if ( modIcon.isNull() ) modIcon = QPixmap( imageEmptyIcon ); - QToolBar* modTBar = new QtxToolBar( true, desk ); - modTBar->setLabel( tr( "INF_TOOLBAR_MODULES" ) ); + QStringList modList; + modules( modList, false ); + + if( modList.count()>1 ) + { + QToolBar* modTBar = new QtxToolBar( true, desk ); + modTBar->setLabel( tr( "INF_TOOLBAR_MODULES" ) ); - QActionGroup* modGroup = new QActionGroup( this ); - modGroup->setExclusive( true ); - modGroup->setUsesDropDown( true ); - - a = createAction( -1, tr( "APP_NAME" ), defIcon, tr( "APP_NAME" ), - tr( "PRP_APP_MODULE" ), 0, desk, true ); - modGroup->add( a ); - myActions.insert( QString(), a ); + QActionGroup* modGroup = new QActionGroup( this ); + modGroup->setExclusive( true ); + modGroup->setUsesDropDown( true ); - QMap iconMap; - moduleIconNames( iconMap ); + a = createAction( -1, tr( "APP_NAME" ), defIcon, tr( "APP_NAME" ), + tr( "PRP_APP_MODULE" ), 0, desk, true ); + modGroup->add( a ); + myActions.insert( QString(), a ); - const int iconSize = 20; + QMap iconMap; + moduleIconNames( iconMap ); - modGroup->addTo( modTBar ); - QObjectList *l = modTBar->queryList( "QComboBox" ); - QObjectListIt oit( *l ); - while ( QObject* obj = oit.current() ) { - QComboBox* cb = (QComboBox*)obj; - if ( cb ) cb->setFocusPolicy( QWidget::NoFocus ); + const int iconSize = 20; + + modGroup->addTo( modTBar ); + QObjectList *l = modTBar->queryList( "QComboBox" ); + QObjectListIt oit( *l ); + while ( QObject* obj = oit.current() ) { + QComboBox* cb = (QComboBox*)obj; + if ( cb ) cb->setFocusPolicy( QWidget::NoFocus ); ++oit; - } - delete l; + } + delete l; - modTBar->addSeparator(); + modTBar->addSeparator(); - QStringList modList; - modules( modList, false ); - - for ( it = modList.begin(); it != modList.end(); ++it ) - { - if ( !isLibExists( *it ) ) - continue; + for ( it = modList.begin(); it != modList.end(); ++it ) + { + if ( !isLibExists( *it ) ) + continue; - QString iconName; - if ( iconMap.contains( *it ) ) - iconName = iconMap[*it]; + QString iconName; + if ( iconMap.contains( *it ) ) + iconName = iconMap[*it]; - QString modName = moduleName( *it ); + QString modName = moduleName( *it ); - QPixmap icon = resMgr->loadPixmap( modName, iconName, false ); - if ( icon.isNull() ) + QPixmap icon = resMgr->loadPixmap( modName, iconName, false ); + if ( icon.isNull() ) { icon = modIcon; printf( "****************************************************************\n" ); @@ -574,16 +576,18 @@ printf( "****************************************************************\n" ); } - icon.convertFromImage( icon.convertToImage().smoothScale( iconSize, iconSize, QImage::ScaleMin ) ); + icon.convertFromImage( icon.convertToImage().smoothScale( iconSize, iconSize, QImage::ScaleMin ) ); - QAction* a = createAction( -1, *it, icon, *it, tr( "PRP_MODULE" ).arg( *it ), 0, desk, true ); - a->addTo( modTBar ); - modGroup->add( a ); + QAction* a = createAction( -1, *it, icon, *it, tr( "PRP_MODULE" ).arg( *it ), 0, desk, true ); + a->addTo( modTBar ); + modGroup->add( a ); - myActions.insert( *it, a ); - } + myActions.insert( *it, a ); + } - SUIT_Tools::simplifySeparators( modTBar ); + SUIT_Tools::simplifySeparators( modTBar ); + connect( modGroup, SIGNAL( selected( QAction* ) ), this, SLOT( onModuleActivation( QAction* ) ) ); + } // New window int windowMenu = createMenu( tr( "MEN_DESK_WINDOW" ), -1, MenuWindowId, 100 ); @@ -609,8 +613,6 @@ SHIFT+Key_R, desk, false, this, SLOT( onRenameWindow() ) ); createMenu( RenameId, windowMenu, -1 ); - connect( modGroup, SIGNAL( selected( QAction* ) ), this, SLOT( onModuleActivation( QAction* ) ) ); - int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1 ); createMenu( PreferencesId, fileMenu, 15, -1 ); createMenu( separator(), fileMenu, -1, 15, -1 ); @@ -1448,7 +1450,7 @@ } /*!Protected SLOT. On study closed.*/ -void LightApp_Application::onStudyClosed( SUIT_Study* ) +void LightApp_Application::onStudyClosed( SUIT_Study* s ) { emit studyClosed(); @@ -1457,7 +1459,8 @@ activateModule( "" ); - saveWindowsGeometry(); + for ( WindowMap::ConstIterator itr = myWindows.begin(); s && itr != myWindows.end(); ++itr ) + removeWindow( itr.key(), s->id() ); } /*!Protected SLOT.On desktop activated.*/ @@ -1560,9 +1563,6 @@ void LightApp_Application::beforeCloseDoc( SUIT_Study* s ) { CAM_Application::beforeCloseDoc( s ); - - for ( WindowMap::ConstIterator itr = myWindows.begin(); s && itr != myWindows.end(); ++itr ) - removeWindow( itr.key(), s->id() ); } /*!Update actions.*/ Index: GUI_SRC_3.2.2/src/OCCViewer/OCCViewer_ViewModel.cxx =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/OCCViewer/OCCViewer_ViewModel.cxx,v retrieving revision 1.15.2.2 retrieving revision 1.15.2.3 diff -c -u -r1.15.2.2 -r1.15.2.3 --- GUI_SRC_3.2.2/src/OCCViewer/OCCViewer_ViewModel.cxx 8 Sep 2006 11:01:26 -0000 1.15.2.2 +++ GUI_SRC_3.2.2/src/OCCViewer/OCCViewer_ViewModel.cxx 22 Sep 2006 13:42:24 -0000 1.15.2.3 @@ -358,7 +358,7 @@ { AIS_ListIteratorOfListOfInteractive aIt; for (aIt.Initialize(theList); aIt.More(); aIt.Next()) - myAISContext->SetSelected(aIt.Value(), false); + myAISContext->AddOrRemoveSelected(aIt.Value(), false); myAISContext->UpdateCurrentViewer(); } Index: GUI_SRC_3.2.2/src/ObjBrowser/OB_Browser.cxx =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/ObjBrowser/OB_Browser.cxx,v retrieving revision 1.26 retrieving revision 1.26.2.1 diff -c -u -r1.26 -r1.26.2.1 --- GUI_SRC_3.2.2/src/ObjBrowser/OB_Browser.cxx 1 Jun 2006 11:27:49 -0000 1.26 +++ GUI_SRC_3.2.2/src/ObjBrowser/OB_Browser.cxx 12 Oct 2006 14:29:23 -0000 1.26.2.1 @@ -113,7 +113,7 @@ ObjPtr nullSrc() const; ItemPtr nullTrg() const; ItemPtr createItem( const ObjPtr&, const ItemPtr&, const ItemPtr&, const bool ) const; - void updateItem( const ItemPtr& ) const; + void updateItem( const ObjPtr& , const ItemPtr& ) const; void deleteItemWithChildren( const ItemPtr& ) const; void children( const ObjPtr&, QValueList& ) const; void children( const ItemPtr&, QValueList& ) const; @@ -171,13 +171,17 @@ Updates item \param p - item */ -void OB_BrowserSync::updateItem( const ItemPtr& p ) const +void OB_BrowserSync::updateItem( const ObjPtr& o, const ItemPtr& p ) const { if ( p && needUpdate( p ) ) { // printf( "--- needUpdate for %s = true ---\n", p->text( 0 ).latin1() ); myBrowser->updateText( p ); p->update(); } + if( o && myBrowser->getUpdater() ) + { + myBrowser->getUpdater()->update( o, p ); + } } /*! @@ -288,6 +292,7 @@ myRoot( 0 ), myTooltip( 0 ), +myUpdater( 0 ), myAutoOpenLevel( 0 ), myAutoUpdate( false ), myAutoDelObjs( false ), @@ -325,6 +330,7 @@ { myItems.clear(); delete myTooltip; + setUpdater( 0 ); } /*! @@ -422,6 +428,24 @@ } /*! + \return updater of browser +*/ +OB_Updater* OB_Browser::getUpdater() const +{ + return myUpdater; +} + +/*! + \sets new updater of browser +*/ +void OB_Browser::setUpdater( OB_Updater* theUpdate ) +{ + if( myUpdater ) + delete myUpdater; + myUpdater = theUpdate; +} + +/*! \return root SUIT object of browser */ SUIT_DataObject* OB_Browser::getRootObject() const Index: GUI_SRC_3.2.2/src/ObjBrowser/OB_Browser.h =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/ObjBrowser/OB_Browser.h,v retrieving revision 1.15 retrieving revision 1.15.2.1 diff -c -u -r1.15 -r1.15.2.1 --- GUI_SRC_3.2.2/src/ObjBrowser/OB_Browser.h 1 Jun 2006 11:27:49 -0000 1.15 +++ GUI_SRC_3.2.2/src/ObjBrowser/OB_Browser.h 12 Oct 2006 14:29:23 -0000 1.15.2.1 @@ -39,6 +39,14 @@ class OB_ListView; class OB_ListItem; +class OB_Updater +{ +public: + OB_Updater(){}; + virtual ~OB_Updater(){}; + virtual void update( SUIT_DataObject* theObj, OB_ListItem* theLI ) = 0; +}; + /*! \class OB_Browser Represents object browser. Allows to get/set selection, @@ -126,6 +134,9 @@ void setModified(); unsigned long getModifiedTime() { return myModifiedTime; } + + OB_Updater* getUpdater() const; + virtual void setUpdater( OB_Updater* theUpdate = 0 ); signals: void selectionChanged(); @@ -188,6 +199,7 @@ SUIT_DataObject* myRoot; ItemMap myItems; QToolTip* myTooltip; + OB_Updater* myUpdater; QMap myColumnIds; bool myAutoUpdate; bool myAutoDelObjs; Index: GUI_SRC_3.2.2/src/PythonConsole/PythonConsole_PyEditor.cxx =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/PythonConsole/PythonConsole_PyEditor.cxx,v retrieving revision 1.13.2.2 retrieving revision 1.13.2.3 diff -c -u -r1.13.2.2 -r1.13.2.3 --- GUI_SRC_3.2.2/src/PythonConsole/PythonConsole_PyEditor.cxx 11 Jul 2006 11:40:53 -0000 1.13.2.2 +++ GUI_SRC_3.2.2/src/PythonConsole/PythonConsole_PyEditor.cxx 18 Oct 2006 11:20:28 -0000 1.13.2.3 @@ -148,8 +148,10 @@ void PythonConsole_PyEditor::exec( const QString& command ) { // Some interactive command is being executed in this editor -> do nothing - if ( isReadOnly() ) + if ( isReadOnly() ) { + myQueue.push_back( command ); return; + } int para=paragraphs()-1; removeParagraph( para ); _currentPrompt = READY_PROMPT; @@ -680,6 +682,12 @@ setReadOnly( false ); _isInHistory = false; + + if ( e->type() == PyInterp_Event::OK && myQueue.count() > 0 ) { + QString nextcmd = myQueue[0]; + myQueue.pop_front(); + exec( nextcmd ); + } } /*! Index: GUI_SRC_3.2.2/src/PythonConsole/PythonConsole_PyEditor.h =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/PythonConsole/PythonConsole_PyEditor.h,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -c -u -r1.5 -r1.5.2.1 --- GUI_SRC_3.2.2/src/PythonConsole/PythonConsole_PyEditor.h 1 Jun 2006 11:27:50 -0000 1.5 +++ GUI_SRC_3.2.2/src/PythonConsole/PythonConsole_PyEditor.h 18 Oct 2006 11:20:28 -0000 1.5.2.1 @@ -69,9 +69,10 @@ PyInterp_base* myInterp; - QString myBanner; - QString myOutput; - QString myError; + QString myBanner; + QString myOutput; + QString myError; + QStringList myQueue; }; #endif Index: GUI_SRC_3.2.2/src/Qtx/QtxListResourceEdit.cxx =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/Qtx/QtxListResourceEdit.cxx,v retrieving revision 1.21.2.1 retrieving revision 1.21.2.2 diff -c -u -r1.21.2.1 -r1.21.2.2 --- GUI_SRC_3.2.2/src/Qtx/QtxListResourceEdit.cxx 28 Jul 2006 09:50:41 -0000 1.21.2.1 +++ GUI_SRC_3.2.2/src/Qtx/QtxListResourceEdit.cxx 17 Oct 2006 13:03:35 -0000 1.21.2.2 @@ -686,8 +686,8 @@ void QtxListResourceEdit::SelectItem::store() { int idx = myList->currentItem(); - if ( myIndex.contains( idx ) ) - setInteger( myIndex[idx] ); + if ( idx >= 0 ) + setInteger( myIndex.contains( idx ) ? myIndex[idx] : idx ); } /*! @@ -697,14 +697,15 @@ { int id = getInteger( -1 ); - int idx = -1; - for ( QMap::ConstIterator it = myIndex.begin(); it != myIndex.end() && idx == -1; ++it ) + for ( QMap::ConstIterator it = myIndex.begin(); it != myIndex.end(); ++it ) { - if ( it.data() == id ) - idx = it.key(); + if ( it.data() == id ) { + myList->setCurrentItem( it.key() ); + return; + } } - - myList->setCurrentItem( idx ); + if ( id >= 0 ) + myList->setCurrentItem( id ); } /*! Index: GUI_SRC_3.2.2/src/Qtx/QtxResourceEdit.h =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/Qtx/QtxResourceEdit.h,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -c -u -r1.9 -r1.9.2.1 --- GUI_SRC_3.2.2/src/Qtx/QtxResourceEdit.h 1 Jun 2006 11:27:51 -0000 1.9 +++ GUI_SRC_3.2.2/src/Qtx/QtxResourceEdit.h 17 Oct 2006 13:03:07 -0000 1.9.2.1 @@ -135,7 +135,7 @@ virtual void update(); - QVariant property( const QString& ) const; + virtual QVariant property( const QString& ) const; virtual void setProperty( const QString&, const QVariant& ); virtual void store() = 0; Index: GUI_SRC_3.2.2/src/Qtx/QtxResourceMgr.h =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/Qtx/QtxResourceMgr.h,v retrieving revision 1.12 retrieving revision 1.12.2.1 diff -c -u -r1.12 -r1.12.2.1 --- GUI_SRC_3.2.2/src/Qtx/QtxResourceMgr.h 1 Jun 2006 11:27:51 -0000 1.12 +++ GUI_SRC_3.2.2/src/Qtx/QtxResourceMgr.h 20 Sep 2006 07:57:54 -0000 1.12.2.1 @@ -185,7 +185,7 @@ { public: Format( const QString& ); - ~Format(); + virtual ~Format(); QString format() const; Index: GUI_SRC_3.2.2/src/SALOME_PY/SalomePy.cxx =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/SALOME_PY/SalomePy.cxx,v retrieving revision 1.5.2.1 retrieving revision 1.5.2.3 diff -c -u -r1.5.2.1 -r1.5.2.3 --- GUI_SRC_3.2.2/src/SALOME_PY/SalomePy.cxx 15 Aug 2006 09:47:29 -0000 1.5.2.1 +++ GUI_SRC_3.2.2/src/SALOME_PY/SalomePy.cxx 20 Oct 2006 12:20:29 -0000 1.5.2.3 @@ -118,9 +118,7 @@ { //return ProcessEvent( new TGetRendererEvent() ); PyObject * aResult; - Py_BEGIN_ALLOW_THREADS // PAL12755 aResult = ProcessEvent( new TGetRendererEvent() ); - Py_END_ALLOW_THREADS // PAL12755 return aResult; } @@ -144,9 +142,7 @@ { //return ProcessEvent( new TGetRenderWindowEvent() ); PyObject * aResult; - Py_BEGIN_ALLOW_THREADS // PAL12755 aResult = ProcessEvent( new TGetRenderWindowEvent() ); - Py_END_ALLOW_THREADS // PAL12755 return aResult; } @@ -170,9 +166,7 @@ { //return ProcessEvent( new TGetRenderWindowInteractorEvent() ); PyObject * aResult; - Py_BEGIN_ALLOW_THREADS // PAL12755 aResult = ProcessEvent( new TGetRenderWindowInteractorEvent() ); - Py_END_ALLOW_THREADS // PAL12755 return aResult; } @@ -181,9 +175,9 @@ */ static PyMethodDef Module_Methods[] = { - { "getRenderer", libSalomePy_getRenderer, METH_NOARGS }, - { "getRenderWindow", libSalomePy_getRenderWindow, METH_NOARGS }, - { "getRenderWindowInteractor", libSalomePy_getRenderWindow, METH_NOARGS }, + { "getRenderer", libSalomePy_getRenderer, METH_NOARGS }, + { "getRenderWindow", libSalomePy_getRenderWindow, METH_NOARGS }, + { "getRenderWindowInteractor", libSalomePy_getRenderWindowInteractor, METH_NOARGS }, { NULL, NULL } }; Index: GUI_SRC_3.2.2/src/SALOME_PYQT/SALOME_PYQT_GUI/Makefile.in =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/SALOME_PYQT/SALOME_PYQT_GUI/Makefile.in,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -c -u -r1.9 -r1.9.2.1 --- GUI_SRC_3.2.2/src/SALOME_PYQT/SALOME_PYQT_GUI/Makefile.in 1 Jun 2006 11:27:51 -0000 1.9 +++ GUI_SRC_3.2.2/src/SALOME_PYQT/SALOME_PYQT_GUI/Makefile.in 26 Sep 2006 08:02:24 -0000 1.9.2.1 @@ -36,6 +36,10 @@ QT_VERS = Qt_3_3_0 endif +ifeq ($(QT_VERS),Qt_3_3_6) +QT_VERS = Qt_3_3_0 +endif + # Sip flags SIP_FLAGS = -t WS_X11 -t $(QT_VERS) $(PYQT_SIPFLAGS) -s ".cc" -c . -I $(PYQT_SIPS) Index: GUI_SRC_3.2.2/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx,v retrieving revision 1.20 retrieving revision 1.20.2.2 diff -c -u -r1.20 -r1.20.2.2 --- GUI_SRC_3.2.2/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx 1 Jun 2006 11:27:51 -0000 1.20 +++ GUI_SRC_3.2.2/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx 23 Oct 2006 13:25:58 -0000 1.20.2.2 @@ -539,6 +539,38 @@ } /*! + * Export preferences for the Python module. + * Called only once when the first instance of the module is created. + */ +void SALOME_PYQT_Module::createPreferences() +{ + MESSAGE( "SALOME_PYQT_Module::createPr eferences"); + // perform synchronous request to Python event dispatcher + class Event : public PyInterp_LockRequest + { + public: + Event( PyInterp_base* _py_interp, + SALOME_PYQT_Module* _obj ) + : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true) + myObj ( _obj ) {} + + protected: + virtual void execute() + { + myObj->initPreferences(); + } + + private: + SALOME_PYQT_Module* myObj; + }; + + // Posting the request only if dispatcher is not busy! + // Executing the request synchronously + if ( !PyInterp_Dispatcher::Get()->IsBusy() ) + PyInterp_Dispatcher::Get()->Exec( new Event( myInterp, this ) ); +} + +/*! * Defines the dockable window associated with the module. * To fill the list of windows the correspondind Python module's windows() * method is called from SALOME_PYQT_Module::init() method. @@ -618,8 +650,7 @@ // ... first put default values myWindowsMap.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::DockLeft ); myWindowsMap.insert( SalomeApp_Application::WT_PyConsole, Qt::DockBottom ); - // VSR: LogWindow is not yet implemented - // myWindowsMap.insert( SalomeApp_Application::WT_LogWindow, Qt::DockBottom ); + myWindowsMap.insert( SalomeApp_Application::WT_LogWindow, Qt::DockBottom ); if(PyObject_HasAttrString(myModule , "windows")){ PyObjWrapper res1( PyObject_CallMethod( myModule, "windows", "" ) ); @@ -947,6 +978,31 @@ } /*! + * Initialises preferences for the module + * - calls Python module's createPreferences() method + */ +void SALOME_PYQT_Module::initPreferences() +{ + // Python interpreter should be initialized and Python module should be + // import first + if ( !myInterp || !myModule ) + return; + + // temporary set myInitModule because createPreferences() method + // might be called during the module intialization process + myInitModule = this; + + if ( PyObject_HasAttrString(myModule , "createPreferences") ) { + PyObjWrapper res( PyObject_CallMethod( myModule, "createPreferences", "" ) ); + if( !res ) { + PyErr_Print(); + } + } + + myInitModule = 0; +} + +/*! * Initialises python subinterpreter (one per study) */ void SALOME_PYQT_Module::initInterp( int theStudyId ) @@ -1241,6 +1297,7 @@ } return a; } + /*! * Load icon from resource file */ @@ -1434,6 +1491,38 @@ return false; } +/*! + * The next methods call the parent implementation. + * This is done to open protected methods from LightApp_Module class. + */ + +int SALOME_PYQT_Module::addPreference( const QString& label ) +{ + return SalomeApp_Module::addPreference( label ); +} + +int SALOME_PYQT_Module::addPreference( const QString& label, + const int pId, const int type, + const QString& section, + const QString& param ) +{ + return SalomeApp_Module::addPreference( label, pId, type, section, param ); +} + +QVariant SALOME_PYQT_Module::preferenceProperty( const int id, + const QString& prop ) const +{ + QVariant v = SalomeApp_Module::preferenceProperty( id, prop ); + return v; +} + +void SALOME_PYQT_Module::setPreferenceProperty( const int id, + const QString& prop, + const QVariant& var ) +{ + SalomeApp_Module::setPreferenceProperty( id, prop, var ); +} + // SALOME_PYQT_XmlHandler class implementation // gets an tag name for the dom element [ static ] Index: GUI_SRC_3.2.2/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.h =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.h,v retrieving revision 1.12 retrieving revision 1.12.2.1 diff -c -u -r1.12 -r1.12.2.1 --- GUI_SRC_3.2.2/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.h 1 Jun 2006 11:27:51 -0000 1.12 +++ GUI_SRC_3.2.2/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.h 17 Oct 2006 13:18:03 -0000 1.12.2.1 @@ -109,6 +109,9 @@ /* context popup menu request */ void contextMenuPopup( const QString&, QPopupMenu*, QString& ); + /* create preferences */ + void createPreferences(); + /* get module engine IOR */ virtual QString engineIOR() const; @@ -147,6 +150,14 @@ /* load icon from resource file */ QIconSet loadIcon( const QString& fileName ); + /* working with preferences : open protected methods */ + int addPreference( const QString& ); + int addPreference( const QString&, const int, const int = -1, + const QString& = QString::null, + const QString& = QString::null ); + QVariant preferenceProperty( const int, const QString& ) const; + void setPreferenceProperty( const int, const QString&, const QVariant& ); + /* Show/hide menus/toolbars */ void setMenuShown( const bool ); void setToolShown( const bool ); @@ -194,6 +205,8 @@ void guiEvent( const int ); /* Menu highlight processing */ void menuHighlight( const int, const int ); + /* Init preferences */ + void initPreferences(); /* initialize a Python subinterpreter */ void initInterp ( int ); Index: GUI_SRC_3.2.2/src/SALOME_PYQT/SalomePyQt/Makefile.in =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/SALOME_PYQT/SalomePyQt/Makefile.in,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -c -u -r1.11 -r1.11.2.1 --- GUI_SRC_3.2.2/src/SALOME_PYQT/SalomePyQt/Makefile.in 1 Jun 2006 11:27:51 -0000 1.11 +++ GUI_SRC_3.2.2/src/SALOME_PYQT/SalomePyQt/Makefile.in 26 Sep 2006 08:02:05 -0000 1.11.2.1 @@ -35,6 +35,9 @@ ifeq ($(QT_VERS),Qt_3_3_4) QT_VERS = Qt_3_3_0 endif +ifeq ($(QT_VERS),Qt_3_3_6) +QT_VERS = Qt_3_3_0 +endif # Sip flags SIP_FLAGS = -t WS_X11 -t $(QT_VERS) $(PYQT_SIPFLAGS) -s ".cc" -c . -I $(PYQT_SIPS) Index: GUI_SRC_3.2.2/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx,v retrieving revision 1.16 retrieving revision 1.16.2.2 diff -c -u -r1.16 -r1.16.2.2 --- GUI_SRC_3.2.2/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx 1 Jun 2006 11:27:51 -0000 1.16 +++ GUI_SRC_3.2.2/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx 23 Oct 2006 13:25:24 -0000 1.16.2.2 @@ -39,6 +39,7 @@ #include "LightApp_SelectionMgr.h" #include "OB_Browser.h" #include "QtxAction.h" +#include "LogWindow.h" using namespace std; @@ -1364,3 +1365,204 @@ return ProcessEvent( new TClearMenuEvent( id, menu, removeActions ) ); } +/*! + SalomePyQt::addPreference + Adds preference + */ +class TAddPrefEvent: public SALOME_Event { +public: + typedef int TResult; + TResult myResult; + QString myLabel; + TAddPrefEvent( const QString& label ) + : myResult( -1 ), myLabel( label ) {} + virtual void Execute() { + if ( SalomeApp_Application* anApp = getApplication() ) { + SALOME_PYQT_Module* module = SALOME_PYQT_Module::getInitModule(); + if ( !module ) + module = dynamic_cast( anApp->activeModule() ); + if ( module ) + myResult = module->addPreference( myLabel ); + } + } +}; +int SalomePyQt::addPreference( const QString& label ) +{ + return ProcessEvent( new TAddPrefEvent( label ) ); +} + +/*! + SalomePyQt::addPreference + Adds preference + */ +class TAddPrefParamEvent: public SALOME_Event { +public: + typedef int TResult; + TResult myResult; + QString myLabel; + int myPId; + int myType; + QString mySection; + QString myParam; + TAddPrefParamEvent( const QString& label, + const int pId, const int type, + const QString& section, + const QString& param ) + : myResult( -1 ), + myLabel( label ), myPId( pId ), myType( type ), + mySection( section ), myParam ( param ) {} + virtual void Execute() { + if ( SalomeApp_Application* anApp = getApplication() ) { + SALOME_PYQT_Module* module = SALOME_PYQT_Module::getInitModule(); + if ( !module ) + module = dynamic_cast( anApp->activeModule() ); + if ( module ) + myResult = module->addPreference( myLabel, myPId, myType, mySection, myParam ); + } + } +}; +int SalomePyQt::addPreference( const QString& label, const int pId, const int type, + const QString& section, const QString& param ) +{ + return ProcessEvent( new TAddPrefParamEvent( label, pId, type, section, param ) ); +} + +/*! + SalomePyQt::preferenceProperty + Gets the property value for the given (by id) preference + */ +class TPrefPropEvent: public SALOME_Event { +public: + typedef QVariant TResult; + TResult myResult; + int myId; + QString myProp; + TPrefPropEvent( const int id, const QString& prop ) + : myId( id ), myProp( prop ) + { + myResult = QVariant(); + } + virtual void Execute() { + if ( SalomeApp_Application* anApp = getApplication() ) { + SALOME_PYQT_Module* module = SALOME_PYQT_Module::getInitModule(); + if ( !module ) + module = dynamic_cast( anApp->activeModule() ); + if ( module ) + myResult = module->preferenceProperty( myId, myProp ); + } + } +}; +QVariant SalomePyQt::preferenceProperty( const int id, const QString& prop ) +{ + return ProcessEvent( new TPrefPropEvent( id, prop ) ); +} + +/*! + SalomePyQt::setPreferenceProperty + Sets the property value for the given (by id) preference + */ +void SalomePyQt::setPreferenceProperty( const int id, + const QString& prop, + const QVariant& var ) +{ + class TEvent: public SALOME_Event { + int myId; + QString myProp; + QVariant myVar; + public: + TEvent( const int id, const QString& prop, const QVariant& var ) + : myId( id ), myProp( prop ), myVar( var ) {} + virtual void Execute() { + if ( SalomeApp_Application* anApp = getApplication() ) { + SALOME_PYQT_Module* module = SALOME_PYQT_Module::getInitModule(); + if ( !module ) + module = dynamic_cast( anApp->activeModule() ); + if ( module ) + module->setPreferenceProperty( myId, myProp, myVar ); + } + } + }; + ProcessVoidEvent( new TEvent( id, prop, var) ); +} + +/*! + SalomePyQt::addPreferenceProperty + Adds the property value to the list of values + for the given (by id) preference + + This method allows creating properties which are QValueList + - there is no way to pass such values directly to QVariant parameter + from Python + */ +void SalomePyQt::addPreferenceProperty( const int id, + const QString& prop, + const int idx, + const QVariant& var ) +{ + class TEvent: public SALOME_Event { + int myId; + QString myProp; + int myIdx; + QVariant myVar; + public: + TEvent( const int id, const QString& prop, const int idx, const QVariant& var ) + : myId( id ), myProp( prop ), myIdx( idx), myVar( var ) {} + virtual void Execute() { + if ( SalomeApp_Application* anApp = getApplication() ) { + SALOME_PYQT_Module* module = SALOME_PYQT_Module::getInitModule(); + if ( !module ) + module = dynamic_cast( anApp->activeModule() ); + if ( module ) { + QVariant var = module->preferenceProperty( myId, myProp ); + if ( var.isValid() ) { + if ( var.type() == QVariant::StringList ) { + QStringList sl = var.asStringList(); + if ( myIdx >= 0 && myIdx < sl.count() ) + sl[myIdx] = myVar.asString(); + else + sl.append( myVar.asString() ); + module->setPreferenceProperty( myId, myProp, sl ); + } + else if ( var.type() == QVariant::List ) { + QValueList vl = var.asList(); + if ( myIdx >= 0 && myIdx < vl.count() ) + vl[myIdx] = myVar; + else + vl.append( myVar ); + module->setPreferenceProperty( myId, myProp, vl ); + } + } + else { + QValueList vl; + vl.append( myVar ); + module->setPreferenceProperty( myId, myProp, vl ); + } + } + } + } + }; + ProcessVoidEvent( new TEvent( id, prop, idx, var) ); +} + +/*! + SalomePyQt::message + Puts the message to the Log output window + */ +void SalomePyQt::message( const QString& msg, bool addSeparator ) +{ + class TEvent: public SALOME_Event { + QString myMsg; + bool myAddSep; + public: + TEvent( const QString& msg, bool addSeparator ) + : myMsg( msg ), myAddSep( addSeparator ) {} + virtual void Execute() { + if ( SalomeApp_Application* anApp = getApplication() ) { + LogWindow* lw = anApp->logWindow(); + if ( lw ) + lw->putMessage( myMsg, myAddSep ); + } + } + }; + ProcessVoidEvent( new TEvent( msg, addSeparator ) ); +} Index: GUI_SRC_3.2.2/src/SALOME_PYQT/SalomePyQt/SalomePyQt.h =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/SALOME_PYQT/SalomePyQt/SalomePyQt.h,v retrieving revision 1.12 retrieving revision 1.12.2.2 diff -c -u -r1.12 -r1.12.2.2 --- GUI_SRC_3.2.2/src/SALOME_PYQT/SalomePyQt/SalomePyQt.h 1 Jun 2006 11:27:51 -0000 1.12 +++ GUI_SRC_3.2.2/src/SALOME_PYQT/SalomePyQt/SalomePyQt.h 23 Oct 2006 13:25:24 -0000 1.12.2.2 @@ -25,6 +25,7 @@ #include #include +#include class LightApp_SelectionMgr; class SalomeApp_Application; @@ -73,6 +74,23 @@ WT_User = LightApp_Application::WT_User }; +enum { + PT_Space = LightApp_Preferences::Space, + PT_Bool = LightApp_Preferences::Bool, + PT_Color = LightApp_Preferences::Color, + PT_String = LightApp_Preferences::String, + PT_Selector = LightApp_Preferences::Selector, + PT_DblSpin = LightApp_Preferences::DblSpin, + PT_IntSpin = LightApp_Preferences::IntSpin, + PT_Double = LightApp_Preferences::Double, + PT_Integer = LightApp_Preferences::Integer, + PT_GroupBox = LightApp_Preferences::GroupBox, + PT_Font = LightApp_Preferences::Font, + PT_DirList = LightApp_Preferences::DirList, + PT_File = LightApp_Preferences::File, + PT_User = LightApp_Preferences::User +}; + class SalomePyQt { public: @@ -143,6 +161,22 @@ static void addDoubleSetting( const QString&, const double, bool = true ); static void removeSettings ( const QString& ); static QString getSetting ( const QString& ); + + static int addPreference( const QString& ); + static int addPreference( const QString&, + const int, const int = -1, + const QString& = QString::null, + const QString& = QString::null ); + static QVariant preferenceProperty( const int, const QString& ); + static void setPreferenceProperty( const int, + const QString&, + const QVariant& ); + static void addPreferenceProperty( const int, + const QString&, + const int, + const QVariant& ); + + static void message( const QString&, bool = true ); }; #endif // SALOME_PYQT_H Index: GUI_SRC_3.2.2/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip,v retrieving revision 1.8 retrieving revision 1.8.12.2 diff -c -u -r1.8 -r1.8.12.2 --- GUI_SRC_3.2.2/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip 15 Mar 2006 13:32:22 -0000 1.8 +++ GUI_SRC_3.2.2/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip 23 Oct 2006 13:25:24 -0000 1.8.12.2 @@ -46,6 +46,23 @@ WT_User }; +enum PrefType { + PT_Space, + PT_Bool, + PT_Color, + PT_String, + PT_Selector, + PT_DblSpin, + PT_IntSpin, + PT_Double, + PT_Integer, + PT_GroupBox, + PT_Font, + PT_DirList, + PT_File, + PT_User +}; + class QtxAction : QAction { %TypeHeaderCode @@ -131,4 +148,19 @@ static void addDoubleSetting( const QString&, const double, bool = true ); static void removeSettings ( const QString& ); static QString getSetting ( const QString& ); + + static int addPreference( const QString& ); + static int addPreference( const QString&, const int, int = -1, + const QString& = QString::null, + const QString& = QString::null ); + static QVariant preferenceProperty( const int, const QString& ); + static void setPreferenceProperty( const int, + const QString&, + const QVariant& ); + static void addPreferenceProperty( const int, + const QString&, + const int, + const QVariant& ); + + static void message( const QString&, bool = true ); }; Index: GUI_SRC_3.2.2/src/SALOME_PYQT/SalomePyQt/SalomePyQt_v4.sip =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/SALOME_PYQT/SalomePyQt/SalomePyQt_v4.sip,v retrieving revision 1.9.12.1 retrieving revision 1.9.12.3 diff -c -u -r1.9.12.1 -r1.9.12.3 --- GUI_SRC_3.2.2/src/SALOME_PYQT/SalomePyQt/SalomePyQt_v4.sip 15 Aug 2006 09:47:29 -0000 1.9.12.1 +++ GUI_SRC_3.2.2/src/SALOME_PYQT/SalomePyQt/SalomePyQt_v4.sip 23 Oct 2006 13:25:24 -0000 1.9.12.3 @@ -46,6 +46,23 @@ WT_User }; +enum PrefType { + PT_Space, + PT_Bool, + PT_Color, + PT_String, + PT_Selector, + PT_DblSpin, + PT_IntSpin, + PT_Double, + PT_Integer, + PT_GroupBox, + PT_Font, + PT_DirList, + PT_File, + PT_User +}; + class QtxAction : QAction { %TypeHeaderCode @@ -130,4 +147,20 @@ static void addDoubleSetting( const QString&, const double, bool = true ) /ReleaseGIL/ ; static void removeSettings ( const QString& ) /ReleaseGIL/ ; static QString getSetting ( const QString& ) /ReleaseGIL/ ; + + static int addPreference( const QString& ) /ReleaseGIL/ ; + static int addPreference( const QString&, + const int, const int = -1, + const QString& = QString::null, + const QString& = QString::null ) /ReleaseGIL/ ; + static QVariant preferenceProperty( const int, const QString& ) /ReleaseGIL/ ; + static void setPreferenceProperty( const int, + const QString&, + const QVariant& ) /ReleaseGIL/ ; + static void addPreferenceProperty( const int, + const QString&, + const int, + const QVariant& ) /ReleaseGIL/ ; + + static void message( const QString&, bool = true ) /ReleaseGIL/ ; }; Index: GUI_SRC_3.2.2/src/SOCC/SOCC_ViewModel.cxx =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/SOCC/SOCC_ViewModel.cxx,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -c -u -r1.11 -r1.11.2.1 --- GUI_SRC_3.2.2/src/SOCC/SOCC_ViewModel.cxx 1 Jun 2006 11:27:51 -0000 1.11 +++ GUI_SRC_3.2.2/src/SOCC/SOCC_ViewModel.cxx 21 Sep 2006 13:14:17 -0000 1.11.2.1 @@ -521,12 +521,8 @@ // } //} } - - // display trihedron if necessary - if ( isTrihedronDisplayed ) - getAISContext()->Display( getTrihedron() ); - else - Repaint(); + + Repaint(); } /*! Index: GUI_SRC_3.2.2/src/STD/STD_Application.cxx =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/STD/STD_Application.cxx,v retrieving revision 1.42 retrieving revision 1.42.2.1 diff -c -u -r1.42 -r1.42.2.1 --- GUI_SRC_3.2.2/src/STD/STD_Application.cxx 1 Jun 2006 11:27:51 -0000 1.42 +++ GUI_SRC_3.2.2/src/STD/STD_Application.cxx 22 Sep 2006 06:10:33 -0000 1.42.2.1 @@ -186,13 +186,6 @@ tr( "MEN_DESK_HELP_ABOUT" ), tr( "PRP_DESK_HELP_ABOUT" ), SHIFT+Key_A, desk, false, this, SLOT( onHelpAbout() ) ); - //SRN: BugID IPAL9021, add an action "Load" - createAction( FileLoadId, tr( "TOT_DESK_FILE_LOAD" ), - resMgr->loadPixmap( "STD", tr( "ICON_FILE_OPEN" ) ), - tr( "MEN_DESK_FILE_LOAD" ), tr( "PRP_DESK_FILE_LOAD" ), - CTRL+Key_L, desk, false, this, SLOT( onLoadDoc() ) ); - //SRN: BugID IPAL9021: End - QtxDockAction* da = new QtxDockAction( tr( "TOT_DOCK_WINDOWS" ), tr( "MEN_DOCK_WINDOWS" ), desk ); registerAction( ViewWindowsId, da ); da->setAutoPlace( false ); @@ -208,7 +201,6 @@ createMenu( FileNewId, fileMenu, 0 ); createMenu( FileOpenId, fileMenu, 0 ); - createMenu( FileLoadId, fileMenu, 0 ); //SRN: BugID IPAL9021, add a menu item "Load" createMenu( FileCloseId, fileMenu, 0 ); createMenu( separator(), fileMenu, -1, 0 ); createMenu( FileSaveId, fileMenu, 0 ); @@ -322,11 +314,6 @@ return res; } -/*! called on loading the existent study */ -void STD_Application::onLoadDoc() -{ -} - /*! \retval true, if document was loaded successful, else false.*/ bool STD_Application::onLoadDoc( const QString& aName ) { Index: GUI_SRC_3.2.2/src/STD/STD_Application.h =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/STD/STD_Application.h,v retrieving revision 1.21 retrieving revision 1.21.2.1 diff -c -u -r1.21 -r1.21.2.1 --- GUI_SRC_3.2.2/src/STD/STD_Application.h 1 Jun 2006 11:27:51 -0000 1.21 +++ GUI_SRC_3.2.2/src/STD/STD_Application.h 22 Sep 2006 06:10:33 -0000 1.21.2.1 @@ -101,7 +101,6 @@ virtual void onOpenDoc(); virtual bool onOpenDoc( const QString& ); - virtual void onLoadDoc(); virtual bool onLoadDoc( const QString& ); virtual void onExit(); @@ -126,7 +125,7 @@ MenuHelpId = 7 }; - enum { FileNewId, FileOpenId, FileLoadId, FileCloseId, + enum { FileNewId, FileOpenId, FileCloseId, FileSaveId, FileSaveAsId, FileExitId, ViewStatusBarId, ViewWindowsId, NewWindowId, EditCutId, EditCopyId, EditPasteId, Index: GUI_SRC_3.2.2/src/SUIT/SUIT_DataObjectKey.h =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/SUIT/SUIT_DataObjectKey.h,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -c -u -r1.3 -r1.3.2.1 --- GUI_SRC_3.2.2/src/SUIT/SUIT_DataObjectKey.h 1 Jun 2006 11:27:51 -0000 1.3 +++ GUI_SRC_3.2.2/src/SUIT/SUIT_DataObjectKey.h 20 Sep 2006 07:58:09 -0000 1.3.2.1 @@ -29,7 +29,7 @@ { public: SUIT_DataObjectKey(); - ~SUIT_DataObjectKey(); + virtual ~SUIT_DataObjectKey(); virtual bool isLess( const SUIT_DataObjectKey* ) const = 0; virtual bool isEqual( const SUIT_DataObjectKey* ) const = 0; Index: GUI_SRC_3.2.2/src/SUIT/SUIT_PopupClient.h =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/SUIT/SUIT_PopupClient.h,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -c -u -r1.5 -r1.5.2.1 --- GUI_SRC_3.2.2/src/SUIT/SUIT_PopupClient.h 1 Jun 2006 11:27:51 -0000 1.5 +++ GUI_SRC_3.2.2/src/SUIT/SUIT_PopupClient.h 20 Sep 2006 07:58:09 -0000 1.5.2.1 @@ -36,7 +36,7 @@ class Signal; SUIT_PopupClient(); - ~SUIT_PopupClient(); + virtual ~SUIT_PopupClient(); bool connectPopupRequest( QObject* reciever, const char* slot ); bool disconnectPopupRequest( QObject* reciever, const char* slot ); Index: GUI_SRC_3.2.2/src/SUIT/SUIT_SelectionFilter.h =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/SUIT/SUIT_SelectionFilter.h,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -c -u -r1.4 -r1.4.2.1 --- GUI_SRC_3.2.2/src/SUIT/SUIT_SelectionFilter.h 1 Jun 2006 11:27:51 -0000 1.4 +++ GUI_SRC_3.2.2/src/SUIT/SUIT_SelectionFilter.h 20 Sep 2006 07:58:09 -0000 1.4.2.1 @@ -28,7 +28,7 @@ { public: SUIT_SelectionFilter(); - ~SUIT_SelectionFilter(); + virtual ~SUIT_SelectionFilter(); virtual bool isOk( const SUIT_DataOwner* ) const = 0; }; Index: GUI_SRC_3.2.2/src/SUIT/SUIT_TreeSync.h =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/SUIT/SUIT_TreeSync.h,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -c -u -r1.5 -r1.5.2.1 --- GUI_SRC_3.2.2/src/SUIT/SUIT_TreeSync.h 1 Jun 2006 11:27:51 -0000 1.5 +++ GUI_SRC_3.2.2/src/SUIT/SUIT_TreeSync.h 12 Oct 2006 14:29:24 -0000 1.5.2.1 @@ -106,7 +106,7 @@ if( td.isEqual( r1, r2 ) ) { // update items themselves - td.updateItem( r2 ); + td.updateItem( r1, r2 ); // iterate 'siblings' (direct children) QValueList< DiffItem< SrcItem, TrgItem > > d; @@ -135,7 +135,7 @@ else { //to update - td.updateItem( item.myTrg ); + td.updateItem( item.mySrc, item.myTrg ); synchronize( item.mySrc, item.myTrg, td ); lastItem = item.myTrg; } Index: GUI_SRC_3.2.2/src/SUITApp/Makefile.in =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/SUITApp/Makefile.in,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -c -u -r1.4.2.1 -r1.4.2.2 --- GUI_SRC_3.2.2/src/SUITApp/Makefile.in 4 Jul 2006 13:15:53 -0000 1.4.2.1 +++ GUI_SRC_3.2.2/src/SUITApp/Makefile.in 22 Sep 2006 11:29:56 -0000 1.4.2.2 @@ -57,6 +57,18 @@ LIBS+= -lsuit -lqtx LIBSFORBIN+= -lsuit -lqtx +PLUGINDIR = $(top_builddir)/bin/salome/styles +MYPLUGINDIR = styles + +$(MYPLUGINDIR): $(PLUGINDIR) + -$(RM) $@ + ln -sf $< $@ + +$(PLUGINDIR): + mkdir -p $@ + +bin: $(MYPLUGINDIR) + @CONCLUDE@ Index: GUI_SRC_3.2.2/src/SalomeApp/SalomeApp_Application.cxx =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/SalomeApp/SalomeApp_Application.cxx,v retrieving revision 1.86.2.4 retrieving revision 1.86.2.8 diff -c -u -r1.86.2.4 -r1.86.2.8 --- GUI_SRC_3.2.2/src/SalomeApp/SalomeApp_Application.cxx 23 Aug 2006 07:51:53 -0000 1.86.2.4 +++ GUI_SRC_3.2.2/src/SalomeApp/SalomeApp_Application.cxx 18 Oct 2006 14:01:25 -0000 1.86.2.8 @@ -81,6 +81,49 @@ #include #include +/*!Internal class that updates object browser item properties */ +class SalomeApp_Updater : public OB_Updater +{ +public: + SalomeApp_Updater() : OB_Updater(){}; + virtual ~SalomeApp_Updater(){}; + virtual void update( SUIT_DataObject* theObj, OB_ListItem* theItem ); +}; + +void SalomeApp_Updater::update( SUIT_DataObject* theObj, OB_ListItem* theItem ) +{ + if( !theObj || !theItem ) + return; + + SalomeApp_DataObject* SAObj = dynamic_cast( theObj ); + if( !SAObj ) + return; + + _PTR(SObject) SObj = SAObj->object(); + if( !SObj ) + return; + _PTR( GenericAttribute ) anAttr; + + // Selectable + if ( SObj->FindAttribute( anAttr, "AttributeSelectable" ) ) + { + _PTR(AttributeSelectable) aAttrSel = anAttr; + theItem->setSelectable( aAttrSel->IsSelectable() ); + } + // Expandable + if ( SObj->FindAttribute(anAttr, "AttributeExpandable") ) + { + _PTR(AttributeExpandable) aAttrExpand = anAttr; + theItem->setExpandable( aAttrExpand->IsExpandable() ); + } + // Opened + //this attribute is not supported in the version of SALOME 3.x + //if ( SObj->FindAttribute(anAttr, "AttributeOpened") ) + //{ + // _PTR(AttributeOpened) aAttrOpen = anAttr; + // theItem->setOpen( aAttrOpen->IsOpened() ); + //} +} /*!Create new instance of SalomeApp_Application.*/ extern "C" SALOMEAPP_EXPORT SUIT_Application* createApplication() @@ -108,6 +151,46 @@ LightApp_Application::start(); SalomeApp_EventFilter::Init(); + + static bool isFirst = true; + if ( isFirst ) { + isFirst = false; + QString hdffile; + QStringList pyfiles; + for (int i = 1; i < qApp->argc(); i++) { + QRegExp rx("--test=(.+)"); + if ( rx.search( QString(qApp->argv()[i]) ) >= 0 && rx.capturedTexts().count() > 0 ) { + QStringList files = QStringList::split(",",rx.capturedTexts()[1],false); + for (uint j = 0; j < files.count(); j++ ) { + QFileInfo fi( files[j] ); + QString extension = fi.extension( false ).lower(); + if ( extension == "hdf" && fi.exists() ) + hdffile = fi.absFilePath(); + else if ( extension == "py" || extension == "" ) + pyfiles.append( fi.baseName( true ) ); + } + } + } + if ( !hdffile.isEmpty() ) // open hdf file given as parameter + onOpenDoc( hdffile ); + else if ( pyfiles.count() > 0 ) // create new study + onNewDoc(); + // import python scripts + if ( pyfiles.count() > 0 && activeStudy() ) { + SalomeApp_Study* appStudy = dynamic_cast( activeStudy() ); + if ( appStudy ) { + _PTR(Study) aStudy = appStudy->studyDS(); + if ( !aStudy->GetProperties()->IsLocked() ) { + for ( uint i = 0; i < pyfiles.count(); i++ ) { + QString command = QString( "import %1" ).arg( pyfiles[i] ); + PythonConsole* pyConsole = pythonConsole(); + if ( pyConsole ) + pyConsole->exec( command ); + } + } + } + } + } } /*!Create actions:*/ @@ -148,12 +231,22 @@ tr( "MEN_DESK_REGISTRY_DISPLAY" ), tr( "PRP_DESK_REGISTRY_DISPLAY" ), /*SHIFT+Key_D*/0, desk, false, this, SLOT( onRegDisplay() ) ); + //SRN: BugID IPAL9021, add an action "Load" + createAction( FileLoadId, tr( "TOT_DESK_FILE_LOAD" ), + resourceMgr()->loadPixmap( "STD", tr( "ICON_FILE_OPEN" ) ), + tr( "MEN_DESK_FILE_LOAD" ), tr( "PRP_DESK_FILE_LOAD" ), + CTRL+Key_L, desk, false, this, SLOT( onLoadDoc() ) ); + //SRN: BugID IPAL9021: End + + int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1 ); // "Save GUI State" command is renamed to "Save VISU State" and // creation of menu item is moved to VISU // createMenu( SaveGUIStateId, fileMenu, 10, -1 ); + createMenu( FileLoadId, fileMenu, 0 ); //SRN: BugID IPAL9021, add a menu item "Load" + createMenu( DumpStudyId, fileMenu, 10, -1 ); createMenu( separator(), fileMenu, -1, 15, -1 ); createMenu( LoadScriptId, fileMenu, 10, -1 ); @@ -652,6 +745,7 @@ if ( flag == WT_ObjectBrowser ) { OB_Browser* ob = (OB_Browser*)wid; + ob->setUpdater( new SalomeApp_Updater() ); connect( ob->listView(), SIGNAL( doubleClicked( QListViewItem* ) ), this, SLOT( onDblClick( QListViewItem* ) ) ); bool autoSize = resMgr->booleanValue( "ObjectBrowser", "auto_size", false ), autoSizeFirst = resMgr->booleanValue( "ObjectBrowser", "auto_size_first", true ); @@ -857,7 +951,8 @@ CAM_Module* currentModule = activeModule(); if (currentModule && currentModule->moduleName() == aModuleTitle) return; - thePopup->insertItem( tr( "MEN_OPENWITH" ), this, SLOT( onOpenWith() ) ); + if ( !aModuleTitle.isEmpty() ) + thePopup->insertItem( tr( "MEN_OPENWITH" ).arg( aModuleTitle ), this, SLOT( onOpenWith() ) ); } /*!Update obect browser: Index: GUI_SRC_3.2.2/src/SalomeApp/SalomeApp_Application.h =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/SalomeApp/SalomeApp_Application.h,v retrieving revision 1.37.2.3 retrieving revision 1.37.2.4 diff -c -u -r1.37.2.3 -r1.37.2.4 --- GUI_SRC_3.2.2/src/SalomeApp/SalomeApp_Application.h 23 Aug 2006 07:51:53 -0000 1.37.2.3 +++ GUI_SRC_3.2.2/src/SalomeApp/SalomeApp_Application.h 22 Sep 2006 06:11:09 -0000 1.37.2.4 @@ -69,7 +69,7 @@ public: enum { MenuToolsId = 5 }; enum { DumpStudyId = LightApp_Application::UserID, LoadScriptId, PropertiesId, - CatalogGenId, RegDisplayId, SaveGUIStateId, UserID }; + CatalogGenId, RegDisplayId, SaveGUIStateId, FileLoadId, UserID }; public: SalomeApp_Application(); Index: GUI_SRC_3.2.2/src/SalomeApp/SalomeApp_DataModel.cxx =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/SalomeApp/SalomeApp_DataModel.cxx,v retrieving revision 1.16 retrieving revision 1.16.2.1 diff -c -u -r1.16 -r1.16.2.1 --- GUI_SRC_3.2.2/src/SalomeApp/SalomeApp_DataModel.cxx 1 Jun 2006 11:27:52 -0000 1.16 +++ GUI_SRC_3.2.2/src/SalomeApp/SalomeApp_DataModel.cxx 12 Oct 2006 14:29:24 -0000 1.16.2.1 @@ -64,7 +64,7 @@ void children( const suitPtr&, QValueList& ) const; suitPtr parent( const suitPtr& ) const; bool isCorrect( const kerPtr& ) const; - void updateItem( const suitPtr& ) const; + void updateItem( const kerPtr&, const suitPtr& ) const; private: _PTR( Study ) myStudy; @@ -87,7 +87,14 @@ { kerPtr refObj; QString name = so->GetName().c_str(); - bool res = so && ( so->GetName().size() || so->ReferencedObject( refObj ) ); + _PTR( GenericAttribute ) anAttr; + bool isDraw = true; + if ( so->FindAttribute(anAttr, "AttributeDrawable") ) + { + _PTR(AttributeDrawable) aAttrDraw = anAttr; + isDraw = aAttrDraw->IsDrawable(); + } + bool res = so && ( so->GetName().size() || so->ReferencedObject( refObj ) ) && isDraw; return res; } @@ -221,7 +228,7 @@ Updates SUIT object \param p - SUIT object */ -void SalomeApp_DataModelSync::updateItem( const suitPtr& ) const +void SalomeApp_DataModelSync::updateItem( const kerPtr& obj, const suitPtr& ) const { } @@ -333,7 +340,7 @@ { if( !study || !study->root() || !sobj ) return 0; - + DataObjectList ch; study->root()->children( ch ); DataObjectList::const_iterator anIt = ch.begin(), aLast = ch.end(); SUIT_DataObject* suitObj = 0; Index: GUI_SRC_3.2.2/src/SalomeApp/SalomeApp_DataObject.cxx =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/SalomeApp/SalomeApp_DataObject.cxx,v retrieving revision 1.21 retrieving revision 1.21.2.1 diff -c -u -r1.21 -r1.21.2.1 --- GUI_SRC_3.2.2/src/SalomeApp/SalomeApp_DataObject.cxx 1 Jun 2006 11:27:52 -0000 1.21 +++ GUI_SRC_3.2.2/src/SalomeApp/SalomeApp_DataObject.cxx 12 Oct 2006 14:29:24 -0000 1.21.2.1 @@ -186,6 +186,17 @@ else clr = QColor( 200, 200, 200 ); } + else if ( myObject ) + { + _PTR(GenericAttribute) anAttr; + if( myObject->FindAttribute ( anAttr, "AttributeTextHighlightColor") ) + { + _PTR(AttributeTextHighlightColor) aHighColAttr = anAttr; + clr = QColor( (int)(aHighColAttr->TextHighlightColor().R), + (int)(aHighColAttr->TextHighlightColor().G), + (int)(aHighColAttr->TextHighlightColor().B)); + } + } break; case HighlightedText: if ( isReference() ) Index: GUI_SRC_3.2.2/src/SalomeApp/SalomeApp_ExceptionHandler.cxx =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/SalomeApp/SalomeApp_ExceptionHandler.cxx,v retrieving revision 1.8.2.1 retrieving revision 1.8.2.4 diff -c -u -r1.8.2.1 -r1.8.2.4 --- GUI_SRC_3.2.2/src/SalomeApp/SalomeApp_ExceptionHandler.cxx 4 Sep 2006 11:30:42 -0000 1.8.2.1 +++ GUI_SRC_3.2.2/src/SalomeApp/SalomeApp_ExceptionHandler.cxx 12 Oct 2006 14:34:10 -0000 1.8.2.4 @@ -36,7 +36,14 @@ SalomeApp_ExceptionHandler::SalomeApp_ExceptionHandler( const bool floatSignal ) : SUIT_ExceptionHandler() { - OSD::SetSignal( floatSignal ); + // JFA 2006-09-28: PAL10867: suppress signal catching, + // if environment variable DISABLE_SIGNALS_CATCHING is set to 1. + // Commonly this is used with "noexcepthandler" option. + char* envNoCatchSignals = getenv("NOT_INTERCEPT_SIGNALS"); + if (!envNoCatchSignals || !atoi(envNoCatchSignals)) + { + OSD::SetSignal( floatSignal ); + } } /*!Try to call SUIT_ExceptionHandler::internalHandle(o, e), catch if failure.*/ @@ -104,5 +111,6 @@ #else raiseFPE = false; #endif + return new SalomeApp_ExceptionHandler( raiseFPE ); } Index: GUI_SRC_3.2.2/src/SalomeApp/resources/SalomeApp.xml =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/SalomeApp/resources/SalomeApp.xml,v retrieving revision 1.42.2.1 retrieving revision 1.42.2.2 diff -c -u -r1.42.2.1 -r1.42.2.2 --- GUI_SRC_3.2.2/src/SalomeApp/resources/SalomeApp.xml 27 Jun 2006 07:40:22 -0000 1.42.2.1 +++ GUI_SRC_3.2.2/src/SalomeApp/resources/SalomeApp.xml 5 Oct 2006 07:31:27 -0000 1.42.2.2 @@ -44,6 +44,10 @@ + + + + Index: GUI_SRC_3.2.2/src/SalomeApp/resources/SalomeApp_msg_en.po =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/SalomeApp/resources/SalomeApp_msg_en.po,v retrieving revision 1.32.2.1 retrieving revision 1.32.2.2 diff -c -u -r1.32.2.1 -r1.32.2.2 --- GUI_SRC_3.2.2/src/SalomeApp/resources/SalomeApp_msg_en.po 23 Aug 2006 07:57:04 -0000 1.32.2.1 +++ GUI_SRC_3.2.2/src/SalomeApp/resources/SalomeApp_msg_en.po 18 Oct 2006 14:01:09 -0000 1.32.2.2 @@ -118,7 +118,7 @@ msgstr "Object browser" msgid "SalomeApp_Application::MEN_OPENWITH" -msgstr "Activate Module" +msgstr "Activate %1 Module" msgid "SalomeApp_Application::MEN_DELETE_INVALID_REFERENCE" msgstr "Delete Invalid Reference" Index: GUI_SRC_3.2.2/src/Session/Makefile.in =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/Session/Makefile.in,v retrieving revision 1.11.2.1 retrieving revision 1.11.2.2 diff -c -u -r1.11.2.1 -r1.11.2.2 --- GUI_SRC_3.2.2/src/Session/Makefile.in 4 Sep 2006 11:30:42 -0000 1.11.2.1 +++ GUI_SRC_3.2.2/src/Session/Makefile.in 22 Sep 2006 11:29:41 -0000 1.11.2.2 @@ -65,5 +65,17 @@ LDFLAGSFORBIN= $(LDFLAGS) $(OMNIORB_LIBS) $(HDF5_LIBS) -lqtx -lSalomeContainer -lSalomeResourcesManager -lTOOLSDS -lSalomeHDFPersist -lSalomeDSImpl -lSalomeGenericObj -lRegistry -lSalomeNotification -lSALOMEBasics +PLUGINDIR = $(top_builddir)/bin/salome/styles +MYPLUGINDIR = styles + +$(MYPLUGINDIR): $(PLUGINDIR) + -$(RM) $@ + ln -sf $< $@ + +$(PLUGINDIR): + mkdir -p $@ + +bin: $(MYPLUGINDIR) + @CONCLUDE@ Index: GUI_SRC_3.2.2/src/Style/Makefile.in =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/Style/Makefile.in,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -c -u -r1.7 -r1.7.2.1 --- GUI_SRC_3.2.2/src/Style/Makefile.in 1 Jun 2006 11:27:52 -0000 1.7 +++ GUI_SRC_3.2.2/src/Style/Makefile.in 22 Sep 2006 11:29:25 -0000 1.7.2.1 @@ -50,16 +50,23 @@ LDFLAGS+=$(QT_MT_LIBS) LIBS+= -# create $(top_builddir)/src/Session/styles directory and copy libSalomeStyle.so there -LIB_PLUGINDIR = $(top_builddir)/src/Session/styles -LIB_PLUGINLIB = $(patsubst %.la, $(LIB_PLUGINDIR)/%.so, $(filter %.la, $(LIB))) +# create $(top_builddir)/bin/salome/styles directory and +# make link to the libSalomeStyle.so there +PLUGINDIR = $(top_builddir)/bin/salome/styles +PLUGIN_LIB_LA = $(patsubst %.la, $(PLUGINDIR)/%.so, $(filter %.la, $(LIB))) +PLUGIN_LIB_SO = $(patsubst %.so, $(PLUGINDIR)/%.so, $(filter %.so, $(LIB))) -lib: $(LIB) $(LIB_PLUGINDIR) $(LIB_PLUGINLIB) +lib: $(LIB) $(PLUGINDIR) $(PLUGIN_LIB_LA) $(PLUGIN_LIB_SO) -$(LIB_PLUGINDIR): +$(PLUGINDIR): mkdir -p $@ -$(LIB_PLUGINLIB): $(LIB_PLUGINDIR)/%.so: .libs/%.so +$(PLUGIN_LIB_LA): $(PLUGINDIR)/%.so: %.la + -$(RM) $@ + ln -sf $(patsubst %.la, %.so, $(CURDIR)/.libs/$<) $@ || true + ln -sf $(patsubst %.la, %.so, $(CURDIR)/.libs/$<).0 $@.0 || true + +$(PLUGIN_LIB_SO): $(PLUGINDIR)/%.so: %.so -$(RM) $@ ln -sf $(CURDIR)/$< $@ || true Index: GUI_SRC_3.2.2/src/Style/SalomeStyle.cxx =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/Style/SalomeStyle.cxx,v retrieving revision 1.10 retrieving revision 1.10.2.1 diff -c -u -r1.10 -r1.10.2.1 --- GUI_SRC_3.2.2/src/Style/SalomeStyle.cxx 1 Jun 2006 11:27:52 -0000 1.10 +++ GUI_SRC_3.2.2/src/Style/SalomeStyle.cxx 22 Sep 2006 06:08:02 -0000 1.10.2.1 @@ -483,22 +483,25 @@ int textW = flags & Style_Horizontal ? rt.height() : rt.width(); int textH = flags & Style_Horizontal ? rt.width() : rt.height(); - QString title = titleText( wnd->caption(), textW, p->fontMetrics() ); - - if ( wnd ) + QFont old_font = p->font(), f = old_font; + + QString title = titleText( wnd->caption(), textW, textH, f ); + p->setFont( f ); + if ( wnd ) { - QColorGroup cgroup = wnd->isActiveWindow() ? wnd->palette().active() : wnd->palette().inactive(); - p->setPen( cgroup.highlightedText() ); + QColorGroup cgroup = wnd->isActiveWindow() ? wnd->palette().active() : wnd->palette().inactive(); + p->setPen( cgroup.highlightedText() ); - if ( flags & Style_Horizontal ) + if ( flags & Style_Horizontal ) { - p->rotate( 270.0 ); - p->translate( -(rt.height()+rt.y()), (rt.width()-rt.x()) ); - p->drawText( 0, 0, title ); - } + p->rotate( 270.0 ); + p->translate( -(rt.height()+rt.y()), (rt.width()-rt.x()) ); + p->drawText( 0, 0, title ); + } else - p->drawText( 2, 2, textW, textH, AlignLeft, title ); - } + p->drawText( 2, 2, textW, textH, AlignLeft, title ); + } + p->setFont( old_font ); } break; } @@ -1279,10 +1282,17 @@ \param w - possible width \param fm - font metrics */ -QString SalomeStyle::titleText( const QString& txt, const int W, const QFontMetrics& fm ) const +QString SalomeStyle::titleText( const QString& txt, const int W, const int H, QFont& f ) const { QString res = txt.stripWhiteSpace(); + QFontMetrics fm( f ); + while( fm.height() > H ) + { + f.setPointSize( f.pointSize()-1 ); + fm = QFontMetrics( f ); + } + if ( fm.width( res ) > W ) { QString end( "..." ); Index: GUI_SRC_3.2.2/src/Style/SalomeStyle.h =================================================================== RCS file: /home/server/cvs/GUI/GUI_SRC_3.2.2/src/Style/SalomeStyle.h,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -c -u -r1.5 -r1.5.2.1 --- GUI_SRC_3.2.2/src/Style/SalomeStyle.h 1 Jun 2006 11:27:52 -0000 1.5 +++ GUI_SRC_3.2.2/src/Style/SalomeStyle.h 22 Sep 2006 06:08:02 -0000 1.5.2.1 @@ -92,7 +92,7 @@ void drawGradient( QPainter*, const QRect&, const QColor&, const QColor&, const Direction, gradient_func ) const; - QString titleText( const QString&, const int, const QFontMetrics& ) const; + QString titleText( const QString&, const int, const int, QFont& f ) const; private: QWidget* myTitleParent;