Changed: #1206 Update core plugin.

This commit is contained in:
dnk-88 2011-01-16 11:58:23 +02:00
parent f95b9cbbf6
commit 23e178812d
5 changed files with 21 additions and 29 deletions

View file

@ -47,7 +47,7 @@ bool CorePlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QStr
//_mainWindow = new CMainWindow(_plugMan); //_mainWindow = new CMainWindow(_plugMan);
//_mainWindow->show(); //_mainWindow->show();
//_plugMan->addObject(new CSearchPathsSettingsPage(_mainWindow)); _plugMan->addObject(new CSearchPathsSettingsPage(wnd));
return true; return true;
} }

View file

@ -64,7 +64,7 @@ CSettingsDialog::CSettingsDialog(ExtensionSystem::IPluginManager *pluginManager,
QList<QObject *> all = _plugMan->allObjects(); QList<QObject *> all = _plugMan->allObjects();
Q_FOREACH(QObject *obj, all) Q_FOREACH(QObject *obj, all)
{ {
IOptionsPage *page = qobject_cast<IOptionsPage *>(obj); IOptionsPage *page = dynamic_cast<IOptionsPage *>(obj);
if (page) if (page)
pages.append(page); pages.append(page);
} }

View file

@ -4,22 +4,30 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR}
${QT_INCLUDES}) ${QT_INCLUDES})
FILE(GLOB SRC *.cpp *.h) FILE(GLOB SRC *.cpp *.h)
SET(OVQT_EXT_SYS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin.h SET(OVQT_EXT_SYS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin.h
${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_manager.h ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_manager.h
${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_spec.h) ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_spec.h)
SET(OVQT_PLUG_EXAMPLE_HDR plugin1.h) SET(OVQT_PLUG_EXAMPLE_HDR plugin1.h
example_settings_page.h
${CMAKE_CURRENT_SOURCE_DIR}/../core/ioptions_page.h)
SET(OVQT_PLUG_EXAMPLE_UIS example_settings_page.ui)
SET(QT_USE_QTGUI TRUE) SET(QT_USE_QTGUI TRUE)
SET(QT_USE_QTOPENGL TRUE) SET(QT_USE_QTOPENGL TRUE)
QT4_WRAP_CPP(OVQT_PLUG_EXAMPLE_MOC_SRC ${OVQT_PLUG_EXAMPLE_HDR}) QT4_WRAP_CPP(OVQT_PLUG_EXAMPLE_MOC_SRC ${OVQT_PLUG_EXAMPLE_HDR})
QT4_WRAP_UI(OVQT_PLUG_EXAMPLE_UI_HDRS ${OVQT_PLUG_EXAMPLE_UIS})
SOURCE_GROUP(QtResources FILES ${OVQT_PLUG_EXAMPLE_UIS})
SOURCE_GROUP(QtGeneratedUiHdr FILES ${OVQT_PLUG_EXAMPLE_UI_HDRS})
SOURCE_GROUP(QtGeneratedMocSrc FILES ${OVQT_PLUG_EXAMPLE_MOC_SRC}) SOURCE_GROUP(QtGeneratedMocSrc FILES ${OVQT_PLUG_EXAMPLE_MOC_SRC})
SOURCE_GROUP("Example Plugin" FILES ${SRC}) SOURCE_GROUP("Example Plugin" FILES ${SRC})
SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC})
ADD_LIBRARY(ovqt_plugin_example MODULE ${SRC} ${OVQT_PLUG_EXAMPLE_MOC_SRC} ${OVQT_EXT_SYS_SRC}) ADD_LIBRARY(ovqt_plugin_example MODULE ${SRC} ${OVQT_PLUG_EXAMPLE_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUG_EXAMPLE_UI_HDRS})
TARGET_LINK_LIBRARIES(ovqt_plugin_example nelmisc ${QT_LIBRARIES}) TARGET_LINK_LIBRARIES(ovqt_plugin_example nelmisc ${QT_LIBRARIES})

View file

@ -1,11 +0,0 @@
TEMPLATE = lib
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
CONFIG += plugin
# Input
HEADERS += plugin1.h \
../../extension_system/iplugin.h \
../../extension_system/iplugin_manager.h \
../../extension_system/plugin_spec.h
SOURCES += plugin1.cpp

View file

@ -7,8 +7,9 @@
#include <QtGui/QAction> #include <QtGui/QAction>
#include <QtGui/QMenuBar> #include <QtGui/QMenuBar>
#include "../../extension_system/iplugin_spec.h"
#include "../../extension_system/iplugin_spec.h"
#include "example_settings_page.h"
#include "nel/misc/debug.h" #include "nel/misc/debug.h"
using namespace Plugin; using namespace Plugin;
@ -17,15 +18,9 @@ bool MyPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QStrin
{ {
Q_UNUSED(errorString); Q_UNUSED(errorString);
_plugMan = pluginManager; _plugMan = pluginManager;
QString str;
QList<ExtensionSystem::IPluginSpec *> listPlug = pluginManager->plugins();
Q_FOREACH (ExtensionSystem::IPluginSpec *plugSpec, listPlug)
str += plugSpec->name();
nlinfo(str.toStdString().c_str());
QMainWindow *wnd = qobject_cast<QMainWindow *>(objectByName("CMainWindow")); QMainWindow *wnd = qobject_cast<QMainWindow *>(objectByName("CMainWindow"));
_plugMan->addObject(new CExampleSettingsPage(wnd));
if (!wnd) if (!wnd)
{ {
*errorString = tr("Not found QMainWindow Object Viewer Qt."); *errorString = tr("Not found QMainWindow Object Viewer Qt.");