@ -18,6 +18,7 @@
// Project includes
// Project includes
# include "context_manager.h"
# include "context_manager.h"
# include "icontext.h"
# include "icontext.h"
# include "main_window.h"
// NeL includes
// NeL includes
# include <nel/misc/debug.h>
# include <nel/misc/debug.h>
@ -31,26 +32,26 @@ namespace Core
struct ContextManagerPrivate
struct ContextManagerPrivate
{
{
explicit ContextManagerPrivate ( ExtensionSystem: : IPluginManager * pluginManager , QTabWidget * tabWidget ) ;
explicit ContextManagerPrivate ( Core: : MainWindow * mainWindow , QTabWidget * tabWidget ) ;
ExtensionSystem: : IPluginManager * m_pluginManager ;
Core: : MainWindow * m_mainWindow ;
QTabWidget * m_tabWidget ;
QTabWidget * m_tabWidget ;
QVector < IContext * > m_contexts ;
QVector < IContext * > m_contexts ;
int m_oldCurrent ;
int m_oldCurrent ;
} ;
} ;
ContextManagerPrivate : : ContextManagerPrivate ( ExtensionSystem: : IPluginManager * pluginManager , QTabWidget * tabWidget )
ContextManagerPrivate : : ContextManagerPrivate ( Core: : MainWindow * mainWindow , QTabWidget * tabWidget )
: m_ pluginManager( pluginManager ) ,
: m_ mainWindow( mainWindow ) ,
m_tabWidget ( tabWidget ) ,
m_tabWidget ( tabWidget ) ,
m_oldCurrent ( - 1 )
m_oldCurrent ( - 1 )
{
{
}
}
ContextManager : : ContextManager ( ExtensionSystem: : IPluginManager * pluginManager , QTabWidget * tabWidget )
ContextManager : : ContextManager ( Core: : MainWindow * mainWindow , QTabWidget * tabWidget )
: d ( new ContextManagerPrivate ( pluginManager , tabWidget ) )
: d ( new ContextManagerPrivate ( mainWindow , tabWidget ) )
{
{
QObject : : connect ( d - > m_ pluginManager, SIGNAL ( objectAdded ( QObject * ) ) ,
QObject : : connect ( d - > m_ mainWindow- > pluginManager( ) , SIGNAL ( objectAdded ( QObject * ) ) ,
this , SLOT ( objectAdded ( QObject * ) ) ) ;
this , SLOT ( objectAdded ( QObject * ) ) ) ;
QObject : : connect ( d - > m_ pluginManager, SIGNAL ( aboutToRemoveObject ( QObject * ) ) ,
QObject : : connect ( d - > m_ mainWindow- > pluginManager( ) , SIGNAL ( aboutToRemoveObject ( QObject * ) ) ,
this , SLOT ( aboutToRemoveObject ( QObject * ) ) ) ;
this , SLOT ( aboutToRemoveObject ( QObject * ) ) ) ;
QObject : : connect ( d - > m_tabWidget , SIGNAL ( currentChanged ( int ) ) , this , SLOT ( currentTabChanged ( int ) ) ) ;
QObject : : connect ( d - > m_tabWidget , SIGNAL ( currentChanged ( int ) ) , this , SLOT ( currentTabChanged ( int ) ) ) ;
@ -61,7 +62,7 @@ ContextManager::~ContextManager()
delete d ;
delete d ;
}
}
Core : : IContext * ContextManager : : currentContext ( ) const
Core : : IContext * ContextManager : : currentContext ( ) const
{
{
int currentIndex = d - > m_tabWidget - > currentIndex ( ) ;
int currentIndex = d - > m_tabWidget - > currentIndex ( ) ;
if ( currentIndex < 0 )
if ( currentIndex < 0 )
@ -69,7 +70,7 @@ Core::IContext* ContextManager::currentContext() const
return d - > m_contexts . at ( currentIndex ) ;
return d - > m_contexts . at ( currentIndex ) ;
}
}
Core : : IContext * ContextManager : : context ( const QString & id ) const
Core : : IContext * ContextManager : : context ( const QString & id ) const
{
{
const int index = indexOf ( id ) ;
const int index = indexOf ( id ) ;
if ( index > = 0 )
if ( index > = 0 )