#include <QtxFontEdit.h>
#include <QtxToolBar.h>
#include <QtxTreeView.h>
+#include <QtxInfoPanel.h>
#include <QtxMRUAction.h>
#include <QtxDockAction.h>
#include <QtxDockWidget.h>
saveDockWindowsState();
+ if ( infoPanel() )
+ infoPanel()->clear();
+
bool status = CAM_Application::activateModule( modName );
updateModuleActions();
QString url = resMgr->stringValue("GUI", "site_url");
if ( !url.isEmpty() ) {
QString title = tr ( "SALOME_SITE" );
- QAction* as = createAction( id, title,
+ QAction* as = createAction( WebSiteId, title,
resMgr->loadPixmap( "LightApp", tr( "ICON_WWW" ), false ),
title, title,
0, desk, false, this, SLOT( onHelpContentsModule() ) );
as->setData( url );
createMenu( as, helpMenu, -1, 0 );
- id++;
}
// b) Link to Forum
url = resMgr->stringValue("GUI", "forum_url");
if ( !url.isEmpty() ) {
QString title = tr ( "SALOME_FORUM" );
- QAction* af = createAction( helpMenu, title,
+ QAction* af = createAction( ForumId, title,
resMgr->loadPixmap( "LightApp", tr( "ICON_WWW" ), false ),
title, title,
0, desk, false, this, SLOT( onHelpContentsModule() ) );
af->setData( url );
createMenu( af, helpMenu, -1, 0 );
- id++;
}
// c) Link to YouTube channel
if ( !url.isEmpty() ) {
createMenu( separator(), helpMenu, -1, 0 );
QString title = tr ( "SALOME_VIDEO_TUTORIALS" );
- QAction* av = createAction( helpMenu, title,
+ QAction* av = createAction( VideosId, title,
resMgr->loadPixmap( "LightApp", tr( "ICON_LIFE_RIGN" ), false ),
- title, title,
+ title, tr( "PRP_SALOME_VIDEO_TUTORIALS" ),
0, desk, false, this, SLOT( onHelpContentsModule() ) );
av->setData( url );
createMenu( av, helpMenu, -1, 0 );
- id++;
}
- // d) Help for modules
+ // d) Link to Tutorials
+
+ url = resMgr->stringValue("GUI", "tutorials_url");
+ if ( !url.isEmpty() ) {
+ QString title = tr ( "SALOME_TUTORIALS" );
+ QAction* as = createAction( TutorialsId, title,
+ resMgr->loadPixmap( "LightApp", tr( "ICON_WWW" ), false ),
+ title, tr( "PRP_SALOME_TUTORIALS" ),
+ 0, desk, false, this, SLOT( onHelpContentsModule() ) );
+ as->setData( url );
+ createMenu( as, helpMenu, -1, 0 );
+ }
+
+ // e) Help for modules
// - First create top-level menus to preserve correct order
QString userGuide = "User's Guide";
myWin.insert( id, wid );
QtxDockWidget* dock = new QtxDockWidget( true, desktop() );
+ if ( id == WT_InfoPanel ) {
+ // Info panel's position is strongly limited to the right area;
+ // It is not movable and not floatable.
+ dock->setAllowedAreas( Qt::RightDockWidgetArea );
+ dock->setFeatures( QDockWidget::DockWidgetClosable );
+ connect( dock, SIGNAL( aboutToShow()), this, SLOT( onInfoPanelShown() ) );
+ }
+ else {
+ dock->setFeatures( QDockWidget::AllDockWidgetFeatures );
+ }
connect( dock, SIGNAL( destroyed( QObject* ) ), this, SLOT( onWCDestroyed( QObject* ) ) );
- dock->setFeatures( QDockWidget::AllDockWidgetFeatures );
dock->setObjectName( wid->objectName().isEmpty() ? QString( "window_%1" ).arg( id ) :
QString( "%1Dock" ).arg( wid->objectName() ) );
dock->setWidget( wid );
return qobject_cast<SUIT_DataBrowser*>( dockWindow( WT_ObjectBrowser ) );
}
+QtxInfoPanel* LightApp_Application::infoPanel()
+{
+ return qobject_cast<QtxInfoPanel *>( dockWindow( WT_InfoPanel ));
+}
+
/*!
\return Log Window
*/
}
getWindow( WT_ObjectBrowser );
+ getWindow( WT_InfoPanel );
loadDockWindowsState();
}
getWindow( WT_ObjectBrowser );
+ getWindow( WT_InfoPanel );
loadDockWindowsState();
wid = ob;
ob->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
}
+ else if ( flag == WT_InfoPanel)
+ {
+ QtxInfoPanel* ipanel = new QtxInfoPanel( desktop() );
+ ipanel->setObjectName( "infoPanel" );
+ ipanel->setWindowTitle( tr( "INFO_PANEL" ) );
+ wid = ipanel;
+ }
#ifndef DISABLE_PYCONSOLE
else if ( flag == WT_PyConsole )
{
#endif
if ( activeStudy() ) {
aMap.insert( WT_ObjectBrowser, Qt::LeftDockWidgetArea );
+ aMap.insert( WT_InfoPanel, Qt::RightDockWidgetArea );
// aMap.insert( WT_LogWindow, Qt::DockBottom );
}
}
}
loadDockWindowsState();
+
+ if ( !activeModule() && infoPanel() )
+ {
+ infoPanel()->clear();
+ infoPanel()->setTitle( tr( "INFO_WELCOME_TO_SALOME" ) );
+
+ int grp = infoPanel()->addGroup( tr( "INFO_GETTING_STARTED" ) );
+ infoPanel()->addAction( action( FileNewId ), grp );
+ infoPanel()->addLabel( action( FileNewId )->statusTip(), grp );
+ infoPanel()->addAction( action( FileOpenId ), grp );
+ infoPanel()->addLabel( action( FileOpenId )->statusTip(), grp );
+ infoPanel()->addAction( action( TutorialsId ), grp );
+ infoPanel()->addLabel( action( TutorialsId )->statusTip(), grp );
+ infoPanel()->addAction( action( VideosId ), grp );
+ infoPanel()->addLabel( action( VideosId )->statusTip(), grp );
+
+ LightApp_ModuleAction* ma = qobject_cast<LightApp_ModuleAction*>(action(ModulesListId));
+ if ( ma && ma->count() > 0 )
+ {
+ grp = infoPanel()->addGroup( tr( "INFO_AVAILABLE_MODULES" ) );
+ foreach ( QString mname, ma->modules() )
+ {
+ infoPanel()->addAction( ma->moduleAction( mname ), grp );
+ if ( !moduleDescription( mname ).isEmpty() )
+ infoPanel()->addLabel( moduleDescription( mname ), grp );
+ }
+ }
+ }
}
/*!
}
}
+void LightApp_Application::onInfoPanelShown()
+{
+ if ( activeModule() && activeModule()->inherits( "LightApp_Module" ) )
+ ((LightApp_Module*)activeModule())->updateInfoPanel();
+}
+
/*!
Internal method.
Returns all top level toolbars.