#ifndef DISABLE_QTXWEBBROWSER
QProcess::startDetached( "HelpBrowser",
QStringList() << QString( "--remove=%1" ).arg( QApplication::instance()->applicationPid() ) );
-#endif
+#endif
CAM_Application::closeApplication();
}
updateViewManagers();
if ( activeStudy() && activeStudy()->root() && objectBrowser() ) {
- if ( objectBrowser()->root() != activeStudy()->root() )
+ if ( objectBrowser()->root() != activeStudy()->root() )
objectBrowser()->setRoot( activeStudy()->root() );
updateObjectBrowser( true );
}
// Help menu
int helpMenu = createMenu( tr( "MEN_DESK_HELP" ), -1, -1, 1000 );
-
+
int id = LightApp_Application::UserID + FIRST_HELP_ID;
// a) Link to web site
IMapConstIterator<QString, QString > fileIt;
for ( fileIt = helpData.begin(); fileIt != helpData.end(); fileIt++ ) {
QString helpItemPath = fileIt.key();
- // remove all '//' occurances
+ // remove all '//' occurances
while ( helpItemPath.contains( "//" ) )
helpItemPath.replace( "//", "" );
// obtain submenus hierarchy if given
if ( total.count() == 1 && smenus.count() > 0 )
helpItemPath = smenus.takeLast();
}
- QPixmap helpIcon = fileIt.value().startsWith( "http", Qt::CaseInsensitive ) ?
+ QPixmap helpIcon = fileIt.value().startsWith( "http", Qt::CaseInsensitive ) ?
resMgr->loadPixmap( "STD", tr( "ICON_WWW" ), false ) : resMgr->loadPixmap( "STD", tr( "ICON_HELP" ), false );
QAction* a = createAction( id, helpItemPath, helpIcon, helpItemPath, helpItemPath,
0, desk, false, this, SLOT( onHelpContentsModule() ) );
QString valueStr = resMgr->stringValue( "add_help", paramName );
if ( !valueStr.isEmpty() ) {
QStringList valueItems = valueStr.split( ";;", QString::SkipEmptyParts );
- foreach( QString item, valueItems ) {
+ foreach( QString item, valueItems ) {
if ( item.startsWith( "http", Qt::CaseInsensitive ) || QFile::exists( item ) ) {
- QPixmap helpIcon = item.startsWith( "http", Qt::CaseInsensitive ) ?
+ QPixmap helpIcon = item.startsWith( "http", Qt::CaseInsensitive ) ?
resMgr->loadPixmap( "STD", tr( "ICON_WWW" ), false ) : resMgr->loadPixmap( "STD", tr( "ICON_HELP" ), false );
QAction* a = createAction( id++, paramName, helpIcon, paramName, paramName,
0, desk, false, this, SLOT( onHelpContentsModule() ) );
//asl: fix for 0020515
saveDockWindowsState();
-
+
CAM_Application::onNewDoc();
}
// We should take mru action first because this application instance can be deleted later.
QtxMRUAction* mru = ::qobject_cast<QtxMRUAction*>( action( MRUId ) );
-
+
bool res = CAM_Application::onOpenDoc( aName );
if ( mru )
#if DISABLE_QTXWEBBROWSER
bool useExternalBrowser = true;
-#else
+#else
bool useExternalBrowser = resMgr->booleanValue("ExternalBrowser", "use_external_browser", false );
#endif
QString browser = resMgr->stringValue( "ExternalBrowser", "application" );
#endif
QString parameters = resMgr->stringValue("ExternalBrowser", "parameters");
-
+
if ( !browser.isEmpty() )
{
RunBrowser::execute( this, browser, parameters, path );
when you request the python console, this function could return
null. Then the optional parameter force (default to false) can be
set to force the creation of the python console if it is not done
- already.
+ already.
\param force - if true, the pythonConsole is created if it does not exist yet
\return Python Console
*/
pref->addPreference( tr( "PREF_SHOW_SPLASH" ), lookGroup, LightApp_Preferences::Bool, "launch", "splash" );
// .... -> opaque resize
pref->addPreference( tr( "PREF_OPAQUE_RESIZE" ), lookGroup, LightApp_Preferences::Bool, "desktop", "opaque_resize" );
- // .... -> drop-down buttons
+ // .... -> drop-down buttons
pref->addPreference( tr( "PREF_DROP_DOWN_BUTTONS" ), lookGroup, LightApp_Preferences::Bool, "viewers", "drop_down_buttons" );
// .... -> Notification timeout
int delay = pref->addPreference( tr( "PREF_NOTIFY_TIMEOUT" ), lookGroup, LightApp_Preferences::IntSpin, "notification", "timeout" );
}
}
+/*!
+ Update presentations of all displayed objects of theComponent in specified viewers
+*/
+void LightApp_Application::updatePresentations( const QString& theComponent,
+ const QStringList& theViewManagerTypes )
+{
+ LightApp_Displayer* aDisplayer = LightApp_Displayer::FindDisplayer(theComponent, false);
+ if ( aDisplayer ) {
+ LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>(activeStudy());
+ DataObjectList aComps;
+ bool isFound = false;
+ aStudy->root()->children( aComps );
+ DataObjectList::const_iterator aCompsIt = aComps.begin();
+ for ( ; aCompsIt != aComps.end() && !isFound; aCompsIt++ ) {
+ LightApp_DataObject* aComp = dynamic_cast<LightApp_DataObject*>( *aCompsIt );
+ if ( aComp && aComp->componentDataType() == theComponent) {
+ isFound = true;
+ DataObjectList anObjs;
+ aComp->children(anObjs, true);
+
+ QList<SUIT_ViewManager*> aViewMgrs;
+ QStringList::const_iterator itVMTypes = theViewManagerTypes.begin();
+ for ( ; itVMTypes != theViewManagerTypes.end(); ++itVMTypes )
+ viewManagers( *itVMTypes, aViewMgrs );
+
+ DataObjectList::const_iterator itObjs = anObjs.begin();
+ for ( ; itObjs != anObjs.end(); itObjs++ ) {
+ LightApp_DataObject* anObj = dynamic_cast<LightApp_DataObject*>( *itObjs );
+ QString anEntry = anObj->entry();
+
+ QListIterator<SUIT_ViewManager*> itViewMgrs( aViewMgrs );
+ while ( itViewMgrs.hasNext()) {
+ SUIT_ViewModel* aVM = itViewMgrs.next()->getViewModel();
+ if ( aVM ) {
+ SALOME_View* aView = dynamic_cast<SALOME_View*>(aVM);
+ if ( aView ) {
+ if ( aDisplayer->IsDisplayed( anEntry, aView ) ) {
+ aDisplayer->Erase( anEntry, false, false, aView );
+ aDisplayer->Display( anEntry, false, aView );
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
/*!
* Called when window activated
*/