Call emitOperationFinished(...) method of the application when a command is commited.

This commit is contained in:
mzn 2013-11-19 11:39:35 +00:00
parent 710a59a7bf
commit bf4c72d227

View File

@ -838,22 +838,22 @@ bool GEOMBase_Helper::onAccept( const bool publish, const bool useTransaction, b
if ( publish ) { if ( publish ) {
QString aName = getObjectName(obj); QString aName = getObjectName(obj);
if (aName.isEmpty()) { if (aName.isEmpty()) {
aName = getNewObjectName(currObj); aName = getNewObjectName(currObj);
if ( nbObjs > 1 ) { if ( nbObjs > 1 ) {
if (aName.isEmpty()) if (aName.isEmpty())
aName = getPrefix(obj); aName = getPrefix(obj);
if (nbObjs <= 30) { if (nbObjs <= 30) {
// Try to find a unique name // Try to find a unique name
aName = GEOMBase::GetDefaultName(aName, extractPrefix()); aName = GEOMBase::GetDefaultName(aName, extractPrefix());
} else { } else {
// Don't check name uniqueness in case of numerous objects // Don't check name uniqueness in case of numerous objects
aName = aName + "_" + QString::number(aNumber++); aName = aName + "_" + QString::number(aNumber++);
} }
} else { } else {
// PAL6521: use a prefix, if some dialog box doesn't reimplement getNewObjectName() // PAL6521: use a prefix, if some dialog box doesn't reimplement getNewObjectName()
if ( aName.isEmpty() ) if ( aName.isEmpty() )
aName = GEOMBase::GetDefaultName( getPrefix( obj ) ); aName = GEOMBase::GetDefaultName( getPrefix( obj ) );
} }
} }
anEntryList << addInStudy( obj, aName.toLatin1().constData() ); anEntryList << addInStudy( obj, aName.toLatin1().constData() );
// updateView=false // updateView=false
@ -881,8 +881,13 @@ bool GEOMBase_Helper::onAccept( const bool publish, const bool useTransaction, b
updateObjBrowser(); updateObjBrowser();
if( SUIT_Application* anApp = SUIT_Session::session()->activeApplication() ) { if( SUIT_Application* anApp = SUIT_Session::session()->activeApplication() ) {
LightApp_Application* aLightApp = dynamic_cast<LightApp_Application*>( anApp ); LightApp_Application* aLightApp = dynamic_cast<LightApp_Application*>( anApp );
if(aLightApp && !isDisableBrowsing() ) if(aLightApp) {
aLightApp->browseObjects( anEntryList, isApplyAndClose(), isOptimizedBrowsing() ); QString anOpName( typeid(*this).name() );
aLightApp->emitOperationFinished( "Geometry", anOpName, anEntryList );
if ( !isDisableBrowsing() )
aLightApp->browseObjects( anEntryList, isApplyAndClose(), isOptimizedBrowsing() );
}
anApp->putInfo( QObject::tr("GEOM_PRP_DONE") ); anApp->putInfo( QObject::tr("GEOM_PRP_DONE") );
} }
result = true; result = true;