Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 155974 | Differences between
and this patch

Collapse All | Expand All

(-)GUI_SRC_3.2.2/adm_local/unix/config_files/check_pyqt.m4 (-4 / +25 lines)
Lines 50-55 Link Here
50
  fi	
50
  fi	
51
fi
51
fi
52
if test "x$pyqt_uic_ok" == "xno"; then
52
if test "x$pyqt_uic_ok" == "xno"; then
53
  dnl try in $PATH
54
  AC_PATH_PROG(PYUIC, pyuic)
55
  if test "x$PYUIC" != x; then
56
    PYQTDIR=$PYUIC
57
    PYQTDIR=`dirname $PYQTDIR`
58
    PYQTDIR=`dirname $PYQTDIR`
59
    pyqt_uic_ok=yes
60
  fi
61
fi
62
if test "x$pyqt_uic_ok" == "xno"; then
53
  dnl try ${SIPDIR}
63
  dnl try ${SIPDIR}
54
  if test "x${SIPDIR}" != "x"; then
64
  if test "x${SIPDIR}" != "x"; then
55
    if test -d ${SIPDIR} ; then
65
    if test -d ${SIPDIR} ; then
Lines 106-113 Link Here
106
    fi
116
    fi
107
  fi
117
  fi
108
  if test "x$pyqt_lib_ok" == "xno"; then
118
  if test "x$pyqt_lib_ok" == "xno"; then
109
    dnl try {PYQTDIR}/lib
119
    dnl try ${PYQTDIR}/lib
110
    if test -d {PYQTDIR}/lib; then
120
    if test -d ${PYQTDIR}/lib; then
111
      AC_CHECK_FILE(${PYQTDIR}/lib/libqtcmodule.so,pyqt_lib_ok=yes,pyqt_lib_ok=no)
121
      AC_CHECK_FILE(${PYQTDIR}/lib/libqtcmodule.so,pyqt_lib_ok=yes,pyqt_lib_ok=no)
112
      if test "x$pyqt_lib_ok" == "xyes"; then
122
      if test "x$pyqt_lib_ok" == "xyes"; then
113
        PYQT_LIBS="-L${PYQTDIR}/lib -lqtcmodule"
123
        PYQT_LIBS="-L${PYQTDIR}/lib -lqtcmodule"
Lines 120-127 Link Here
120
    fi
130
    fi
121
  fi
131
  fi
122
  if test "x$pyqt_lib_ok" == "xno"; then
132
  if test "x$pyqt_lib_ok" == "xno"; then
123
    dnl try {PYQTDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages
133
    dnl try ${PYQTDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages
124
    if test -d {PYQTDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages; then
134
    if test -d ${PYQTDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages; then
125
      AC_CHECK_FILE(${PYQTDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/libqtcmodule.so,pyqt_lib_ok=yes,pyqt_lib_ok=no)
135
      AC_CHECK_FILE(${PYQTDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/libqtcmodule.so,pyqt_lib_ok=yes,pyqt_lib_ok=no)
126
      if test "x$pyqt_lib_ok" == "xyes"; then
136
      if test "x$pyqt_lib_ok" == "xyes"; then
127
        PYQT_LIBS="-L${PYQTDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages -lqtcmodule"
137
        PYQT_LIBS="-L${PYQTDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages -lqtcmodule"
Lines 221-226 Link Here
221
  fi
231
  fi
222
fi
232
fi
223
if test "x$pyqt_sips_ok" == "xno"; then
233
if test "x$pyqt_sips_ok" == "xno"; then
234
  dnl try ${PYQTDIR}/share/sip/qt
235
  if test "x${PYQTDIR}" != "x"; then
236
    if test -d ${PYQTDIR}/share/sip/qt ; then
237
      AC_CHECK_FILE(${PYQTDIR}/share/sip/qt/qglobal.sip,pyqt_sips_ok=yes,pyqt_sips_ok=no)
238
      if test "x$pyqt_sips_ok" == "xyes"; then
239
        PYQT_SIPS="${PYQTDIR}/share/sip/qt"
240
      fi
241
    fi
242
  fi
243
fi
244
if test "x$pyqt_sips_ok" == "xno"; then
224
  dnl try ${SIPDIR}/sip
245
  dnl try ${SIPDIR}/sip
225
  if test "x${SIPDIR}" != "x"; then
246
  if test "x${SIPDIR}" != "x"; then
226
    if test -d ${SIPDIR}/sip ; then
247
    if test -d ${SIPDIR}/sip ; then
(-)GUI_SRC_3.2.2/adm_local/unix/config_files/check_sip.m4 (+9 lines)
Lines 44-54 Link Here
44
           SIP_VERS=v4_old ;;
44
           SIP_VERS=v4_old ;;
45
         4.2*)
45
         4.2*)
46
           SIP_VERS=v4_new ;;
46
           SIP_VERS=v4_new ;;
47
         4.3*)
48
           SIP_VERS=v4_new ;;
49
         4.4*)
50
           SIP_VERS=v4_new ;;
47
         *)
51
         *)
48
           AC_MSG_RESULT(sip version $version not supported)
52
           AC_MSG_RESULT(sip version $version not supported)
49
           SIP_VERS=unsupported ;;
53
           SIP_VERS=unsupported ;;
50
    esac
54
    esac
51
55
56
    if test "x$SIPDIR" = "x" ; then
57
        SIPDIR=`dirname $SIP`
58
        SIPDIR=`dirname $SIPDIR`
59
    fi
60
52
    sip_ok=no
61
    sip_ok=no
53
    dnl Search sip.h file
62
    dnl Search sip.h file
54
    if test "x$SIPDIR" != "x" ; then
63
    if test "x$SIPDIR" != "x" ; then
(-)GUI_SRC_3.2.2/src/Makefile.in (-2 / +2 lines)
Lines 32-38 Link Here
32
32
33
@COMMENCE@
33
@COMMENCE@
34
34
35
SUBDIRS = Qtx DDS QDS SUIT STD CAF CAM SUITApp LogWindow ObjBrowser Prs
35
SUBDIRS = Qtx Style DDS QDS SUIT STD CAF CAM SUITApp LogWindow ObjBrowser Prs
36
36
37
ifneq ($(DISABLE_SALOMEOBJECT),yes)
37
ifneq ($(DISABLE_SALOMEOBJECT),yes)
38
  SUBDIRS += OBJECT
38
  SUBDIRS += OBJECT
Lines 66-72 Link Here
66
ifneq ($(DISABLE_SUPERVGRAPHVIEWER),yes)
66
ifneq ($(DISABLE_SUPERVGRAPHVIEWER),yes)
67
  SUBDIRS += SUPERVGraph
67
  SUBDIRS += SUPERVGraph
68
endif
68
endif
69
SUBDIRS += LightApp Style ResExporter
69
SUBDIRS += LightApp ResExporter
70
70
71
ifneq ($(GUI_DISABLE_CORBA),yes)
71
ifneq ($(GUI_DISABLE_CORBA),yes)
72
  SUBDIRS +=  RegistryDisplay TOOLSGUI \
72
  SUBDIRS +=  RegistryDisplay TOOLSGUI \
(-)GUI_SRC_3.2.2/src/LightApp/LightApp_Application.cxx (-50 / +50 lines)
Lines 233-239 Link Here
233
  myAccel->setActionKey( SUIT_Accel::RotateUp,    ALT+Key_Up,        VTKViewer_Viewer::Type() );
233
  myAccel->setActionKey( SUIT_Accel::RotateUp,    ALT+Key_Up,        VTKViewer_Viewer::Type() );
234
  myAccel->setActionKey( SUIT_Accel::RotateDown,  ALT+Key_Down,      VTKViewer_Viewer::Type() );
234
  myAccel->setActionKey( SUIT_Accel::RotateDown,  ALT+Key_Down,      VTKViewer_Viewer::Type() );
235
#endif
235
#endif
236
#ifndef DISABLE_PLOT2DKVIEWER
236
#ifndef DISABLE_PLOT2DVIEWER
237
  myAccel->setActionKey( SUIT_Accel::PanLeft,     CTRL+Key_Left,     Plot2d_Viewer::Type() );
237
  myAccel->setActionKey( SUIT_Accel::PanLeft,     CTRL+Key_Left,     Plot2d_Viewer::Type() );
238
  myAccel->setActionKey( SUIT_Accel::PanRight,    CTRL+Key_Right,    Plot2d_Viewer::Type() );
238
  myAccel->setActionKey( SUIT_Accel::PanRight,    CTRL+Key_Right,    Plot2d_Viewer::Type() );
239
  myAccel->setActionKey( SUIT_Accel::PanUp,       CTRL+Key_Up,       Plot2d_Viewer::Type() );
239
  myAccel->setActionKey( SUIT_Accel::PanUp,       CTRL+Key_Up,       Plot2d_Viewer::Type() );
Lines 522-572 Link Here
522
  if ( modIcon.isNull() )
522
  if ( modIcon.isNull() )
523
    modIcon = QPixmap( imageEmptyIcon );
523
    modIcon = QPixmap( imageEmptyIcon );
524
524
525
  QToolBar* modTBar = new QtxToolBar( true, desk );
525
  QStringList modList;
526
  modTBar->setLabel( tr( "INF_TOOLBAR_MODULES" ) );
526
  modules( modList, false );
527
528
  if( modList.count()>1 )
529
  {
530
    QToolBar* modTBar = new QtxToolBar( true, desk );
531
    modTBar->setLabel( tr( "INF_TOOLBAR_MODULES" ) );
527
532
528
  QActionGroup* modGroup = new QActionGroup( this );
533
    QActionGroup* modGroup = new QActionGroup( this );
529
  modGroup->setExclusive( true );
534
    modGroup->setExclusive( true );
530
  modGroup->setUsesDropDown( true );
535
    modGroup->setUsesDropDown( true );
531
532
  a = createAction( -1, tr( "APP_NAME" ), defIcon, tr( "APP_NAME" ),
533
                    tr( "PRP_APP_MODULE" ), 0, desk, true );
534
  modGroup->add( a );
535
  myActions.insert( QString(), a );
536
536
537
  QMap<QString, QString> iconMap;
537
    a = createAction( -1, tr( "APP_NAME" ), defIcon, tr( "APP_NAME" ),
538
  moduleIconNames( iconMap );
538
                      tr( "PRP_APP_MODULE" ), 0, desk, true );
539
    modGroup->add( a );
540
    myActions.insert( QString(), a );
539
541
540
  const int iconSize = 20;
542
    QMap<QString, QString> iconMap;
543
    moduleIconNames( iconMap );
541
544
542
  modGroup->addTo( modTBar );
545
    const int iconSize = 20;
543
  QObjectList *l = modTBar->queryList( "QComboBox" );
546
544
  QObjectListIt oit( *l );
547
    modGroup->addTo( modTBar );
545
  while ( QObject* obj = oit.current() ) {
548
    QObjectList *l = modTBar->queryList( "QComboBox" );
546
    QComboBox* cb = (QComboBox*)obj;
549
    QObjectListIt oit( *l );
547
    if ( cb ) cb->setFocusPolicy( QWidget::NoFocus );
550
    while ( QObject* obj = oit.current() ) {
551
      QComboBox* cb = (QComboBox*)obj;
552
      if ( cb ) cb->setFocusPolicy( QWidget::NoFocus );
548
    ++oit;
553
    ++oit;
549
  }
554
    }
550
  delete l;
555
    delete l;
551
  
556
  
552
   modTBar->addSeparator();
557
    modTBar->addSeparator();
553
558
554
  QStringList modList;
559
    for ( it = modList.begin(); it != modList.end(); ++it )
555
  modules( modList, false );
560
    {
556
561
      if ( !isLibExists( *it ) )
557
  for ( it = modList.begin(); it != modList.end(); ++it )
562
        continue;
558
  {
559
    if ( !isLibExists( *it ) )
560
      continue;
561
    
563
    
562
    QString iconName;
564
      QString iconName;
563
    if ( iconMap.contains( *it ) )
565
      if ( iconMap.contains( *it ) )
564
      iconName = iconMap[*it];
566
        iconName = iconMap[*it];
565
567
566
    QString modName = moduleName( *it );
568
      QString modName = moduleName( *it );
567
569
568
    QPixmap icon = resMgr->loadPixmap( modName, iconName, false );
570
      QPixmap icon = resMgr->loadPixmap( modName, iconName, false );
569
    if ( icon.isNull() )
571
      if ( icon.isNull() )
570
      {
572
      {
571
	icon = modIcon;
573
	icon = modIcon;
572
	printf( "****************************************************************\n" );
574
	printf( "****************************************************************\n" );
Lines 574-589 Link Here
574
	printf( "****************************************************************\n" );
576
	printf( "****************************************************************\n" );
575
      }
577
      }
576
578
577
    icon.convertFromImage( icon.convertToImage().smoothScale( iconSize, iconSize, QImage::ScaleMin ) );
579
      icon.convertFromImage( icon.convertToImage().smoothScale( iconSize, iconSize, QImage::ScaleMin ) );
578
580
579
    QAction* a = createAction( -1, *it, icon, *it, tr( "PRP_MODULE" ).arg( *it ), 0, desk, true );
581
      QAction* a = createAction( -1, *it, icon, *it, tr( "PRP_MODULE" ).arg( *it ), 0, desk, true );
580
    a->addTo( modTBar );
582
      a->addTo( modTBar );
581
    modGroup->add( a );
583
      modGroup->add( a );
582
584
583
    myActions.insert( *it, a );
585
      myActions.insert( *it, a );
584
  }
586
    }
585
587
586
  SUIT_Tools::simplifySeparators( modTBar );
588
    SUIT_Tools::simplifySeparators( modTBar );
589
    connect( modGroup, SIGNAL( selected( QAction* ) ), this, SLOT( onModuleActivation( QAction* ) ) );
590
  }
587
591
588
  // New window
592
  // New window
589
  int windowMenu = createMenu( tr( "MEN_DESK_WINDOW" ), -1, MenuWindowId, 100 );
593
  int windowMenu = createMenu( tr( "MEN_DESK_WINDOW" ), -1, MenuWindowId, 100 );
Lines 609-616 Link Here
609
		SHIFT+Key_R, desk, false, this, SLOT( onRenameWindow() ) );
613
		SHIFT+Key_R, desk, false, this, SLOT( onRenameWindow() ) );
610
  createMenu( RenameId, windowMenu, -1 );
614
  createMenu( RenameId, windowMenu, -1 );
611
615
612
  connect( modGroup, SIGNAL( selected( QAction* ) ), this, SLOT( onModuleActivation( QAction* ) ) );
613
614
  int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1 );
616
  int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1 );
615
  createMenu( PreferencesId, fileMenu, 15, -1 );
617
  createMenu( PreferencesId, fileMenu, 15, -1 );
616
  createMenu( separator(), fileMenu, -1, 15, -1 );
618
  createMenu( separator(), fileMenu, -1, 15, -1 );
Lines 1448-1454 Link Here
1448
}
1450
}
1449
1451
1450
/*!Protected SLOT. On study closed.*/
1452
/*!Protected SLOT. On study closed.*/
1451
void LightApp_Application::onStudyClosed( SUIT_Study* )
1453
void LightApp_Application::onStudyClosed( SUIT_Study* s )
1452
{
1454
{
1453
  emit studyClosed();
1455
  emit studyClosed();
1454
1456
Lines 1457-1463 Link Here
1457
1459
1458
  activateModule( "" );
1460
  activateModule( "" );
1459
1461
1460
  saveWindowsGeometry();
1462
  for ( WindowMap::ConstIterator itr = myWindows.begin(); s && itr != myWindows.end(); ++itr )
1463
    removeWindow( itr.key(), s->id() );
1461
}
1464
}
1462
1465
1463
/*!Protected SLOT.On desktop activated.*/
1466
/*!Protected SLOT.On desktop activated.*/
Lines 1560-1568 Link Here
1560
void LightApp_Application::beforeCloseDoc( SUIT_Study* s )
1563
void LightApp_Application::beforeCloseDoc( SUIT_Study* s )
1561
{
1564
{
1562
  CAM_Application::beforeCloseDoc( s );
1565
  CAM_Application::beforeCloseDoc( s );
1563
1564
  for ( WindowMap::ConstIterator itr = myWindows.begin(); s && itr != myWindows.end(); ++itr )
1565
    removeWindow( itr.key(), s->id() );
1566
}
1566
}
1567
1567
1568
/*!Update actions.*/
1568
/*!Update actions.*/
(-)GUI_SRC_3.2.2/src/OCCViewer/OCCViewer_ViewModel.cxx (-1 / +1 lines)
Lines 358-364 Link Here
358
{
358
{
359
  AIS_ListIteratorOfListOfInteractive aIt;
359
  AIS_ListIteratorOfListOfInteractive aIt;
360
  for (aIt.Initialize(theList); aIt.More(); aIt.Next())
360
  for (aIt.Initialize(theList); aIt.More(); aIt.Next())
361
    myAISContext->SetSelected(aIt.Value(), false);
361
    myAISContext->AddOrRemoveSelected(aIt.Value(), false);
362
  myAISContext->UpdateCurrentViewer();
362
  myAISContext->UpdateCurrentViewer();
363
}
363
}
364
364
(-)GUI_SRC_3.2.2/src/ObjBrowser/OB_Browser.cxx (-2 / +26 lines)
Lines 113-119 Link Here
113
  ObjPtr   nullSrc() const;
113
  ObjPtr   nullSrc() const;
114
  ItemPtr  nullTrg() const;
114
  ItemPtr  nullTrg() const;
115
  ItemPtr  createItem( const ObjPtr&, const ItemPtr&, const ItemPtr&, const bool ) const;
115
  ItemPtr  createItem( const ObjPtr&, const ItemPtr&, const ItemPtr&, const bool ) const;
116
  void     updateItem( const ItemPtr& ) const;
116
  void     updateItem( const ObjPtr& , const ItemPtr& ) const;
117
  void     deleteItemWithChildren( const ItemPtr& ) const;
117
  void     deleteItemWithChildren( const ItemPtr& ) const;
118
  void     children( const ObjPtr&, QValueList<ObjPtr>& ) const;
118
  void     children( const ObjPtr&, QValueList<ObjPtr>& ) const;
119
  void     children( const ItemPtr&, QValueList<ItemPtr>& ) const;
119
  void     children( const ItemPtr&, QValueList<ItemPtr>& ) const;
Lines 171-183 Link Here
171
  Updates item
171
  Updates item
172
  \param p - item
172
  \param p - item
173
*/
173
*/
174
void OB_BrowserSync::updateItem( const ItemPtr& p ) const
174
void OB_BrowserSync::updateItem( const ObjPtr& o, const ItemPtr& p ) const
175
{
175
{
176
  if ( p && needUpdate( p ) ) { 
176
  if ( p && needUpdate( p ) ) { 
177
    //    printf( "--- needUpdate for %s = true ---\n", p->text( 0 ).latin1() );
177
    //    printf( "--- needUpdate for %s = true ---\n", p->text( 0 ).latin1() );
178
    myBrowser->updateText( p );
178
    myBrowser->updateText( p );
179
    p->update();
179
    p->update();
180
  }
180
  }
181
  if( o && myBrowser->getUpdater() )
182
    {
183
      myBrowser->getUpdater()->update( o, p );
184
    }
181
}
185
}
182
186
183
/*!
187
/*!
Lines 288-293 Link Here
288
292
289
myRoot( 0 ),
293
myRoot( 0 ),
290
myTooltip( 0 ),
294
myTooltip( 0 ),
295
myUpdater( 0 ),
291
myAutoOpenLevel( 0 ),
296
myAutoOpenLevel( 0 ),
292
myAutoUpdate( false ),
297
myAutoUpdate( false ),
293
myAutoDelObjs( false ),
298
myAutoDelObjs( false ),
Lines 325-330 Link Here
325
{
330
{
326
  myItems.clear();
331
  myItems.clear();
327
  delete myTooltip;
332
  delete myTooltip;
333
  setUpdater( 0 );
328
}
334
}
329
335
330
/*!
336
/*!
Lines 422-427 Link Here
422
}
428
}
423
429
424
/*!
430
/*!
431
  \return updater of browser
432
*/
433
OB_Updater* OB_Browser::getUpdater() const
434
{
435
  return myUpdater;
436
}
437
438
/*!
439
  \sets new updater of browser
440
*/
441
void OB_Browser::setUpdater( OB_Updater* theUpdate )
442
{
443
  if( myUpdater )
444
    delete myUpdater;
445
  myUpdater = theUpdate;
446
}
447
448
/*!
425
  \return root SUIT object of browser
449
  \return root SUIT object of browser
426
*/
450
*/
427
SUIT_DataObject* OB_Browser::getRootObject() const
451
SUIT_DataObject* OB_Browser::getRootObject() const
(-)GUI_SRC_3.2.2/src/ObjBrowser/OB_Browser.h (+12 lines)
Lines 39-44 Link Here
39
class OB_ListView;
39
class OB_ListView;
40
class OB_ListItem;
40
class OB_ListItem;
41
41
42
class OB_Updater 
43
{
44
public:
45
  OB_Updater(){};
46
  virtual ~OB_Updater(){};
47
  virtual void update( SUIT_DataObject* theObj, OB_ListItem* theLI ) = 0;
48
};
49
42
/*!
50
/*!
43
  \class OB_Browser
51
  \class OB_Browser
44
  Represents object browser. Allows to get/set selection, 
52
  Represents object browser. Allows to get/set selection, 
Lines 126-131 Link Here
126
134
127
  void              setModified();
135
  void              setModified();
128
  unsigned long     getModifiedTime() { return myModifiedTime; }
136
  unsigned long     getModifiedTime() { return myModifiedTime; }
137
  
138
  OB_Updater*       getUpdater() const;
139
  virtual void      setUpdater( OB_Updater* theUpdate = 0 );
129
140
130
signals:
141
signals:
131
  void              selectionChanged();
142
  void              selectionChanged();
Lines 188-193 Link Here
188
  SUIT_DataObject*  myRoot;
199
  SUIT_DataObject*  myRoot;
189
  ItemMap           myItems;
200
  ItemMap           myItems;
190
  QToolTip*         myTooltip;
201
  QToolTip*         myTooltip;
202
  OB_Updater*       myUpdater;
191
  QMap<int, int>    myColumnIds;
203
  QMap<int, int>    myColumnIds;
192
  bool              myAutoUpdate;
204
  bool              myAutoUpdate;
193
  bool              myAutoDelObjs;
205
  bool              myAutoDelObjs;
(-)GUI_SRC_3.2.2/src/PythonConsole/PythonConsole_PyEditor.cxx (-1 / +9 lines)
Lines 148-155 Link Here
148
void PythonConsole_PyEditor::exec( const QString& command )
148
void PythonConsole_PyEditor::exec( const QString& command )
149
{
149
{
150
  // Some interactive command is being executed in this editor -> do nothing
150
  // Some interactive command is being executed in this editor -> do nothing
151
  if ( isReadOnly() )
151
  if ( isReadOnly() ) {
152
    myQueue.push_back( command );
152
    return;
153
    return;
154
  }
153
  int para=paragraphs()-1;
155
  int para=paragraphs()-1;
154
  removeParagraph( para );
156
  removeParagraph( para );
155
  _currentPrompt = READY_PROMPT;
157
  _currentPrompt = READY_PROMPT;
Lines 680-685 Link Here
680
682
681
  setReadOnly( false );
683
  setReadOnly( false );
682
  _isInHistory = false;
684
  _isInHistory = false;
685
686
  if ( e->type() == PyInterp_Event::OK && myQueue.count() > 0 ) {
687
    QString nextcmd = myQueue[0];
688
    myQueue.pop_front();
689
    exec( nextcmd );
690
  }
683
}
691
}
684
692
685
/*!
693
/*!
(-)GUI_SRC_3.2.2/src/PythonConsole/PythonConsole_PyEditor.h (-3 / +4 lines)
Lines 69-77 Link Here
69
69
70
  PyInterp_base* myInterp;
70
  PyInterp_base* myInterp;
71
71
72
  QString myBanner;
72
  QString        myBanner;
73
  QString myOutput;
73
  QString        myOutput;
74
  QString myError;
74
  QString        myError;
75
  QStringList    myQueue;
75
};
76
};
76
77
77
#endif
78
#endif
(-)GUI_SRC_3.2.2/src/Qtx/QtxListResourceEdit.cxx (-8 / +9 lines)
Lines 686-693 Link Here
686
void QtxListResourceEdit::SelectItem::store()
686
void QtxListResourceEdit::SelectItem::store()
687
{
687
{
688
  int idx = myList->currentItem();
688
  int idx = myList->currentItem();
689
  if ( myIndex.contains( idx ) )
689
  if ( idx >= 0 )
690
    setInteger( myIndex[idx] );
690
    setInteger( myIndex.contains( idx ) ? myIndex[idx] : idx );
691
}
691
}
692
692
693
/*!
693
/*!
Lines 697-710 Link Here
697
{
697
{
698
  int id = getInteger( -1 );
698
  int id = getInteger( -1 );
699
699
700
  int idx = -1;
700
  for ( QMap<int, int>::ConstIterator it = myIndex.begin(); it != myIndex.end(); ++it )
701
  for ( QMap<int, int>::ConstIterator it = myIndex.begin(); it != myIndex.end() && idx == -1; ++it )
702
  {
701
  {
703
    if ( it.data() == id )
702
    if ( it.data() == id ) {
704
      idx = it.key();
703
      myList->setCurrentItem( it.key() );
704
      return;
705
    }
705
  }
706
  }
706
707
  if ( id >= 0 )
707
  myList->setCurrentItem( idx );
708
    myList->setCurrentItem( id );
708
}
709
}
709
710
710
/*!
711
/*!
(-)GUI_SRC_3.2.2/src/Qtx/QtxResourceEdit.h (-1 / +1 lines)
Lines 135-141 Link Here
135
135
136
  virtual void         update();
136
  virtual void         update();
137
137
138
  QVariant             property( const QString& ) const;
138
  virtual QVariant     property( const QString& ) const;
139
  virtual void         setProperty( const QString&, const QVariant& );
139
  virtual void         setProperty( const QString&, const QVariant& );
140
140
141
  virtual void         store() = 0;
141
  virtual void         store() = 0;
(-)GUI_SRC_3.2.2/src/Qtx/QtxResourceMgr.h (-1 / +1 lines)
Lines 185-191 Link Here
185
{
185
{
186
public:
186
public:
187
  Format( const QString& );
187
  Format( const QString& );
188
  ~Format();
188
  virtual ~Format();
189
189
190
  QString                format() const;
190
  QString                format() const;
191
191
(-)GUI_SRC_3.2.2/src/SALOME_PY/SalomePy.cxx (-9 / +3 lines)
Lines 118-126 Link Here
118
{
118
{
119
  //return ProcessEvent( new TGetRendererEvent() );
119
  //return ProcessEvent( new TGetRendererEvent() );
120
  PyObject * aResult;
120
  PyObject * aResult;
121
  Py_BEGIN_ALLOW_THREADS // PAL12755
122
  aResult = ProcessEvent( new TGetRendererEvent() );
121
  aResult = ProcessEvent( new TGetRendererEvent() );
123
  Py_END_ALLOW_THREADS // PAL12755
124
  return aResult;
122
  return aResult;
125
}
123
}
126
124
Lines 144-152 Link Here
144
{
142
{
145
  //return ProcessEvent( new TGetRenderWindowEvent() );
143
  //return ProcessEvent( new TGetRenderWindowEvent() );
146
  PyObject * aResult;
144
  PyObject * aResult;
147
  Py_BEGIN_ALLOW_THREADS // PAL12755
148
  aResult = ProcessEvent( new TGetRenderWindowEvent() );
145
  aResult = ProcessEvent( new TGetRenderWindowEvent() );
149
  Py_END_ALLOW_THREADS // PAL12755
150
  return aResult;
146
  return aResult;
151
}
147
}
152
148
Lines 170-178 Link Here
170
{
166
{
171
  //return ProcessEvent( new TGetRenderWindowInteractorEvent() );
167
  //return ProcessEvent( new TGetRenderWindowInteractorEvent() );
172
  PyObject * aResult;
168
  PyObject * aResult;
173
  Py_BEGIN_ALLOW_THREADS // PAL12755
174
  aResult = ProcessEvent( new TGetRenderWindowInteractorEvent() );
169
  aResult = ProcessEvent( new TGetRenderWindowInteractorEvent() );
175
  Py_END_ALLOW_THREADS // PAL12755
176
  return aResult;
170
  return aResult;
177
}
171
}
178
172
Lines 181-189 Link Here
181
*/
175
*/
182
static PyMethodDef Module_Methods[] = 
176
static PyMethodDef Module_Methods[] = 
183
{
177
{
184
  { "getRenderer",               libSalomePy_getRenderer,     METH_NOARGS },
178
  { "getRenderer",               libSalomePy_getRenderer,               METH_NOARGS },
185
  { "getRenderWindow",           libSalomePy_getRenderWindow, METH_NOARGS },
179
  { "getRenderWindow",           libSalomePy_getRenderWindow,           METH_NOARGS },
186
  { "getRenderWindowInteractor", libSalomePy_getRenderWindow, METH_NOARGS },
180
  { "getRenderWindowInteractor", libSalomePy_getRenderWindowInteractor, METH_NOARGS },
187
  { NULL, NULL }
181
  { NULL, NULL }
188
};
182
};
189
183
(-)GUI_SRC_3.2.2/src/SALOME_PYQT/SALOME_PYQT_GUI/Makefile.in (+4 lines)
Lines 36-41 Link Here
36
QT_VERS = Qt_3_3_0
36
QT_VERS = Qt_3_3_0
37
endif
37
endif
38
38
39
ifeq ($(QT_VERS),Qt_3_3_6)
40
QT_VERS = Qt_3_3_0
41
endif
42
39
# Sip flags
43
# Sip flags
40
SIP_FLAGS = -t WS_X11 -t $(QT_VERS) $(PYQT_SIPFLAGS) -s ".cc" -c . -I $(PYQT_SIPS)
44
SIP_FLAGS = -t WS_X11 -t $(QT_VERS) $(PYQT_SIPFLAGS) -s ".cc" -c . -I $(PYQT_SIPS)
41
45
(-)GUI_SRC_3.2.2/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx (-2 / +91 lines)
Lines 539-544 Link Here
539
}
539
}
540
540
541
/*!
541
/*!
542
 * Export preferences for the Python module.
543
 * Called only once when the first instance of the module is created.
544
 */
545
void SALOME_PYQT_Module::createPreferences()
546
{
547
  MESSAGE( "SALOME_PYQT_Module::createPr eferences");
548
  // perform synchronous request to Python event dispatcher
549
  class Event : public PyInterp_LockRequest
550
  {
551
  public:
552
    Event( PyInterp_base*      _py_interp,
553
	   SALOME_PYQT_Module* _obj )
554
      : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true)
555
        myObj    ( _obj )   {}
556
557
  protected:
558
    virtual void execute()
559
    {
560
      myObj->initPreferences();
561
    }
562
563
  private:
564
    SALOME_PYQT_Module* myObj;
565
  };
566
567
  // Posting the request only if dispatcher is not busy!
568
  // Executing the request synchronously
569
  if ( !PyInterp_Dispatcher::Get()->IsBusy() )
570
    PyInterp_Dispatcher::Get()->Exec( new Event( myInterp, this ) );
571
}
572
573
/*!
542
 * Defines the dockable window associated with the module.
574
 * Defines the dockable window associated with the module.
543
 * To fill the list of windows the correspondind Python module's windows()
575
 * To fill the list of windows the correspondind Python module's windows()
544
 * method is called from SALOME_PYQT_Module::init() method.
576
 * method is called from SALOME_PYQT_Module::init() method.
Lines 618-625 Link Here
618
  // ... first put default values
650
  // ... first put default values
619
  myWindowsMap.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::DockLeft );
651
  myWindowsMap.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::DockLeft );
620
  myWindowsMap.insert( SalomeApp_Application::WT_PyConsole,     Qt::DockBottom );
652
  myWindowsMap.insert( SalomeApp_Application::WT_PyConsole,     Qt::DockBottom );
621
  // VSR: LogWindow is not yet implemented
653
  myWindowsMap.insert( SalomeApp_Application::WT_LogWindow,     Qt::DockBottom );
622
  // myWindowsMap.insert( SalomeApp_Application::WT_LogWindow,     Qt::DockBottom );
623
654
624
  if(PyObject_HasAttrString(myModule , "windows")){
655
  if(PyObject_HasAttrString(myModule , "windows")){
625
    PyObjWrapper res1( PyObject_CallMethod( myModule, "windows", "" ) );
656
    PyObjWrapper res1( PyObject_CallMethod( myModule, "windows", "" ) );
Lines 947-952 Link Here
947
}
978
}
948
979
949
/*!
980
/*!
981
 *  Initialises preferences for the module
982
 *  - calls Python module's createPreferences() method
983
 */
984
void SALOME_PYQT_Module::initPreferences()
985
{
986
  // Python interpreter should be initialized and Python module should be
987
  // import first
988
  if ( !myInterp || !myModule )
989
    return;
990
991
  // temporary set myInitModule because createPreferences() method
992
  // might be called during the module intialization process
993
  myInitModule = this;
994
995
  if ( PyObject_HasAttrString(myModule , "createPreferences") ) {
996
    PyObjWrapper res( PyObject_CallMethod( myModule, "createPreferences", "" ) );
997
    if( !res ) {
998
      PyErr_Print();
999
    }
1000
  }
1001
1002
  myInitModule = 0;
1003
}
1004
1005
/*!
950
 *  Initialises python subinterpreter (one per study)
1006
 *  Initialises python subinterpreter (one per study)
951
 */
1007
 */
952
void SALOME_PYQT_Module::initInterp( int theStudyId )
1008
void SALOME_PYQT_Module::initInterp( int theStudyId )
Lines 1241-1246 Link Here
1241
  }
1297
  }
1242
  return a;
1298
  return a;
1243
}
1299
}
1300
1244
/*! 
1301
/*! 
1245
 * Load icon from resource file
1302
 * Load icon from resource file
1246
 */
1303
 */
Lines 1434-1439 Link Here
1434
  return false;
1491
  return false;
1435
}
1492
}
1436
1493
1494
/*!
1495
 * The next methods call the parent implementation.
1496
 * This is done to open protected methods from LightApp_Module class.
1497
 */
1498
1499
int SALOME_PYQT_Module::addPreference( const QString& label )
1500
{
1501
  return SalomeApp_Module::addPreference( label );
1502
}
1503
				       
1504
int SALOME_PYQT_Module::addPreference( const QString& label, 
1505
				       const int pId, const int type,
1506
				       const QString& section,
1507
				       const QString& param )
1508
{
1509
  return SalomeApp_Module::addPreference( label, pId, type, section, param );
1510
}
1511
1512
QVariant SALOME_PYQT_Module::preferenceProperty( const int id, 
1513
						 const QString& prop ) const
1514
{
1515
  QVariant v = SalomeApp_Module::preferenceProperty( id, prop );
1516
  return v;
1517
}
1518
1519
void SALOME_PYQT_Module::setPreferenceProperty( const int id, 
1520
						const QString& prop, 
1521
						const QVariant& var )
1522
{
1523
  SalomeApp_Module::setPreferenceProperty( id, prop, var );
1524
}
1525
1437
// SALOME_PYQT_XmlHandler class implementation
1526
// SALOME_PYQT_XmlHandler class implementation
1438
1527
1439
// gets an tag name for the dom element [ static ]
1528
// gets an tag name for the dom element [ static ]
(-)GUI_SRC_3.2.2/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.h (+13 lines)
Lines 109-114 Link Here
109
  /* context popup menu request */
109
  /* context popup menu request */
110
  void            contextMenuPopup( const QString&, QPopupMenu*, QString& );
110
  void            contextMenuPopup( const QString&, QPopupMenu*, QString& );
111
111
112
  /* create preferences */
113
  void            createPreferences();
114
112
  /* get module engine IOR */
115
  /* get module engine IOR */
113
  virtual QString engineIOR() const;
116
  virtual QString engineIOR() const;
114
117
Lines 147-152 Link Here
147
  /* load icon from resource file */
150
  /* load icon from resource file */
148
  QIconSet               loadIcon( const QString& fileName );
151
  QIconSet               loadIcon( const QString& fileName );
149
152
153
  /* working with preferences : open protected methods */
154
  int                    addPreference( const QString& );
155
  int                    addPreference( const QString&, const int, const int = -1,
156
					const QString& = QString::null,
157
					const QString& = QString::null );
158
  QVariant               preferenceProperty( const int, const QString& ) const;
159
  void                   setPreferenceProperty( const int, const QString&, const QVariant& );
160
150
  /* Show/hide menus/toolbars */
161
  /* Show/hide menus/toolbars */
151
  void                   setMenuShown( const bool );
162
  void                   setMenuShown( const bool );
152
  void                   setToolShown( const bool );
163
  void                   setToolShown( const bool );
Lines 194-199 Link Here
194
  void            guiEvent( const int );
205
  void            guiEvent( const int );
195
  /* Menu highlight processing */
206
  /* Menu highlight processing */
196
  void            menuHighlight( const int, const int );
207
  void            menuHighlight( const int, const int );
208
  /* Init preferences */
209
  void            initPreferences();
197
210
198
  /* initialize a Python subinterpreter */
211
  /* initialize a Python subinterpreter */
199
  void            initInterp  ( int );
212
  void            initInterp  ( int );
(-)GUI_SRC_3.2.2/src/SALOME_PYQT/SalomePyQt/Makefile.in (+3 lines)
Lines 35-40 Link Here
35
ifeq ($(QT_VERS),Qt_3_3_4)
35
ifeq ($(QT_VERS),Qt_3_3_4)
36
QT_VERS = Qt_3_3_0
36
QT_VERS = Qt_3_3_0
37
endif
37
endif
38
ifeq ($(QT_VERS),Qt_3_3_6)
39
QT_VERS = Qt_3_3_0
40
endif
38
41
39
# Sip flags
42
# Sip flags
40
SIP_FLAGS = -t WS_X11 -t $(QT_VERS) $(PYQT_SIPFLAGS) -s ".cc" -c . -I $(PYQT_SIPS)
43
SIP_FLAGS = -t WS_X11 -t $(QT_VERS) $(PYQT_SIPFLAGS) -s ".cc" -c . -I $(PYQT_SIPS)
(-)GUI_SRC_3.2.2/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx (+202 lines)
Lines 39-44 Link Here
39
#include "LightApp_SelectionMgr.h"
39
#include "LightApp_SelectionMgr.h"
40
#include "OB_Browser.h"
40
#include "OB_Browser.h"
41
#include "QtxAction.h"
41
#include "QtxAction.h"
42
#include "LogWindow.h"
42
43
43
using namespace std;
44
using namespace std;
44
45
Lines 1364-1366 Link Here
1364
  return ProcessEvent( new TClearMenuEvent( id, menu, removeActions ) );
1365
  return ProcessEvent( new TClearMenuEvent( id, menu, removeActions ) );
1365
}
1366
}
1366
1367
1368
/*!
1369
  SalomePyQt::addPreference
1370
  Adds preference 
1371
 */
1372
class TAddPrefEvent: public SALOME_Event {
1373
public:
1374
  typedef int TResult;
1375
  TResult myResult;
1376
  QString myLabel;
1377
  TAddPrefEvent( const QString& label )
1378
    : myResult( -1 ), myLabel( label ) {}
1379
  virtual void Execute() {
1380
    if ( SalomeApp_Application* anApp = getApplication() ) {
1381
      SALOME_PYQT_Module* module = SALOME_PYQT_Module::getInitModule();
1382
      if ( !module )
1383
        module = dynamic_cast<SALOME_PYQT_Module*>( anApp->activeModule() );
1384
      if ( module )
1385
	myResult = module->addPreference( myLabel );
1386
    }
1387
  }
1388
};
1389
int SalomePyQt::addPreference( const QString& label )
1390
{
1391
  return ProcessEvent( new TAddPrefEvent( label ) );
1392
}
1393
1394
/*!
1395
  SalomePyQt::addPreference
1396
  Adds preference 
1397
 */
1398
class TAddPrefParamEvent: public SALOME_Event {
1399
public:
1400
  typedef int TResult;
1401
  TResult myResult;
1402
  QString myLabel;
1403
  int     myPId;
1404
  int     myType;
1405
  QString mySection;
1406
  QString myParam;
1407
  TAddPrefParamEvent( const QString& label, 
1408
		      const int pId, const int type,
1409
		      const QString& section, 
1410
		      const QString& param )
1411
    : myResult( -1 ),
1412
      myLabel( label ), myPId( pId ), myType( type ), 
1413
      mySection( section ), myParam ( param ) {}
1414
  virtual void Execute() {
1415
    if ( SalomeApp_Application* anApp = getApplication() ) {
1416
      SALOME_PYQT_Module* module = SALOME_PYQT_Module::getInitModule();
1417
      if ( !module )
1418
        module = dynamic_cast<SALOME_PYQT_Module*>( anApp->activeModule() );
1419
      if ( module )
1420
	myResult = module->addPreference( myLabel, myPId, myType, mySection, myParam );
1421
    }
1422
  }
1423
};
1424
int SalomePyQt::addPreference( const QString& label, const int pId, const int type,
1425
			       const QString& section, const QString& param )
1426
{
1427
  return ProcessEvent( new TAddPrefParamEvent( label, pId, type, section, param ) );
1428
}
1429
1430
/*!
1431
  SalomePyQt::preferenceProperty
1432
  Gets the property value for the given (by id) preference
1433
 */
1434
class TPrefPropEvent: public SALOME_Event {
1435
public:
1436
  typedef QVariant TResult;
1437
  TResult myResult;
1438
  int     myId;
1439
  QString myProp;
1440
  TPrefPropEvent( const int id, const QString& prop )
1441
    : myId( id ), myProp( prop )
1442
  { 
1443
    myResult = QVariant();
1444
  }
1445
  virtual void Execute() {
1446
    if ( SalomeApp_Application* anApp = getApplication() ) {
1447
      SALOME_PYQT_Module* module = SALOME_PYQT_Module::getInitModule();
1448
      if ( !module )
1449
        module = dynamic_cast<SALOME_PYQT_Module*>( anApp->activeModule() );
1450
      if ( module )
1451
	myResult = module->preferenceProperty( myId, myProp );
1452
    }
1453
  }
1454
};
1455
QVariant SalomePyQt::preferenceProperty( const int id, const QString& prop )
1456
{
1457
  return ProcessEvent( new TPrefPropEvent( id, prop ) );
1458
}
1459
1460
/*!
1461
  SalomePyQt::setPreferenceProperty
1462
  Sets the property value for the given (by id) preference
1463
 */
1464
void SalomePyQt::setPreferenceProperty( const int id, 
1465
					const QString& prop,
1466
					const QVariant& var )
1467
{
1468
  class TEvent: public SALOME_Event {
1469
    int      myId;
1470
    QString  myProp;
1471
    QVariant myVar;
1472
  public:
1473
    TEvent( const int id, const QString& prop, const QVariant& var ) 
1474
      : myId( id ), myProp( prop ), myVar( var ) {}
1475
    virtual void Execute() {
1476
      if ( SalomeApp_Application* anApp = getApplication() ) {
1477
	SALOME_PYQT_Module* module = SALOME_PYQT_Module::getInitModule();
1478
	if ( !module )
1479
	  module = dynamic_cast<SALOME_PYQT_Module*>( anApp->activeModule() );
1480
	if ( module )
1481
	  module->setPreferenceProperty( myId, myProp, myVar );
1482
      }
1483
    }
1484
  };
1485
  ProcessVoidEvent( new TEvent( id, prop, var) );
1486
}
1487
1488
/*!
1489
  SalomePyQt::addPreferenceProperty
1490
  Adds the property value to the list of values 
1491
  for the given (by id) preference
1492
1493
  This method allows creating properties which are QValueList<QVariant>
1494
  - there is no way to pass such values directly to QVariant parameter
1495
  from Python
1496
 */
1497
void SalomePyQt::addPreferenceProperty( const int id, 
1498
					const QString& prop,
1499
					const int idx, 
1500
					const QVariant& var )
1501
{
1502
  class TEvent: public SALOME_Event {
1503
    int      myId;
1504
    QString  myProp;
1505
    int      myIdx;
1506
    QVariant myVar;
1507
  public:
1508
    TEvent( const int id, const QString& prop, const int idx, const QVariant& var ) 
1509
      : myId( id ), myProp( prop ), myIdx( idx), myVar( var ) {}
1510
    virtual void Execute() {
1511
      if ( SalomeApp_Application* anApp = getApplication() ) {
1512
	SALOME_PYQT_Module* module = SALOME_PYQT_Module::getInitModule();
1513
	if ( !module )
1514
	  module = dynamic_cast<SALOME_PYQT_Module*>( anApp->activeModule() );
1515
	if ( module ) {
1516
	  QVariant var =  module->preferenceProperty( myId, myProp );
1517
	  if ( var.isValid() ) {
1518
	    if ( var.type() == QVariant::StringList ) {
1519
	      QStringList sl = var.asStringList();
1520
	      if ( myIdx >= 0 && myIdx < sl.count() ) 
1521
		sl[myIdx] = myVar.asString();
1522
	      else
1523
		sl.append( myVar.asString() );
1524
	      module->setPreferenceProperty( myId, myProp, sl );
1525
	    }
1526
	    else if ( var.type() == QVariant::List ) {
1527
	      QValueList<QVariant> vl = var.asList();
1528
	      if ( myIdx >= 0 && myIdx < vl.count() ) 
1529
		vl[myIdx] = myVar;
1530
	      else
1531
		vl.append( myVar );
1532
	      module->setPreferenceProperty( myId, myProp, vl );
1533
	    }
1534
	  }
1535
	  else {
1536
	    QValueList<QVariant> vl;
1537
	    vl.append( myVar );
1538
	    module->setPreferenceProperty( myId, myProp, vl );
1539
	  }
1540
	}
1541
      }
1542
    }
1543
  };
1544
  ProcessVoidEvent( new TEvent( id, prop, idx, var) );
1545
}
1546
1547
/*!
1548
  SalomePyQt::message
1549
  Puts the message to the Log output window
1550
 */
1551
void SalomePyQt::message( const QString& msg, bool addSeparator )
1552
{
1553
  class TEvent: public SALOME_Event {
1554
    QString  myMsg;
1555
    bool     myAddSep;
1556
  public:
1557
    TEvent( const QString& msg, bool addSeparator ) 
1558
      : myMsg( msg ), myAddSep( addSeparator ) {}
1559
    virtual void Execute() {
1560
      if ( SalomeApp_Application* anApp = getApplication() ) {
1561
	LogWindow* lw = anApp->logWindow();
1562
	if ( lw )
1563
	  lw->putMessage( myMsg, myAddSep );
1564
      }
1565
    }
1566
  };
1567
  ProcessVoidEvent( new TEvent( msg, addSeparator ) );
1568
}
(-)GUI_SRC_3.2.2/src/SALOME_PYQT/SalomePyQt/SalomePyQt.h (+34 lines)
Lines 25-30 Link Here
25
#include <qcolor.h>
25
#include <qcolor.h>
26
26
27
#include <LightApp_Application.h>
27
#include <LightApp_Application.h>
28
#include <LightApp_Preferences.h>
28
29
29
class LightApp_SelectionMgr;
30
class LightApp_SelectionMgr;
30
class SalomeApp_Application;
31
class SalomeApp_Application;
Lines 73-78 Link Here
73
  WT_User          = LightApp_Application::WT_User
74
  WT_User          = LightApp_Application::WT_User
74
};
75
};
75
76
77
enum { 
78
  PT_Space    = LightApp_Preferences::Space,
79
  PT_Bool     = LightApp_Preferences::Bool, 
80
  PT_Color    = LightApp_Preferences::Color,
81
  PT_String   = LightApp_Preferences::String, 
82
  PT_Selector = LightApp_Preferences::Selector, 
83
  PT_DblSpin  = LightApp_Preferences::DblSpin, 
84
  PT_IntSpin  = LightApp_Preferences::IntSpin, 
85
  PT_Double   = LightApp_Preferences::Double, 
86
  PT_Integer  = LightApp_Preferences::Integer, 
87
  PT_GroupBox = LightApp_Preferences::GroupBox, 
88
  PT_Font     = LightApp_Preferences::Font, 
89
  PT_DirList  = LightApp_Preferences::DirList, 
90
  PT_File     = LightApp_Preferences::File, 
91
  PT_User     = LightApp_Preferences::User
92
};
93
76
class SalomePyQt
94
class SalomePyQt
77
{
95
{
78
public:
96
public:
Lines 143-148 Link Here
143
  static void              addDoubleSetting( const QString&, const double,   bool = true );
161
  static void              addDoubleSetting( const QString&, const double,   bool = true );
144
  static void              removeSettings  ( const QString& );
162
  static void              removeSettings  ( const QString& );
145
  static QString           getSetting      ( const QString& );
163
  static QString           getSetting      ( const QString& );
164
165
  static int               addPreference( const QString& );
166
  static int               addPreference( const QString&,
167
                                          const int, const int = -1,
168
                                          const QString& = QString::null,
169
				          const QString& = QString::null );
170
  static QVariant          preferenceProperty( const int, const QString& );
171
  static void              setPreferenceProperty( const int, 
172
                                                  const QString&,
173
                                                  const QVariant& );
174
  static void              addPreferenceProperty( const int,
175
						  const QString&,
176
						  const int,
177
						  const QVariant& );
178
179
  static void              message( const QString&, bool = true );
146
};
180
};
147
181
148
#endif // SALOME_PYQT_H
182
#endif // SALOME_PYQT_H
(-)GUI_SRC_3.2.2/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip (+32 lines)
Lines 46-51 Link Here
46
  WT_User
46
  WT_User
47
};
47
};
48
48
49
enum PrefType { 
50
  PT_Space,
51
  PT_Bool, 
52
  PT_Color,
53
  PT_String, 
54
  PT_Selector, 
55
  PT_DblSpin, 
56
  PT_IntSpin, 
57
  PT_Double, 
58
  PT_Integer, 
59
  PT_GroupBox, 
60
  PT_Font, 
61
  PT_DirList, 
62
  PT_File, 
63
  PT_User
64
};
65
49
class QtxAction : QAction
66
class QtxAction : QAction
50
{
67
{
51
%TypeHeaderCode
68
%TypeHeaderCode
Lines 131-134 Link Here
131
  static void              addDoubleSetting( const QString&, const double,   bool = true );
148
  static void              addDoubleSetting( const QString&, const double,   bool = true );
132
  static void              removeSettings  ( const QString& );
149
  static void              removeSettings  ( const QString& );
133
  static QString           getSetting      ( const QString& );
150
  static QString           getSetting      ( const QString& );
151
152
  static int               addPreference( const QString& );
153
  static int               addPreference( const QString&, const int, int = -1,
154
					  const QString& = QString::null,
155
					  const QString& = QString::null );
156
  static QVariant          preferenceProperty( const int, const QString& );
157
  static void              setPreferenceProperty( const int, 
158
                                                  const QString&,
159
						  const QVariant& );
160
  static void              addPreferenceProperty( const int, 
161
                                                  const QString&,
162
						  const int, 
163
						  const QVariant& );
164
165
  static void              message( const QString&, bool = true );
134
};
166
};
(-)GUI_SRC_3.2.2/src/SALOME_PYQT/SalomePyQt/SalomePyQt_v4.sip (+33 lines)
Lines 46-51 Link Here
46
  WT_User
46
  WT_User
47
};
47
};
48
48
49
enum PrefType { 
50
  PT_Space,
51
  PT_Bool, 
52
  PT_Color,
53
  PT_String, 
54
  PT_Selector, 
55
  PT_DblSpin, 
56
  PT_IntSpin, 
57
  PT_Double, 
58
  PT_Integer, 
59
  PT_GroupBox, 
60
  PT_Font, 
61
  PT_DirList, 
62
  PT_File, 
63
  PT_User
64
};
65
49
class QtxAction : QAction
66
class QtxAction : QAction
50
{
67
{
51
%TypeHeaderCode
68
%TypeHeaderCode
Lines 130-133 Link Here
130
  static void              addDoubleSetting( const QString&, const double,   bool = true ) /ReleaseGIL/ ;
147
  static void              addDoubleSetting( const QString&, const double,   bool = true ) /ReleaseGIL/ ;
131
  static void              removeSettings  ( const QString& ) /ReleaseGIL/ ;
148
  static void              removeSettings  ( const QString& ) /ReleaseGIL/ ;
132
  static QString           getSetting      ( const QString& ) /ReleaseGIL/ ;
149
  static QString           getSetting      ( const QString& ) /ReleaseGIL/ ;
150
151
  static int               addPreference( const QString& ) /ReleaseGIL/ ;
152
  static int               addPreference( const QString&,
153
                                          const int, const int = -1,
154
                                          const QString& = QString::null,
155
				          const QString& = QString::null ) /ReleaseGIL/ ;
156
  static QVariant          preferenceProperty( const int, const QString& ) /ReleaseGIL/ ;
157
  static void              setPreferenceProperty( const int, 
158
                                                  const QString&,
159
                                                  const QVariant& ) /ReleaseGIL/ ;
160
  static void              addPreferenceProperty( const int, 
161
                                                  const QString&, 
162
						  const int, 
163
						  const QVariant& ) /ReleaseGIL/ ;
164
165
  static void              message( const QString&, bool = true ) /ReleaseGIL/ ;
133
};
166
};
(-)GUI_SRC_3.2.2/src/SOCC/SOCC_ViewModel.cxx (-6 / +2 lines)
Lines 521-532 Link Here
521
    //  }
521
    //  }
522
    //}
522
    //}
523
  }
523
  }
524
524
  
525
  // display trihedron if necessary
525
  Repaint();
526
  if ( isTrihedronDisplayed )
527
    getAISContext()->Display( getTrihedron() );
528
  else
529
    Repaint();
530
}
526
}
531
527
532
/*!
528
/*!
(-)GUI_SRC_3.2.2/src/STD/STD_Application.cxx (-13 lines)
Lines 186-198 Link Here
186
                tr( "MEN_DESK_HELP_ABOUT" ), tr( "PRP_DESK_HELP_ABOUT" ),
186
                tr( "MEN_DESK_HELP_ABOUT" ), tr( "PRP_DESK_HELP_ABOUT" ),
187
                SHIFT+Key_A, desk, false, this, SLOT( onHelpAbout() ) );
187
                SHIFT+Key_A, desk, false, this, SLOT( onHelpAbout() ) );
188
188
189
  //SRN: BugID IPAL9021, add an action "Load"
190
  createAction( FileLoadId, tr( "TOT_DESK_FILE_LOAD" ),
191
                resMgr->loadPixmap( "STD", tr( "ICON_FILE_OPEN" ) ),
192
		tr( "MEN_DESK_FILE_LOAD" ), tr( "PRP_DESK_FILE_LOAD" ),
193
		CTRL+Key_L, desk, false, this, SLOT( onLoadDoc() ) );
194
  //SRN: BugID IPAL9021: End
195
196
  QtxDockAction* da = new QtxDockAction( tr( "TOT_DOCK_WINDOWS" ), tr( "MEN_DOCK_WINDOWS" ), desk );
189
  QtxDockAction* da = new QtxDockAction( tr( "TOT_DOCK_WINDOWS" ), tr( "MEN_DOCK_WINDOWS" ), desk );
197
  registerAction( ViewWindowsId, da );
190
  registerAction( ViewWindowsId, da );
198
  da->setAutoPlace( false );
191
  da->setAutoPlace( false );
Lines 208-214 Link Here
208
201
209
  createMenu( FileNewId,    fileMenu, 0 );
202
  createMenu( FileNewId,    fileMenu, 0 );
210
  createMenu( FileOpenId,   fileMenu, 0 );
203
  createMenu( FileOpenId,   fileMenu, 0 );
211
  createMenu( FileLoadId,   fileMenu, 0 );  //SRN: BugID IPAL9021, add a menu item "Load"
212
  createMenu( FileCloseId,  fileMenu, 0 );
204
  createMenu( FileCloseId,  fileMenu, 0 );
213
  createMenu( separator(),  fileMenu, -1, 0 );
205
  createMenu( separator(),  fileMenu, -1, 0 );
214
  createMenu( FileSaveId,   fileMenu, 0 );
206
  createMenu( FileSaveId,   fileMenu, 0 );
Lines 322-332 Link Here
322
  return res;
314
  return res;
323
}
315
}
324
316
325
/*! called on loading the existent study */
326
void STD_Application::onLoadDoc()
327
{
328
}
329
330
/*! \retval true, if document was loaded successful, else false.*/
317
/*! \retval true, if document was loaded successful, else false.*/
331
bool STD_Application::onLoadDoc( const QString& aName )
318
bool STD_Application::onLoadDoc( const QString& aName )
332
{
319
{
(-)GUI_SRC_3.2.2/src/STD/STD_Application.h (-2 / +1 lines)
Lines 101-107 Link Here
101
  virtual void          onOpenDoc();
101
  virtual void          onOpenDoc();
102
  virtual bool          onOpenDoc( const QString& );
102
  virtual bool          onOpenDoc( const QString& );
103
103
104
  virtual void          onLoadDoc();
105
  virtual bool          onLoadDoc( const QString& );
104
  virtual bool          onLoadDoc( const QString& );
106
105
107
  virtual void          onExit();
106
  virtual void          onExit();
Lines 126-132 Link Here
126
          MenuHelpId = 7
125
          MenuHelpId = 7
127
       };
126
       };
128
127
129
  enum {  FileNewId,   FileOpenId,   FileLoadId, FileCloseId,
128
  enum {  FileNewId,   FileOpenId,   FileCloseId,
130
	  FileSaveId,  FileSaveAsId, FileExitId, 
129
	  FileSaveId,  FileSaveAsId, FileExitId, 
131
	  ViewStatusBarId, ViewWindowsId, NewWindowId,
130
	  ViewStatusBarId, ViewWindowsId, NewWindowId,
132
          EditCutId, EditCopyId, EditPasteId,
131
          EditCutId, EditCopyId, EditPasteId,
(-)GUI_SRC_3.2.2/src/SUIT/SUIT_DataObjectKey.h (-1 / +1 lines)
Lines 29-35 Link Here
29
{
29
{
30
public:
30
public:
31
  SUIT_DataObjectKey();
31
  SUIT_DataObjectKey();
32
  ~SUIT_DataObjectKey();
32
  virtual ~SUIT_DataObjectKey();
33
33
34
  virtual bool isLess( const SUIT_DataObjectKey* ) const = 0;
34
  virtual bool isLess( const SUIT_DataObjectKey* ) const = 0;
35
  virtual bool isEqual( const SUIT_DataObjectKey* ) const = 0;
35
  virtual bool isEqual( const SUIT_DataObjectKey* ) const = 0;
(-)GUI_SRC_3.2.2/src/SUIT/SUIT_PopupClient.h (-1 / +1 lines)
Lines 36-42 Link Here
36
  class Signal;
36
  class Signal;
37
37
38
  SUIT_PopupClient();
38
  SUIT_PopupClient();
39
  ~SUIT_PopupClient();
39
  virtual ~SUIT_PopupClient();
40
40
41
  bool            connectPopupRequest( QObject* reciever, const char* slot );
41
  bool            connectPopupRequest( QObject* reciever, const char* slot );
42
  bool            disconnectPopupRequest( QObject* reciever, const char* slot );
42
  bool            disconnectPopupRequest( QObject* reciever, const char* slot );
(-)GUI_SRC_3.2.2/src/SUIT/SUIT_SelectionFilter.h (-1 / +1 lines)
Lines 28-34 Link Here
28
{
28
{
29
public:
29
public:
30
  SUIT_SelectionFilter();
30
  SUIT_SelectionFilter();
31
  ~SUIT_SelectionFilter();
31
  virtual ~SUIT_SelectionFilter();
32
32
33
  virtual bool isOk( const SUIT_DataOwner* ) const = 0;
33
  virtual bool isOk( const SUIT_DataOwner* ) const = 0;
34
};
34
};
(-)GUI_SRC_3.2.2/src/SUIT/SUIT_TreeSync.h (-2 / +2 lines)
Lines 106-112 Link Here
106
  if( td.isEqual( r1, r2 ) )
106
  if( td.isEqual( r1, r2 ) )
107
  {
107
  {
108
    // update items themselves
108
    // update items themselves
109
    td.updateItem( r2 );
109
    td.updateItem( r1, r2 );
110
110
111
    // iterate 'siblings' (direct children) 
111
    // iterate 'siblings' (direct children) 
112
    QValueList< DiffItem< SrcItem, TrgItem > > d;
112
    QValueList< DiffItem< SrcItem, TrgItem > > d;
Lines 135-141 Link Here
135
        else
135
        else
136
	{
136
	{
137
	  //to update
137
	  //to update
138
	  td.updateItem( item.myTrg );
138
	  td.updateItem( item.mySrc, item.myTrg );
139
	  synchronize( item.mySrc, item.myTrg, td );
139
	  synchronize( item.mySrc, item.myTrg, td );
140
	  lastItem = item.myTrg;
140
	  lastItem = item.myTrg;
141
	}
141
	}
(-)GUI_SRC_3.2.2/src/SUITApp/Makefile.in (+12 lines)
Lines 57-62 Link Here
57
LIBS+= -lsuit -lqtx
57
LIBS+= -lsuit -lqtx
58
LIBSFORBIN+= -lsuit -lqtx
58
LIBSFORBIN+= -lsuit -lqtx
59
59
60
PLUGINDIR = $(top_builddir)/bin/salome/styles
61
MYPLUGINDIR = styles
62
63
$(MYPLUGINDIR): $(PLUGINDIR)
64
	-$(RM) $@
65
	ln -sf $< $@
66
67
$(PLUGINDIR):
68
	mkdir -p $@
69
70
bin: $(MYPLUGINDIR)
71
60
@CONCLUDE@
72
@CONCLUDE@
61
73
62
74
(-)GUI_SRC_3.2.2/src/SalomeApp/SalomeApp_Application.cxx (-1 / +96 lines)
Lines 81-86 Link Here
81
#include <SALOMEDSClient_ClientFactory.hxx>
81
#include <SALOMEDSClient_ClientFactory.hxx>
82
82
83
#include <vector>
83
#include <vector>
84
/*!Internal class that updates object browser item properties */
85
class SalomeApp_Updater : public OB_Updater
86
{
87
public:
88
  SalomeApp_Updater() : OB_Updater(){};
89
  virtual ~SalomeApp_Updater(){};
90
  virtual void update( SUIT_DataObject* theObj, OB_ListItem* theItem );
91
};
92
93
void SalomeApp_Updater::update( SUIT_DataObject* theObj, OB_ListItem* theItem )
94
{
95
  if( !theObj || !theItem )
96
    return;
97
98
  SalomeApp_DataObject* SAObj = dynamic_cast<SalomeApp_DataObject*>( theObj );
99
  if( !SAObj )
100
    return;
101
  
102
  _PTR(SObject) SObj = SAObj->object();
103
  if( !SObj )
104
    return;
105
  _PTR( GenericAttribute ) anAttr;
106
107
  // Selectable
108
  if ( SObj->FindAttribute( anAttr, "AttributeSelectable" ) )
109
  {
110
    _PTR(AttributeSelectable) aAttrSel = anAttr;
111
    theItem->setSelectable( aAttrSel->IsSelectable() );
112
  }
113
  // Expandable
114
  if ( SObj->FindAttribute(anAttr, "AttributeExpandable") ) 
115
  {
116
    _PTR(AttributeExpandable) aAttrExpand = anAttr;
117
    theItem->setExpandable( aAttrExpand->IsExpandable() );
118
  }
119
  // Opened
120
  //this attribute is not supported in the version of SALOME 3.x
121
  //if ( SObj->FindAttribute(anAttr, "AttributeOpened") ) 
122
  //{
123
  //  _PTR(AttributeOpened) aAttrOpen = anAttr;
124
  //  theItem->setOpen( aAttrOpen->IsOpened() );
125
  //}
126
}
84
127
85
/*!Create new instance of SalomeApp_Application.*/
128
/*!Create new instance of SalomeApp_Application.*/
86
extern "C" SALOMEAPP_EXPORT SUIT_Application* createApplication()
129
extern "C" SALOMEAPP_EXPORT SUIT_Application* createApplication()
Lines 108-113 Link Here
108
  LightApp_Application::start();
151
  LightApp_Application::start();
109
152
110
  SalomeApp_EventFilter::Init();
153
  SalomeApp_EventFilter::Init();
154
155
  static bool isFirst = true;
156
  if ( isFirst ) {
157
    isFirst = false;
158
    QString hdffile;
159
    QStringList pyfiles;
160
    for (int i = 1; i < qApp->argc(); i++) {
161
      QRegExp rx("--test=(.+)");
162
      if ( rx.search( QString(qApp->argv()[i]) ) >= 0 && rx.capturedTexts().count() > 0 ) {
163
	QStringList files = QStringList::split(",",rx.capturedTexts()[1],false);
164
	for (uint j = 0; j < files.count(); j++ ) {
165
	  QFileInfo fi( files[j] );
166
	  QString extension = fi.extension( false ).lower();
167
	  if ( extension == "hdf" && fi.exists() )
168
	    hdffile = fi.absFilePath();
169
	  else if ( extension == "py" || extension == "" )
170
	    pyfiles.append( fi.baseName( true ) );
171
	}
172
      }
173
    }
174
    if ( !hdffile.isEmpty() )       // open hdf file given as parameter
175
      onOpenDoc( hdffile );
176
    else if ( pyfiles.count() > 0 ) // create new study
177
      onNewDoc();
178
    // import python scripts
179
    if ( pyfiles.count() > 0 && activeStudy() ) {
180
      SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( activeStudy() );
181
      if ( appStudy ) {
182
	_PTR(Study) aStudy = appStudy->studyDS();
183
	if ( !aStudy->GetProperties()->IsLocked() ) {
184
	  for ( uint i = 0; i < pyfiles.count(); i++ ) {
185
	    QString command = QString( "import %1" ).arg( pyfiles[i] );
186
	    PythonConsole* pyConsole = pythonConsole();
187
	    if ( pyConsole )
188
	      pyConsole->exec( command );
189
	  }
190
	}
191
      }
192
    }
193
  }
111
}
194
}
112
195
113
/*!Create actions:*/
196
/*!Create actions:*/
Lines 148-159 Link Here
148
		tr( "MEN_DESK_REGISTRY_DISPLAY" ), tr( "PRP_DESK_REGISTRY_DISPLAY" ),
231
		tr( "MEN_DESK_REGISTRY_DISPLAY" ), tr( "PRP_DESK_REGISTRY_DISPLAY" ),
149
		/*SHIFT+Key_D*/0, desk, false, this, SLOT( onRegDisplay() ) );
232
		/*SHIFT+Key_D*/0, desk, false, this, SLOT( onRegDisplay() ) );
150
233
234
  //SRN: BugID IPAL9021, add an action "Load"
235
  createAction( FileLoadId, tr( "TOT_DESK_FILE_LOAD" ),
236
                resourceMgr()->loadPixmap( "STD", tr( "ICON_FILE_OPEN" ) ),
237
		tr( "MEN_DESK_FILE_LOAD" ), tr( "PRP_DESK_FILE_LOAD" ),
238
		CTRL+Key_L, desk, false, this, SLOT( onLoadDoc() ) );
239
  //SRN: BugID IPAL9021: End
240
241
151
  int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1 );
242
  int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1 );
152
243
153
  // "Save GUI State" command is renamed to "Save VISU State" and 
244
  // "Save GUI State" command is renamed to "Save VISU State" and 
154
  // creation of menu item is moved to VISU
245
  // creation of menu item is moved to VISU
155
  //  createMenu( SaveGUIStateId, fileMenu, 10, -1 ); 
246
  //  createMenu( SaveGUIStateId, fileMenu, 10, -1 ); 
156
247
248
  createMenu( FileLoadId,   fileMenu, 0 );  //SRN: BugID IPAL9021, add a menu item "Load"
249
157
  createMenu( DumpStudyId, fileMenu, 10, -1 );
250
  createMenu( DumpStudyId, fileMenu, 10, -1 );
158
  createMenu( separator(), fileMenu, -1, 15, -1 );
251
  createMenu( separator(), fileMenu, -1, 15, -1 );
159
  createMenu( LoadScriptId, fileMenu, 10, -1 );
252
  createMenu( LoadScriptId, fileMenu, 10, -1 );
Lines 652-657 Link Here
652
  if ( flag == WT_ObjectBrowser )
745
  if ( flag == WT_ObjectBrowser )
653
  {
746
  {
654
    OB_Browser* ob = (OB_Browser*)wid;
747
    OB_Browser* ob = (OB_Browser*)wid;
748
    ob->setUpdater( new SalomeApp_Updater() );
655
    connect( ob->listView(), SIGNAL( doubleClicked( QListViewItem* ) ), this, SLOT( onDblClick( QListViewItem* ) ) );
749
    connect( ob->listView(), SIGNAL( doubleClicked( QListViewItem* ) ), this, SLOT( onDblClick( QListViewItem* ) ) );
656
    bool autoSize = resMgr->booleanValue( "ObjectBrowser", "auto_size", false ),
750
    bool autoSize = resMgr->booleanValue( "ObjectBrowser", "auto_size", false ),
657
         autoSizeFirst = resMgr->booleanValue( "ObjectBrowser", "auto_size_first", true );
751
         autoSizeFirst = resMgr->booleanValue( "ObjectBrowser", "auto_size_first", true );
Lines 857-863 Link Here
857
  CAM_Module* currentModule = activeModule();
951
  CAM_Module* currentModule = activeModule();
858
  if (currentModule && currentModule->moduleName() == aModuleTitle)
952
  if (currentModule && currentModule->moduleName() == aModuleTitle)
859
    return;
953
    return;
860
  thePopup->insertItem( tr( "MEN_OPENWITH" ), this, SLOT( onOpenWith() ) );
954
  if ( !aModuleTitle.isEmpty() )
955
    thePopup->insertItem( tr( "MEN_OPENWITH" ).arg( aModuleTitle ), this, SLOT( onOpenWith() ) );
861
}
956
}
862
957
863
/*!Update obect browser:
958
/*!Update obect browser:
(-)GUI_SRC_3.2.2/src/SalomeApp/SalomeApp_Application.h (-1 / +1 lines)
Lines 69-75 Link Here
69
public:
69
public:
70
  enum { MenuToolsId = 5 };
70
  enum { MenuToolsId = 5 };
71
  enum { DumpStudyId = LightApp_Application::UserID, LoadScriptId, PropertiesId,
71
  enum { DumpStudyId = LightApp_Application::UserID, LoadScriptId, PropertiesId,
72
         CatalogGenId, RegDisplayId, SaveGUIStateId, UserID };
72
         CatalogGenId, RegDisplayId, SaveGUIStateId, FileLoadId, UserID };
73
73
74
public:
74
public:
75
  SalomeApp_Application();
75
  SalomeApp_Application();
(-)GUI_SRC_3.2.2/src/SalomeApp/SalomeApp_DataModel.cxx (-4 / +11 lines)
Lines 64-70 Link Here
64
  void     children( const suitPtr&, QValueList<suitPtr>& ) const;
64
  void     children( const suitPtr&, QValueList<suitPtr>& ) const;
65
  suitPtr  parent( const suitPtr& ) const;
65
  suitPtr  parent( const suitPtr& ) const;
66
  bool     isCorrect( const kerPtr& ) const;
66
  bool     isCorrect( const kerPtr& ) const;
67
  void     updateItem( const suitPtr& ) const;
67
  void     updateItem( const kerPtr&, const suitPtr& ) const;
68
68
69
private:
69
private:
70
  _PTR( Study )     myStudy;
70
  _PTR( Study )     myStudy;
Lines 87-93 Link Here
87
{
87
{
88
  kerPtr refObj;
88
  kerPtr refObj;
89
  QString name = so->GetName().c_str();
89
  QString name = so->GetName().c_str();
90
  bool res = so && ( so->GetName().size() || so->ReferencedObject( refObj ) );
90
  _PTR( GenericAttribute ) anAttr;
91
  bool isDraw = true;
92
  if ( so->FindAttribute(anAttr, "AttributeDrawable") ) 
93
  {
94
    _PTR(AttributeDrawable) aAttrDraw = anAttr;
95
    isDraw = aAttrDraw->IsDrawable(); 
96
  }
97
  bool res = so && ( so->GetName().size() || so->ReferencedObject( refObj ) ) && isDraw;  
91
  return res;
98
  return res;
92
}
99
}
93
100
Lines 221-227 Link Here
221
  Updates SUIT object
228
  Updates SUIT object
222
  \param p - SUIT object
229
  \param p - SUIT object
223
*/
230
*/
224
void SalomeApp_DataModelSync::updateItem( const suitPtr& ) const
231
void SalomeApp_DataModelSync::updateItem( const kerPtr& obj, const suitPtr& ) const
225
{
232
{
226
}
233
}
227
234
Lines 333-339 Link Here
333
{
340
{
334
  if( !study || !study->root() || !sobj )
341
  if( !study || !study->root() || !sobj )
335
    return 0;
342
    return 0;
336
343
    
337
  DataObjectList ch; study->root()->children( ch );
344
  DataObjectList ch; study->root()->children( ch );
338
  DataObjectList::const_iterator anIt = ch.begin(), aLast = ch.end();
345
  DataObjectList::const_iterator anIt = ch.begin(), aLast = ch.end();
339
  SUIT_DataObject* suitObj = 0;
346
  SUIT_DataObject* suitObj = 0;
(-)GUI_SRC_3.2.2/src/SalomeApp/SalomeApp_DataObject.cxx (+11 lines)
Lines 186-191 Link Here
186
	else
186
	else
187
	  clr = QColor( 200, 200, 200 );
187
	  clr = QColor( 200, 200, 200 );
188
      }
188
      }
189
    else if ( myObject )
190
    {
191
      _PTR(GenericAttribute) anAttr;
192
      if( myObject->FindAttribute ( anAttr, "AttributeTextHighlightColor") )
193
      {
194
        _PTR(AttributeTextHighlightColor) aHighColAttr = anAttr;
195
	clr = QColor( (int)(aHighColAttr->TextHighlightColor().R), 
196
		      (int)(aHighColAttr->TextHighlightColor().G), 
197
		      (int)(aHighColAttr->TextHighlightColor().B));
198
      }
199
    }
189
    break;
200
    break;
190
  case HighlightedText:
201
  case HighlightedText:
191
    if ( isReference() )
202
    if ( isReference() )
(-)GUI_SRC_3.2.2/src/SalomeApp/SalomeApp_ExceptionHandler.cxx (-1 / +9 lines)
Lines 36-42 Link Here
36
SalomeApp_ExceptionHandler::SalomeApp_ExceptionHandler( const bool floatSignal )
36
SalomeApp_ExceptionHandler::SalomeApp_ExceptionHandler( const bool floatSignal )
37
: SUIT_ExceptionHandler()
37
: SUIT_ExceptionHandler()
38
{
38
{
39
  OSD::SetSignal( floatSignal );
39
  // JFA 2006-09-28: PAL10867: suppress signal catching,
40
  // if environment variable DISABLE_SIGNALS_CATCHING is set to 1.
41
  // Commonly this is used with "noexcepthandler" option.
42
  char* envNoCatchSignals = getenv("NOT_INTERCEPT_SIGNALS");
43
  if (!envNoCatchSignals || !atoi(envNoCatchSignals))
44
  {
45
    OSD::SetSignal( floatSignal );
46
  }
40
}
47
}
41
48
42
/*!Try to call SUIT_ExceptionHandler::internalHandle(o, e), catch if failure.*/
49
/*!Try to call SUIT_ExceptionHandler::internalHandle(o, e), catch if failure.*/
Lines 104-108 Link Here
104
#else
111
#else
105
  raiseFPE = false;
112
  raiseFPE = false;
106
#endif
113
#endif
114
107
  return new SalomeApp_ExceptionHandler( raiseFPE );
115
  return new SalomeApp_ExceptionHandler( raiseFPE );
108
}
116
}
(-)GUI_SRC_3.2.2/src/SalomeApp/resources/SalomeApp.xml (+4 lines)
Lines 44-49 Link Here
44
    <parameter name="CAM"          value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
44
    <parameter name="CAM"          value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
45
    <parameter name="SUPERVGraph"  value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
45
    <parameter name="SUPERVGraph"  value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
46
    <parameter name="ToolsGUI"     value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
46
    <parameter name="ToolsGUI"     value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
47
    <!-- NETGENPlugin and GHS3DPlugin -->
48
    <!-- Here the environment variables are used in upper case, -->
49
    <!-- In SMESH/resources/SalomeApp.xml case-sensitive notation is used. -->
50
    <!-- As a result, both variants are acceptable. -->
47
    <parameter name="NETGENPlugin" value="${NETGENPLUGIN_ROOT_DIR}/share/salome/resources/netgenplugin"/>
51
    <parameter name="NETGENPlugin" value="${NETGENPLUGIN_ROOT_DIR}/share/salome/resources/netgenplugin"/>
48
    <parameter name="GHS3DPlugin"  value="${GHS3DPLUGIN_ROOT_DIR}/share/salome/resources/ghs3dplugin"/>
52
    <parameter name="GHS3DPlugin"  value="${GHS3DPLUGIN_ROOT_DIR}/share/salome/resources/ghs3dplugin"/>
49
  </section>
53
  </section>
(-)GUI_SRC_3.2.2/src/SalomeApp/resources/SalomeApp_msg_en.po (-1 / +1 lines)
Lines 118-124 Link Here
118
msgstr "Object browser"
118
msgstr "Object browser"
119
119
120
msgid "SalomeApp_Application::MEN_OPENWITH"
120
msgid "SalomeApp_Application::MEN_OPENWITH"
121
msgstr "Activate Module"
121
msgstr "Activate %1 Module"
122
122
123
msgid "SalomeApp_Application::MEN_DELETE_INVALID_REFERENCE"
123
msgid "SalomeApp_Application::MEN_DELETE_INVALID_REFERENCE"
124
msgstr "Delete Invalid Reference"
124
msgstr "Delete Invalid Reference"
(-)GUI_SRC_3.2.2/src/Session/Makefile.in (+12 lines)
Lines 65-69 Link Here
65
65
66
LDFLAGSFORBIN= $(LDFLAGS) $(OMNIORB_LIBS) $(HDF5_LIBS) -lqtx -lSalomeContainer -lSalomeResourcesManager -lTOOLSDS -lSalomeHDFPersist -lSalomeDSImpl -lSalomeGenericObj -lRegistry -lSalomeNotification -lSALOMEBasics
66
LDFLAGSFORBIN= $(LDFLAGS) $(OMNIORB_LIBS) $(HDF5_LIBS) -lqtx -lSalomeContainer -lSalomeResourcesManager -lTOOLSDS -lSalomeHDFPersist -lSalomeDSImpl -lSalomeGenericObj -lRegistry -lSalomeNotification -lSALOMEBasics
67
67
68
PLUGINDIR = $(top_builddir)/bin/salome/styles
69
MYPLUGINDIR = styles
70
71
$(MYPLUGINDIR): $(PLUGINDIR)
72
	-$(RM) $@
73
	ln -sf $< $@
74
75
$(PLUGINDIR):
76
	mkdir -p $@
77
78
bin: $(MYPLUGINDIR)
79
68
@CONCLUDE@
80
@CONCLUDE@
69
81
(-)GUI_SRC_3.2.2/src/Style/Makefile.in (-6 / +13 lines)
Lines 50-65 Link Here
50
LDFLAGS+=$(QT_MT_LIBS)
50
LDFLAGS+=$(QT_MT_LIBS)
51
LIBS+=
51
LIBS+=
52
52
53
# create $(top_builddir)/src/Session/styles directory and copy libSalomeStyle.so there
53
# create $(top_builddir)/bin/salome/styles directory and 
54
LIB_PLUGINDIR = $(top_builddir)/src/Session/styles
54
# make link to the libSalomeStyle.so there
55
LIB_PLUGINLIB = $(patsubst %.la, $(LIB_PLUGINDIR)/%.so, $(filter %.la, $(LIB)))
55
PLUGINDIR = $(top_builddir)/bin/salome/styles
56
PLUGIN_LIB_LA = $(patsubst %.la, $(PLUGINDIR)/%.so, $(filter %.la, $(LIB)))
57
PLUGIN_LIB_SO = $(patsubst %.so, $(PLUGINDIR)/%.so, $(filter %.so, $(LIB)))
56
58
57
lib: $(LIB) $(LIB_PLUGINDIR) $(LIB_PLUGINLIB)
59
lib: $(LIB) $(PLUGINDIR) $(PLUGIN_LIB_LA) $(PLUGIN_LIB_SO)
58
60
59
$(LIB_PLUGINDIR):
61
$(PLUGINDIR):
60
	mkdir -p $@
62
	mkdir -p $@
61
63
62
$(LIB_PLUGINLIB): $(LIB_PLUGINDIR)/%.so: .libs/%.so
64
$(PLUGIN_LIB_LA): $(PLUGINDIR)/%.so: %.la
65
	-$(RM) $@
66
	ln -sf $(patsubst %.la, %.so, $(CURDIR)/.libs/$<) $@ || true
67
	ln -sf $(patsubst %.la, %.so, $(CURDIR)/.libs/$<).0 $@.0 || true
68
69
$(PLUGIN_LIB_SO): $(PLUGINDIR)/%.so: %.so
63
	-$(RM) $@
70
	-$(RM) $@
64
	ln -sf $(CURDIR)/$< $@ || true
71
	ln -sf $(CURDIR)/$< $@ || true
65
72
(-)GUI_SRC_3.2.2/src/Style/SalomeStyle.cxx (-13 / +23 lines)
Lines 483-504 Link Here
483
        int textW = flags & Style_Horizontal ? rt.height() : rt.width();
483
        int textW = flags & Style_Horizontal ? rt.height() : rt.width();
484
        int textH = flags & Style_Horizontal ? rt.width() : rt.height();
484
        int textH = flags & Style_Horizontal ? rt.width() : rt.height();
485
485
486
        QString title = titleText( wnd->caption(), textW, p->fontMetrics() );
486
	QFont old_font = p->font(), f = old_font;
487
487
	
488
		    if ( wnd )
488
        QString title = titleText( wnd->caption(), textW, textH, f );
489
	p->setFont( f );
490
	if ( wnd )
489
        {
491
        {
490
		      QColorGroup cgroup = wnd->isActiveWindow() ? wnd->palette().active() : wnd->palette().inactive();
492
	  QColorGroup cgroup = wnd->isActiveWindow() ? wnd->palette().active() : wnd->palette().inactive();
491
		      p->setPen( cgroup.highlightedText() );
493
	  p->setPen( cgroup.highlightedText() );
492
494
493
		      if ( flags & Style_Horizontal )
495
	  if ( flags & Style_Horizontal )
494
          {
496
          {
495
		        p->rotate( 270.0 );
497
	    p->rotate( 270.0 );
496
		        p->translate( -(rt.height()+rt.y()), (rt.width()-rt.x()) );
498
	    p->translate( -(rt.height()+rt.y()), (rt.width()-rt.x()) );
497
		        p->drawText( 0, 0, title );
499
	    p->drawText( 0, 0, title );
498
		      }
500
	  }
499
          else
501
          else
500
		        p->drawText( 2, 2, textW, textH, AlignLeft, title );
502
	    p->drawText( 2, 2, textW, textH, AlignLeft, title );
501
	      }
503
	}
504
	p->setFont( old_font );
502
      }
505
      }
503
      break;
506
      break;
504
    }
507
    }
Lines 1279-1288 Link Here
1279
  \param w - possible width
1282
  \param w - possible width
1280
  \param fm - font metrics
1283
  \param fm - font metrics
1281
*/
1284
*/
1282
QString SalomeStyle::titleText( const QString& txt, const int W, const QFontMetrics& fm ) const
1285
QString SalomeStyle::titleText( const QString& txt, const int W, const int H, QFont& f ) const
1283
{
1286
{
1284
  QString res = txt.stripWhiteSpace();
1287
  QString res = txt.stripWhiteSpace();
1285
1288
1289
  QFontMetrics fm( f );
1290
  while( fm.height() > H )
1291
  {
1292
    f.setPointSize( f.pointSize()-1 );
1293
    fm = QFontMetrics( f );
1294
  }
1295
1286
  if ( fm.width( res ) > W )
1296
  if ( fm.width( res ) > W )
1287
  {
1297
  {
1288
    QString end( "..." );
1298
    QString end( "..." );
(-)GUI_SRC_3.2.2/src/Style/SalomeStyle.h (-1 / +1 lines)
Lines 92-98 Link Here
92
  void               drawGradient( QPainter*, const QRect&, const QColor&,
92
  void               drawGradient( QPainter*, const QRect&, const QColor&,
93
				   const QColor&, const Direction, gradient_func ) const;
93
				   const QColor&, const Direction, gradient_func ) const;
94
94
95
  QString            titleText( const QString&, const int, const QFontMetrics& ) const;
95
  QString            titleText( const QString&, const int, const int, QFont& f ) const;
96
96
97
private:
97
private:
98
  QWidget*           myTitleParent;
98
  QWidget*           myTitleParent;

Return to bug 155974