id++;
}
// help for other existing modules
- for ( QStringList::Iterator it = aModuleList.begin(); it != aModuleList.end(); ++it )
+ QStringList::Iterator it;
+ for ( it = aModuleList.begin(); it != aModuleList.end(); ++it )
{
if ( (*it).isEmpty() )
continue;
QStringList modList;
modules( modList, false );
- for ( QStringList::Iterator it = modList.begin(); it != modList.end(); ++it )
+ for ( it = modList.begin(); it != modList.end(); ++it )
{
if ( (*it).isEmpty() )
continue;
accelMap[NewOCCViewId] = ALT+Key_O;
accelMap[NewVTKViewId] = ALT+Key_K;
- for ( int id = NewGLViewId; id <= NewVTKViewId; id++ )
+ for ( id = NewGLViewId; id <= NewVTKViewId; id++ )
{
QAction* a = createAction( id, tr( QString( "NEW_WINDOW_%1" ).arg( id - NewGLViewId ) ), QIconSet(),
tr( QString( "NEW_WINDOW_%1" ).arg( id - NewGLViewId ) ),
const QAction* obj = (QAction*) sender();
QString aComponentName = obj->name();
- QString aFileName = aComponentName.lower() + ".htm";
+ QString aFileName = aComponentName + "_index.html";
QCString dir;
QString root;
QString homeDir;
if (dir = getenv( aComponentName + "_ROOT_DIR")) {
- root = Qtx::addSlash( Qtx::addSlash(dir) + Qtx::addSlash("doc") + Qtx::addSlash("salome") + Qtx::addSlash(aComponentName));
+ root = Qtx::addSlash( Qtx::addSlash(dir) + Qtx::addSlash("doc") + Qtx::addSlash("salome") );
if ( QFileInfo( root + aFileName ).exists() ) {
homeDir = root;
} else {
QMap<int, int> winMap;
currentWindows( winMap );
- myWindows.insert( flag, new LightApp_WidgetContainer( flag, desktop() ) );
+ LightApp_WidgetContainer* newWC = new LightApp_WidgetContainer( flag, desktop() );
+ connect( newWC, SIGNAL( destroyed ( QObject* ) ), this, SLOT( onWCDestroyed( QObject* ) ) );
+ myWindows.insert( flag, newWC );
if ( winMap.contains( flag ) )
desktop()->moveDockWindow( myWindows[flag], (Dock)winMap[flag] );
{
emit studyClosed();
- activateModule( "" );
+ // Bug 10396: clear selection
+ mySelMgr->clearSelected();
- // Bug 10396: remove all selectors
- delete mySelMgr;
- mySelMgr = new LightApp_SelectionMgr( this );
+ activateModule( "" );
saveWindowsGeometry();
}
int u = resMgr->integerValue( sec, "iso_number_u" );
int v = resMgr->integerValue( sec, "iso_number_v" );
for ( QPtrListIterator<SUIT_ViewManager> it( lst ); it.current(); ++it )
- ((OCCViewer_Viewer*)it.current())->setIsos( u, v );
+ {
+ OCCViewer_ViewManager* mgr = dynamic_cast<OCCViewer_ViewManager*>( it.current() );
+ if( mgr && mgr->getOCCViewer() )
+ mgr->getOCCViewer()->setIsos( u, v );
+ }
}
if( sec=="ObjectBrowser" )
{
return myAccel;
}
+
+/*! remove dead widget container from map */
+void LightApp_Application::onWCDestroyed( QObject* ob )
+{
+ // remove destroyed widget container from windows map
+ for ( WindowMap::ConstIterator itr = myWindows.begin(); itr != myWindows.end(); ++itr )
+ {
+ if ( itr.data() != ob )
+ continue;
+
+ int key = itr.key();
+ myWindows.remove( key );
+ break;
+ }
+}
+
+/*! redefined to remove view manager from memory */
+void LightApp_Application::removeViewManager( SUIT_ViewManager* vm )
+{
+ disconnect( vm, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ),
+ this, SLOT( onCloseView( SUIT_ViewManager* ) ) );
+ STD_Application::removeViewManager( vm );
+ delete vm;
+}