From 3adb7d265eec85d44dececb4c8e02719124c8237 Mon Sep 17 00:00:00 2001 From: asl Date: Thu, 14 Jul 2005 04:51:40 +0000 Subject: [PATCH] In "selectObject" methods was added parameter (default true): if it is true, the text in line edit will be updated, otherwise won't. --- src/SalomeApp/SalomeApp_Dialog.cxx | 23 +++++++++++------------ src/SalomeApp/SalomeApp_Dialog.h | 13 +++++-------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/src/SalomeApp/SalomeApp_Dialog.cxx b/src/SalomeApp/SalomeApp_Dialog.cxx index f4486e70b..a82ec8973 100644 --- a/src/SalomeApp/SalomeApp_Dialog.cxx +++ b/src/SalomeApp/SalomeApp_Dialog.cxx @@ -163,12 +163,12 @@ bool SalomeApp_Dialog::isObjectEnabled( const int id ) const // name : selectObject // Purpose : //======================================================================= -void SalomeApp_Dialog::selectObject( const QString& name, const int type, const QString& id ) +void SalomeApp_Dialog::selectObject( const QString& name, const int type, const QString& id, const bool update ) { QStringList names; names.append( name ); TypesList types; types.append( type ); QStringList ids; ids.append( id ); - selectObject( names, types, ids ); + selectObject( names, types, ids, update ); } //======================================================================= @@ -177,13 +177,14 @@ void SalomeApp_Dialog::selectObject( const QString& name, const int type, const //======================================================================= void SalomeApp_Dialog::selectObject( const QStringList& _names, const TypesList& _types, - const QStringList& _ids ) + const QStringList& _ids, + const bool update ) { ObjectMap::iterator anIt = myObjects.begin(), aLast = myObjects.end(); for( ; anIt!=aLast; anIt++ ) if( anIt.data().myBtn->isOn() ) - selectObject( anIt.key(), _names, _types, _ids ); + selectObject( anIt.key(), _names, _types, _ids, update ); } //======================================================================= @@ -215,8 +216,7 @@ void SalomeApp_Dialog::clearSelection( const int id ) myObjects[ id ].myTypes.clear(); myObjects[ id ].myNames.clear(); - if( !myIsBusy ) - myObjects[ id ].myEdit->setText( QString::null ); + myObjects[ id ].myEdit->setText( QString::null ); emit selectionChanged( id ); } } @@ -494,8 +494,7 @@ void SalomeApp_Dialog::updateObject( const int id, bool emit_signal ) { Object& obj = myObjects[ id ]; filterTypes( id, obj.myNames, obj.myTypes, obj.myIds ); - if( !myIsBusy ) - obj.myEdit->setText( selectionDescription( obj.myNames, obj.myTypes, obj.myNI ) ); + obj.myEdit->setText( selectionDescription( obj.myNames, obj.myTypes, obj.myNI ) ); if( emit_signal ) emit selectionChanged( id ); } @@ -715,12 +714,12 @@ void SalomeApp_Dialog::deactivateAll() // name : selectObject // Purpose : //======================================================================= -void SalomeApp_Dialog::selectObject( const int id, const QString& name, const int type, const QString& selid ) +void SalomeApp_Dialog::selectObject( const int id, const QString& name, const int type, const QString& selid, const bool update ) { QStringList names; names.append( name ); TypesList types; types.append( type ); QStringList ids; ids.append( selid ); - selectObject( id, names, types, ids ); + selectObject( id, names, types, ids, update ); } //======================================================================= @@ -728,7 +727,7 @@ void SalomeApp_Dialog::selectObject( const int id, const QString& name, const in // Purpose : //======================================================================= void SalomeApp_Dialog::selectObject( const int id, const QStringList& _names, const TypesList& _types, - const QStringList& _ids ) + const QStringList& _ids, const bool update ) { if( !myObjects.contains( id ) ) return; @@ -739,7 +738,7 @@ void SalomeApp_Dialog::selectObject( const int id, const QStringList& _names, co filterTypes( id, names, types, ids ); Object& obj = myObjects[ id ]; - if( !myIsBusy ) + if( update ) obj.myEdit->setText( selectionDescription( names, types, obj.myNI ) ); obj.myTypes = types; obj.myIds = ids; diff --git a/src/SalomeApp/SalomeApp_Dialog.h b/src/SalomeApp/SalomeApp_Dialog.h index 8d99fc9c8..98fbd631e 100644 --- a/src/SalomeApp/SalomeApp_Dialog.h +++ b/src/SalomeApp/SalomeApp_Dialog.h @@ -76,17 +76,17 @@ public: bool isObjectEnabled( const int ) const; //! Pass to all active widgets name, type and id of selected object - void selectObject( const QString&, const int, const QString& ); + void selectObject( const QString&, const int, const QString&, const bool = true ); /*! Pass to all active widgets list of names, types and ids of selected objects Every active widget filters list and accept only objects with possible types */ - void selectObject( const QStringList&, const TypesList&, const QStringList& ); + void selectObject( const QStringList&, const TypesList&, const QStringList&, const bool = true ); //! Select in certain widget avoiding check if there is active widget - void selectObject( const int, const QString&, const int, const QString& ); - void selectObject( const int, const QStringList&, const TypesList&, const QStringList& ); + void selectObject( const int, const QString&, const int, const QString&, const bool = true ); + void selectObject( const int, const QStringList&, const TypesList&, const QStringList&, const bool = true ); //! Check if certain widget has selection bool hasSelection( const int ) const; @@ -231,14 +231,11 @@ private: } Object; typedef QMap ObjectMap; - -protected: - bool myIsBusy; private: ObjectMap myObjects; QMap myTypeNames; - bool myIsExclusive; + bool myIsExclusive, myIsBusy; QPixmap myPixmap; }; -- 2.39.2