From b97a78ce0b905fae06c2289dfdb4a0ecf7035ad9 Mon Sep 17 00:00:00 2001 From: dnk-88 Date: Sun, 16 Jan 2011 11:58:23 +0200 Subject: [PATCH] Changed: #1206 Update core plugin. --- .../src/plugins/core/core_plugin.cpp | 2 +- .../src/plugins/core/settings_dialog.cpp | 2 +- .../src/plugins/example/CMakeLists.txt | 24 ++++++++++++------- .../src/plugins/example/example.pro | 11 --------- .../src/plugins/example/plugin1.cpp | 11 +++------ 5 files changed, 21 insertions(+), 29 deletions(-) delete mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/example/example.pro diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp index a2bc697cd..164badf83 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp @@ -47,7 +47,7 @@ bool CorePlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QStr //_mainWindow = new CMainWindow(_plugMan); //_mainWindow->show(); - //_plugMan->addObject(new CSearchPathsSettingsPage(_mainWindow)); + _plugMan->addObject(new CSearchPathsSettingsPage(wnd)); return true; } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.cpp index acb8ca856..558b492c6 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.cpp @@ -64,7 +64,7 @@ CSettingsDialog::CSettingsDialog(ExtensionSystem::IPluginManager *pluginManager, QList all = _plugMan->allObjects(); Q_FOREACH(QObject *obj, all) { - IOptionsPage *page = qobject_cast(obj); + IOptionsPage *page = dynamic_cast(obj); if (page) pages.append(page); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/CMakeLists.txt index e34c80e89..50c5317a3 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/CMakeLists.txt @@ -1,25 +1,33 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} - ${LIBXML2_INCLUDE_DIR} - ${QT_INCLUDES}) + ${CMAKE_CURRENT_SOURCE_DIR} + ${LIBXML2_INCLUDE_DIR} + ${QT_INCLUDES}) FILE(GLOB SRC *.cpp *.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_spec.h) -SET(OVQT_PLUG_EXAMPLE_HDR plugin1.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_spec.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_QTOPENGL TRUE) 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("Example Plugin" FILES ${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}) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example.pro b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example.pro deleted file mode 100644 index 858ed363f..000000000 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example.pro +++ /dev/null @@ -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 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp index cf4400770..18896b19d 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp @@ -7,8 +7,9 @@ #include #include -#include "../../extension_system/iplugin_spec.h" +#include "../../extension_system/iplugin_spec.h" +#include "example_settings_page.h" #include "nel/misc/debug.h" using namespace Plugin; @@ -17,15 +18,9 @@ bool MyPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QStrin { Q_UNUSED(errorString); _plugMan = pluginManager; - QString str; - - QList listPlug = pluginManager->plugins(); - - Q_FOREACH (ExtensionSystem::IPluginSpec *plugSpec, listPlug) - str += plugSpec->name(); - nlinfo(str.toStdString().c_str()); QMainWindow *wnd = qobject_cast(objectByName("CMainWindow")); + _plugMan->addObject(new CExampleSettingsPage(wnd)); if (!wnd) { *errorString = tr("Not found QMainWindow Object Viewer Qt.");