From 5f8789e98fa739951851d654f42fa5d1702bf2ff Mon Sep 17 00:00:00 2001 From: dnk-88 Date: Mon, 26 Sep 2011 02:32:14 +0300 Subject: [PATCH] Changed: #1193 Updated other plugins with latest API changes to OVQT plugin system. Added the plugin-spec files for each plugin. --- .../src/extension_system/plugin_spec.cpp | 2 +- .../src/plugins/disp_sheet_id/CMakeLists.txt | 2 +- .../disp_sheet_id/disp_sheet_id_plugin.cpp | 35 +---- .../disp_sheet_id/disp_sheet_id_plugin.h | 16 +-- .../ovqt_plugin_disp_sheet_id.xml | 10 ++ .../plugins/disp_sheet_id/sheet_id_view.cpp | 4 +- .../src/plugins/example/CMakeLists.txt | 8 +- .../src/plugins/example/example_plugin.cpp | 83 ++++++++++++ .../example/{plugin1.h => example_plugin.h} | 37 ++---- .../plugins/example/example_settings_page.cpp | 28 ++-- .../plugins/example/example_settings_page.h | 14 +- .../plugins/example/example_settings_page.ui | 4 +- .../plugins/example/ovqt_plugin_example.xml | 10 ++ .../src/plugins/example/plugin1.cpp | 120 ------------------ .../src/plugins/example/qnel_widget.h | 2 +- .../src/plugins/example/simple_viewer.cpp | 8 +- .../src/plugins/example/simple_viewer.h | 12 +- .../georges_editor/georges_editor_form.cpp | 4 +- .../georges_editor/georges_editor_plugin.cpp | 29 ----- .../georges_editor/georges_editor_plugin.h | 7 - .../ovqt_plugin_georges_editor.xml | 10 ++ .../src/plugins/log/ovqt_plugin_log.xml | 10 ++ .../mission_compiler_main_window.cpp | 2 +- .../mission_compiler_plugin.cpp | 75 ++--------- .../mission_compiler_plugin.h | 16 +-- .../ovqt_plugin_mission_compiler.xml | 10 ++ .../ovqt_plugin_sheet_builder.xml | 10 ++ .../ovqt_sheet_builder/ovqt_sheet_builder.cpp | 35 +---- .../ovqt_sheet_builder/ovqt_sheet_builder.h | 16 +-- .../plugins/ovqt_sheet_builder/sheetbuilder.h | 8 +- .../ovqt_sheet_builder/sheetbuilderdialog.cpp | 2 +- .../zone_painter/ovqt_plugin_zone_painter.xml | 10 ++ .../zone_painter/zone_painter_main_window.cpp | 3 +- .../zone_painter/zone_painter_plugin.cpp | 78 ++---------- .../zone_painter/zone_painter_plugin.h | 22 +--- 35 files changed, 256 insertions(+), 486 deletions(-) create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/ovqt_plugin_disp_sheet_id.xml create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_plugin.cpp rename code/nel/tools/3d/object_viewer_qt/src/plugins/example/{plugin1.h => example_plugin.h} (59%) create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/example/ovqt_plugin_example.xml delete mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/ovqt_plugin_georges_editor.xml create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/log/ovqt_plugin_log.xml create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/ovqt_plugin_mission_compiler.xml create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_plugin_sheet_builder.xml create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/ovqt_plugin_zone_painter.xml diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp index 030f9507b..5c4e04ecb 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp @@ -223,7 +223,7 @@ void PluginSpec::parseDependency(QXmlStreamReader &reader) .arg(PLUGIN_SPEC_DEPENDENCY_NAME)); return; } - // Read version dependency plugin + // TODO: Read version dependency plugin QString dependencyVersion = reader.attributes().value(PLUGIN_SPEC_DEPENDENCY_VERSION).toString(); m_dependencies.push_back(dependencyName); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/CMakeLists.txt index 34c65c178..6152b8fdd 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/CMakeLists.txt @@ -28,7 +28,7 @@ SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) ADD_LIBRARY(ovqt_plugin_disp_sheet_id MODULE ${SRC} ${OVQT_DISP_SHEET_ID_PLUGIN_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_DISP_SHEET_ID_PLUGIN_UI_HDRS}) -TARGET_LINK_LIBRARIES(ovqt_plugin_disp_sheet_id ovqt_plugin_core nelmisc nel3d ${QT_LIBRARIES}) +TARGET_LINK_LIBRARIES(ovqt_plugin_disp_sheet_id ovqt_plugin_core nelmisc ${QT_LIBRARIES}) IF(WITH_STLPORT) TARGET_LINK_LIBRARIES(ovqt_plugin_disp_sheet_id ${CMAKE_THREAD_LIBS_INIT}) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/disp_sheet_id_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/disp_sheet_id_plugin.cpp index 54cba53a6..9e37b803b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/disp_sheet_id_plugin.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/disp_sheet_id_plugin.cpp @@ -18,7 +18,7 @@ #include "disp_sheet_id_plugin.h" #include "sheet_id_view.h" #include "../core/icore.h" -#include "../core/imenu_manager.h" +#include "../core/menu_manager.h" #include "../core/core_constants.h" // Qt includes @@ -37,13 +37,13 @@ using namespace SheetIdViewPlugin; bool DispSheetIdPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) { Q_UNUSED(errorString); - _plugMan = pluginManager; + m_plugMan = pluginManager; return true; } void DispSheetIdPlugin::extensionsInitialized() { - Core::IMenuManager *menuManager = Core::ICore::instance()->menuManager(); + Core::MenuManager *menuManager = Core::ICore::instance()->menuManager(); QMenu *sheetMenu = menuManager->menu(Core::Constants::M_SHEET); QAction *sheetIdViewAction = sheetMenu->addAction(tr("Sheet id view")); @@ -67,34 +67,7 @@ void DispSheetIdPlugin::setNelContext(NLMISC::INelContext *nelContext) // This only applies to platforms without PIC, e.g. Windows. nlassert(!NLMISC::INelContext::isContextInitialised()); #endif // NL_OS_WINDOWS - _LibContext = new NLMISC::CLibraryContext(*nelContext); -} - -QString DispSheetIdPlugin::name() const -{ - return "Display sheet id"; -} - -QString DispSheetIdPlugin::version() const -{ - return "1.0"; -} - -QString DispSheetIdPlugin::vendor() const -{ - return "pemeon"; -} - -QString DispSheetIdPlugin::description() const -{ - return "Display sheet id"; -} - -QStringList DispSheetIdPlugin::dependencies() const -{ - QStringList list; - list.append(Core::Constants::OVQT_CORE_PLUGIN); - return list; + m_LibContext = new NLMISC::CLibraryContext(*nelContext); } Q_EXPORT_PLUGIN(DispSheetIdPlugin) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/disp_sheet_id_plugin.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/disp_sheet_id_plugin.h index 75a25b724..8eaf3ead9 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/disp_sheet_id_plugin.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/disp_sheet_id_plugin.h @@ -28,11 +28,6 @@ namespace NLMISC class CLibraryContext; } -namespace NLQT -{ -class IPluginSpec; -} - namespace SheetIdViewPlugin { @@ -44,23 +39,16 @@ public: bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString); void extensionsInitialized(); - void setNelContext(NLMISC::INelContext *nelContext); - QString name() const; - QString version() const; - QString vendor() const; - QString description() const; - QStringList dependencies() const; - private Q_SLOTS: void execMessageBox(); protected: - NLMISC::CLibraryContext *_LibContext; + NLMISC::CLibraryContext *m_LibContext; private: - ExtensionSystem::IPluginManager *_plugMan; + ExtensionSystem::IPluginManager *m_plugMan; }; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/ovqt_plugin_disp_sheet_id.xml b/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/ovqt_plugin_disp_sheet_id.xml new file mode 100644 index 000000000..012029810 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/ovqt_plugin_disp_sheet_id.xml @@ -0,0 +1,10 @@ + + ovqt_plugin_disp_sheet_id + DisplaySheetId + 1.0 + pemeon + Display sheet id. + + + + \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/sheet_id_view.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/sheet_id_view.cpp index 64fb05701..f05060a9c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/sheet_id_view.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/sheet_id_view.cpp @@ -65,8 +65,8 @@ void SheetIdView::pushToTable() m_ui.table->setColumnCount(2); for (size_t i = 0; i < m_sheetList.size(); i++) { - QTableWidgetItem* item1 = new QTableWidgetItem(QString(m_sheetList[i].toString().c_str())); - QTableWidgetItem* item2 = new QTableWidgetItem(QString("%1").arg(m_sheetList[i].asInt())); + QTableWidgetItem *item1 = new QTableWidgetItem(QString(m_sheetList[i].toString().c_str())); + QTableWidgetItem *item2 = new QTableWidgetItem(QString("%1").arg(m_sheetList[i].asInt())); m_ui.table->setItem(i,1,item1); m_ui.table->setItem(i,2,item2); } 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 41d22804c..fbe617c43 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 @@ -9,10 +9,10 @@ SET(OVQT_EXT_SYS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin. ${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 - qnel_widget.h - simple_viewer.h - example_settings_page.h) +SET(OVQT_PLUG_EXAMPLE_HDR example_plugin.h + qnel_widget.h + simple_viewer.h + example_settings_page.h) SET(OVQT_PLUG_EXAMPLE_UIS example_settings_page.ui) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_plugin.cpp new file mode 100644 index 000000000..5e442a5ee --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_plugin.cpp @@ -0,0 +1,83 @@ +// Project includes +#include "example_plugin.h" +#include "example_settings_page.h" +#include "simple_viewer.h" + +#include "../core/icore.h" +#include "../core/core_constants.h" +#include "../core/menu_manager.h" + +#include "../../extension_system/iplugin_spec.h" + +// NeL includes +#include "nel/misc/debug.h" + +// Qt includes +#include +#include +#include +#include +#include +#include + +namespace Plugin +{ + +ExamplePlugin::ExamplePlugin() +{ +} + +ExamplePlugin::~ExamplePlugin() +{ + Q_FOREACH(QObject *obj, m_autoReleaseObjects) + { + m_plugMan->removeObject(obj); + } + qDeleteAll(m_autoReleaseObjects); + m_autoReleaseObjects.clear(); +} + +bool ExamplePlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) +{ + Q_UNUSED(errorString); + m_plugMan = pluginManager; + + addAutoReleasedObject(new ExampleSettingsPage(this)); + addAutoReleasedObject(new ExampleContext(this)); + addAutoReleasedObject(new ExampleCoreListener(this)); + return true; +} + +void ExamplePlugin::extensionsInitialized() +{ + Core::ICore *core = Core::ICore::instance(); + Core::MenuManager *menuManager = core->menuManager(); + QAction *exampleAction1 = new QAction("Example1", this); + QAction *exampleAction2 = new QAction("Example2", this); + QAction *aboutQtAction = menuManager->action(Core::Constants::ABOUT_QT); + QMenu *helpMenu = menuManager->menu(Core::Constants::M_HELP); + helpMenu->insertAction(aboutQtAction, exampleAction1); + helpMenu->addSeparator(); + helpMenu->addAction(exampleAction2); + menuManager->menuBar()->addMenu("ExampleMenu"); +} + +void ExamplePlugin::setNelContext(NLMISC::INelContext *nelContext) +{ +#ifdef NL_OS_WINDOWS + // Ensure that a context doesn't exist yet. + // This only applies to platforms without PIC, e.g. Windows. + nlassert(!NLMISC::INelContext::isContextInitialised()); +#endif // NL_OS_WINDOWS + m_LibContext = new NLMISC::CLibraryContext(*nelContext); +} + +void ExamplePlugin::addAutoReleasedObject(QObject *obj) +{ + m_plugMan->addObject(obj); + m_autoReleaseObjects.prepend(obj); +} + +} + +Q_EXPORT_PLUGIN(Plugin::ExamplePlugin) \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_plugin.h similarity index 59% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_plugin.h index 5077ff59e..bfb400651 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_plugin.h @@ -18,56 +18,41 @@ namespace NLMISC class CLibraryContext; } -namespace ExtensionSystem -{ -class IPluginSpec; -} - namespace Plugin { -class MyPlugin : public QObject, public ExtensionSystem::IPlugin +class ExamplePlugin : public QObject, public ExtensionSystem::IPlugin { Q_OBJECT Q_INTERFACES(ExtensionSystem::IPlugin) public: - - virtual ~MyPlugin(); + ExamplePlugin(); + virtual ~ExamplePlugin(); bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString); void extensionsInitialized(); - void setNelContext(NLMISC::INelContext *nelContext); - QString name() const; - QString version() const; - QString vendor() const; - QString description() const; - QStringList dependencies() const; - void addAutoReleasedObject(QObject *obj); - QObject *objectByName(const QString &name) const; - ExtensionSystem::IPluginSpec *pluginByName(const QString &name) const; - protected: - NLMISC::CLibraryContext *_LibContext; + NLMISC::CLibraryContext *m_LibContext; private: - ExtensionSystem::IPluginManager *_plugMan; - QList _autoReleaseObjects; + ExtensionSystem::IPluginManager *m_plugMan; + QList m_autoReleaseObjects; }; -class CExampleContext: public Core::IContext +class ExampleContext: public Core::IContext { Q_OBJECT public: - CExampleContext(QObject *parent = 0): IContext(parent) + ExampleContext(QObject *parent = 0): IContext(parent) { - m_simpleViewer = new CSimpleViewer(); + m_simpleViewer = new SimpleViewer(); } - virtual ~CExampleContext() {} + virtual ~ExampleContext() {} virtual QString id() const { @@ -95,7 +80,7 @@ public: { } - CSimpleViewer *m_simpleViewer; + SimpleViewer *m_simpleViewer; }; } // namespace Plugin diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.cpp index 50e7c9db5..6cea967db 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.cpp @@ -27,45 +27,45 @@ namespace Plugin { -CExampleSettingsPage::CExampleSettingsPage(QObject *parent) +ExampleSettingsPage::ExampleSettingsPage(QObject *parent) : IOptionsPage(parent), - _currentPage(NULL) + m_currentPage(0) { } -QString CExampleSettingsPage::id() const +QString ExampleSettingsPage::id() const { return QLatin1String("ExamplePage"); } -QString CExampleSettingsPage::trName() const +QString ExampleSettingsPage::trName() const { return tr("Example page"); } -QString CExampleSettingsPage::category() const +QString ExampleSettingsPage::category() const { - return QLatin1String("General"); + return QLatin1String("Example"); } -QString CExampleSettingsPage::trCategory() const +QString ExampleSettingsPage::trCategory() const { - return tr("General"); + return tr("Example"); } -QIcon CExampleSettingsPage::categoryIcon() const +QIcon ExampleSettingsPage::categoryIcon() const { return QIcon(); } -QWidget *CExampleSettingsPage::createPage(QWidget *parent) +QWidget *ExampleSettingsPage::createPage(QWidget *parent) { - _currentPage = new QWidget(parent); - _ui.setupUi(_currentPage); - return _currentPage; + m_currentPage = new QWidget(parent); + m_ui.setupUi(m_currentPage); + return m_currentPage; } -void CExampleSettingsPage::apply() +void ExampleSettingsPage::apply() { } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.h index 3475f843f..8a1a7cef1 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.h @@ -29,15 +29,13 @@ class QWidget; namespace Plugin { -/** -@class CExampleSettingsPage -*/ -class CExampleSettingsPage : public Core::IOptionsPage + +class ExampleSettingsPage : public Core::IOptionsPage { Q_OBJECT public: - CExampleSettingsPage(QObject *parent = 0); - virtual ~CExampleSettingsPage() {} + ExampleSettingsPage(QObject *parent = 0); + virtual ~ExampleSettingsPage() {} virtual QString id() const; virtual QString trName() const; @@ -50,8 +48,8 @@ public: virtual void finish() {} private: - QWidget *_currentPage; - Ui::CExampleSettingsPage _ui; + QWidget *m_currentPage; + Ui::ExampleSettingsPage m_ui; }; } // namespace Plugin diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.ui index b839d98ce..0d98ad6ab 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.ui @@ -1,7 +1,7 @@ - CExampleSettingsPage - + ExampleSettingsPage + 0 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/ovqt_plugin_example.xml b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/ovqt_plugin_example.xml new file mode 100644 index 000000000..43656a87b --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/ovqt_plugin_example.xml @@ -0,0 +1,10 @@ + + ovqt_plugin_example + ExamplePlugin + 0.2 + dnk-88 + Example ovqt plugin. + + + + \ No newline at end of file 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 deleted file mode 100644 index f218c3230..000000000 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp +++ /dev/null @@ -1,120 +0,0 @@ -// Project includes -#include "plugin1.h" -#include "example_settings_page.h" -#include "simple_viewer.h" -#include "../core/icore.h" -#include "../core/core_constants.h" -#include "../core/imenu_manager.h" -#include "../../extension_system/iplugin_spec.h" - -// NeL includes -#include "nel/misc/debug.h" - -// Qt includes -#include -#include -#include -#include -#include -#include - -namespace Plugin -{ -MyPlugin::~MyPlugin() -{ - Q_FOREACH(QObject *obj, _autoReleaseObjects) - { - _plugMan->removeObject(obj); - } - qDeleteAll(_autoReleaseObjects); - _autoReleaseObjects.clear(); -} - -bool MyPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) -{ - Q_UNUSED(errorString); - _plugMan = pluginManager; - - addAutoReleasedObject(new CExampleSettingsPage(this)); - addAutoReleasedObject(new CExampleContext(this)); - addAutoReleasedObject(new CCoreListener(this)); - return true; -} - -void MyPlugin::extensionsInitialized() -{ - Core::ICore *core = Core::ICore::instance(); - Core::IMenuManager *menuManager = core->menuManager(); - //menuManager = _plugMan->getObject(); - QAction *exampleAction1 = new QAction("Example1", this); - QAction *exampleAction2 = new QAction("Example2", this); - QAction *aboutQtAction = menuManager->action(Core::Constants::ABOUT_QT); - QMenu *helpMenu = menuManager->menu(Core::Constants::M_HELP); - helpMenu->insertAction(aboutQtAction, exampleAction1); - helpMenu->addSeparator(); - helpMenu->addAction(exampleAction2); - menuManager->menuBar()->addMenu("ExampleMenu"); -} - -void MyPlugin::setNelContext(NLMISC::INelContext *nelContext) -{ -#ifdef NL_OS_WINDOWS - // Ensure that a context doesn't exist yet. - // This only applies to platforms without PIC, e.g. Windows. - nlassert(!NLMISC::INelContext::isContextInitialised()); -#endif // NL_OS_WINDOWS - _LibContext = new NLMISC::CLibraryContext(*nelContext); -} - -QString MyPlugin::name() const -{ - return "ExamplePlugin"; -} - -QString MyPlugin::version() const -{ - return "0.2"; -} - -QString MyPlugin::vendor() const -{ - return "dnk-88"; -} - -QString MyPlugin::description() const -{ - return "Example ovqt plugin."; -} - -QStringList MyPlugin::dependencies() const -{ - QStringList list; - list.append(Core::Constants::OVQT_CORE_PLUGIN); - return list; -} - -void MyPlugin::addAutoReleasedObject(QObject *obj) -{ - _plugMan->addObject(obj); - _autoReleaseObjects.prepend(obj); -} - -QObject* MyPlugin::objectByName(const QString &name) const -{ - Q_FOREACH (QObject *qobj, _plugMan->allObjects()) - if (qobj->objectName() == name) - return qobj; - return 0; -} - -ExtensionSystem::IPluginSpec *MyPlugin::pluginByName(const QString &name) const -{ - Q_FOREACH (ExtensionSystem::IPluginSpec *spec, _plugMan->plugins()) - if (spec->name() == name) - return spec; - return 0; -} - -} - -Q_EXPORT_PLUGIN(Plugin::MyPlugin) \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.h index a54e6bb8a..59bb9ecda 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.h @@ -82,7 +82,7 @@ public: return m_driver; } - virtual QPaintEngine* paintEngine() const + virtual QPaintEngine *paintEngine() const { return NULL; } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.cpp index 1f6df9117..601909047 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.cpp @@ -29,19 +29,19 @@ namespace Plugin { -CSimpleViewer::CSimpleViewer(QWidget *parent) +SimpleViewer::SimpleViewer(QWidget *parent) : QWidget(parent) { QGridLayout *gridLayout = new QGridLayout(this); gridLayout->setObjectName(QString::fromUtf8("gridLayoutSimpleViewer")); gridLayout->setContentsMargins(0, 0, 0, 0); - NLQT::QNLWidget *_nelWidget = new NLQT::QNLWidget(this); - gridLayout->addWidget(_nelWidget, 0, 0, 1, 1); + NLQT::QNLWidget *m_nelWidget = new NLQT::QNLWidget(this); + gridLayout->addWidget(m_nelWidget, 0, 0, 1, 1); m_undoStack = new QUndoStack(this); } -bool CCoreListener::closeMainWindow() const +bool ExampleCoreListener::closeMainWindow() const { int ret = QMessageBox::question(0, tr("Example close event hook"), tr("Do you want to close window?"), diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.h index 14b782c22..793b0745e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.h @@ -31,22 +31,22 @@ class QWidget; namespace Plugin { -class CSimpleViewer : public QWidget +class SimpleViewer : public QWidget { Q_OBJECT public: - CSimpleViewer(QWidget *parent = 0); - virtual ~CSimpleViewer() {} + SimpleViewer(QWidget *parent = 0); + virtual ~SimpleViewer() {} QUndoStack *m_undoStack; }; -class CCoreListener : public Core::ICoreListener +class ExampleCoreListener : public Core::ICoreListener { Q_OBJECT public: - CCoreListener(QObject *parent = 0): ICoreListener(parent) {} - virtual ~CCoreListener() {} + ExampleCoreListener(QObject *parent = 0): ICoreListener(parent) {} + virtual ~ExampleCoreListener() {} virtual bool closeMainWindow() const; }; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.cpp index f67be6471..252d7fd7e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.cpp @@ -21,7 +21,7 @@ #include "georges_treeview_dialog.h" #include "../core/icore.h" -#include "../core/imenu_manager.h" +#include "../core/menu_manager.h" #include "../core/core_constants.h" // NeL includes @@ -63,7 +63,7 @@ namespace Plugin m_undoStack = new QUndoStack(this); - Core::IMenuManager *menuManager = Core::ICore::instance()->menuManager(); + Core::MenuManager *menuManager = Core::ICore::instance()->menuManager(); m_openAction = menuManager->action(Core::Constants::OPEN); m_newAction = new QAction(tr("&New..."), this); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.cpp index 425db7841..199bc20ca 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.cpp @@ -67,35 +67,6 @@ void GeorgesEditorPlugin::setNelContext(NLMISC::INelContext *nelContext) m_libContext = new NLMISC::CLibraryContext(*nelContext); } -QString GeorgesEditorPlugin::name() const -{ - return tr("Georges Editor"); -} - -QString GeorgesEditorPlugin::version() const -{ - return "0.4"; -} - -QString GeorgesEditorPlugin::vendor() const -{ - return "aquiles"; -} - -QString GeorgesEditorPlugin::description() const -{ - return tr("Tool to create & edit sheets or forms."); -} - -QStringList GeorgesEditorPlugin::dependencies() const -{ - QStringList list; - // TODO - //list.append(Core::Constants::OVQT_CORE_PLUGIN); - //list.append("ObjectViewer"); - return list; -} - void GeorgesEditorPlugin::addAutoReleasedObject(QObject *obj) { m_plugMan->addObject(obj); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.h index 7cc93dfb4..fabdd600c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.h @@ -52,15 +52,8 @@ public: bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString); void extensionsInitialized(); void shutdown(); - void setNelContext(NLMISC::INelContext *nelContext); - QString name() const; - QString version() const; - QString vendor() const; - QString description() const; - QStringList dependencies() const; - void addAutoReleasedObject(QObject *obj); protected: diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/ovqt_plugin_georges_editor.xml b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/ovqt_plugin_georges_editor.xml new file mode 100644 index 000000000..2b9b163da --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/ovqt_plugin_georges_editor.xml @@ -0,0 +1,10 @@ + + ovqt_plugin_georges_editor + GeorgesEditor + 0.4 + aquiles + Tool to create and edit sheets or forms. + + + + \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/ovqt_plugin_log.xml b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/ovqt_plugin_log.xml new file mode 100644 index 000000000..f1fbd7ad0 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/ovqt_plugin_log.xml @@ -0,0 +1,10 @@ + + ovqt_plugin_log + LogPlugin + 1.1 + aquiles + DockWidget to display all log messages from NeL. + + + + \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp index bb4e783a7..f72c5fcea 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp @@ -16,7 +16,7 @@ #include #include "../core/icore.h" -#include "../core/imenu_manager.h" +#include "../core/menu_manager.h" #include "../core/core_constants.h" #include diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.cpp index 3b9eb3ead..9e92cb90c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.cpp @@ -2,7 +2,7 @@ #include "mission_compiler_plugin.h" #include "../core/icore.h" #include "../core/core_constants.h" -#include "../core/imenu_manager.h" +#include "../core/menu_manager.h" #include "../../extension_system/iplugin_spec.h" // NeL includes @@ -24,18 +24,18 @@ namespace MissionCompiler MissionCompilerPlugin::~MissionCompilerPlugin() { - Q_FOREACH(QObject *obj, _autoReleaseObjects) + Q_FOREACH(QObject *obj, m_autoReleaseObjects) { - _plugMan->removeObject(obj); + m_plugMan->removeObject(obj); } - qDeleteAll(_autoReleaseObjects); - _autoReleaseObjects.clear(); + qDeleteAll(m_autoReleaseObjects); + m_autoReleaseObjects.clear(); } bool MissionCompilerPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) { Q_UNUSED(errorString); - _plugMan = pluginManager; + m_plugMan = pluginManager; addAutoReleasedObject(new MissionCompilerSettingsPage(this)); addAutoReleasedObject(new CMissionCompilerContext(this)); @@ -47,18 +47,7 @@ void MissionCompilerPlugin::extensionsInitialized() { Core::ICore *core = Core::ICore::instance(); QSettings *settings = Core::ICore::instance()->settings(); - Core::IMenuManager *menuManager = core->menuManager(); - //menuManager = _plugMan->getObject(); - //QAction *exampleAction1 = new QAction("Zone1", this); - //QAction *exampleAction2 = new QAction("Zone2", this); - //QMenu *toolsMenu = menuManager->menu(Core::Constants::M_TOOLS); - //helpMenu->insertAction(aboutQtAction, exampleAction1); - //helpMenu->addSeparator(); - //helpMenu->addAction(exampleAction2); - //QMenu *zoneMenu = menuManager->menuBar()->addMenu("ZoneMenu"); - //zoneMenu->insertAction(aboutQtAction, exampleAction1); - //zoneMenu->addSeparator(); - //zoneMenu->addAction(exampleAction2); + Core::MenuManager *menuManager = core->menuManager(); // Initialize Ligo. //settings->beginGroup(Core::Constants::DATA_PATH_SECTION); @@ -73,57 +62,13 @@ void MissionCompilerPlugin::setNelContext(NLMISC::INelContext *nelContext) // This only applies to platforms without PIC, e.g. Windows. nlassert(!NLMISC::INelContext::isContextInitialised()); #endif // NL_OS_WINDOWS - _LibContext = new NLMISC::CLibraryContext(*nelContext); -} - -QString MissionCompilerPlugin::name() const -{ - return "MissionCompilerPlugin"; -} - -QString MissionCompilerPlugin::version() const -{ - return "0.1"; -} - -QString MissionCompilerPlugin::vendor() const -{ - return "Ryzom Core"; -} - -QString MissionCompilerPlugin::description() const -{ - return "Mission Compiler Plugin"; -} - -QStringList MissionCompilerPlugin::dependencies() const -{ - QStringList list; - list.append(Core::Constants::OVQT_CORE_PLUGIN); - //list.append("ObjectViewer"); - return list; + m_LibContext = new NLMISC::CLibraryContext(*nelContext); } void MissionCompilerPlugin::addAutoReleasedObject(QObject *obj) { - _plugMan->addObject(obj); - _autoReleaseObjects.prepend(obj); -} - -QObject* MissionCompilerPlugin::objectByName(const QString &name) const -{ - Q_FOREACH (QObject *qobj, _plugMan->allObjects()) - if (qobj->objectName() == name) - return qobj; - return 0; -} - -ExtensionSystem::IPluginSpec *MissionCompilerPlugin::pluginByName(const QString &name) const -{ - Q_FOREACH (ExtensionSystem::IPluginSpec *spec, _plugMan->plugins()) - if (spec->name() == name) - return spec; - return 0; + m_plugMan->addObject(obj); + m_autoReleaseObjects.prepend(obj); } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.h index 7f64465e7..2ad92b40f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.h @@ -37,26 +37,16 @@ public: bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString); void extensionsInitialized(); - void setNelContext(NLMISC::INelContext *nelContext); - QString name() const; - QString version() const; - QString vendor() const; - QString description() const; - QStringList dependencies() const; - void addAutoReleasedObject(QObject *obj); - QObject *objectByName(const QString &name) const; - ExtensionSystem::IPluginSpec *pluginByName(const QString &name) const; - protected: - NLMISC::CLibraryContext *_LibContext; + NLMISC::CLibraryContext *m_LibContext; private: - ExtensionSystem::IPluginManager *_plugMan; - QList _autoReleaseObjects; + ExtensionSystem::IPluginManager *m_plugMan; + QList m_autoReleaseObjects; }; class CMissionCompilerContext: public Core::IContext diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/ovqt_plugin_mission_compiler.xml b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/ovqt_plugin_mission_compiler.xml new file mode 100644 index 000000000..f6ef5b5c6 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/ovqt_plugin_mission_compiler.xml @@ -0,0 +1,10 @@ + + ovqt_plugin_mission_compiler + MissionCompiler + 0.1 + Ryzom Core + Mission Compiler Plugin + + + + \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_plugin_sheet_builder.xml b/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_plugin_sheet_builder.xml new file mode 100644 index 000000000..14965e86e --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_plugin_sheet_builder.xml @@ -0,0 +1,10 @@ + + ovqt_plugin_sheet_builder + SheetBuilder + 1.0 + kharvd + make_sheet_id equivalent + + + + \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.cpp index 18e77fbcc..4fd7dfb11 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.cpp @@ -19,7 +19,7 @@ #include "sheetbuilderdialog.h" #include "sheetbuilderconfgdialog.h" #include "../core/icore.h" -#include "../core/imenu_manager.h" +#include "../core/menu_manager.h" #include "../core/core_constants.h" // NeL includes @@ -38,14 +38,14 @@ using namespace Plugin; bool SheetBuilderPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) { Q_UNUSED(errorString); - _plugMan = pluginManager; + m_plugMan = pluginManager; return true; } void SheetBuilderPlugin::extensionsInitialized() { - Core::IMenuManager *menuManager = Core::ICore::instance()->menuManager(); + Core::MenuManager *menuManager = Core::ICore::instance()->menuManager(); QMenu *sheetMenu = menuManager->menu(Core::Constants::M_SHEET); QAction *sheetBuilderAction = sheetMenu->addAction(tr("Sheet builder")); @@ -69,34 +69,7 @@ void SheetBuilderPlugin::setNelContext(NLMISC::INelContext *nelContext) // This only applies to platforms without PIC, e.g. Windows. nlassert(!NLMISC::INelContext::isContextInitialised()); #endif // NL_OS_WINDOWS - _LibContext = new NLMISC::CLibraryContext(*nelContext); -} - -QString SheetBuilderPlugin::name() const -{ - return "Sheet builder"; -} - -QString SheetBuilderPlugin::version() const -{ - return "1.0"; -} - -QString SheetBuilderPlugin::vendor() const -{ - return "kharvd"; -} - -QString SheetBuilderPlugin::description() const -{ - return "make_sheet_id equivalent"; -} - -QStringList SheetBuilderPlugin::dependencies() const -{ - QStringList list; - list.append(Core::Constants::OVQT_CORE_PLUGIN); - return list; + m_LibContext = new NLMISC::CLibraryContext(*nelContext); } Q_EXPORT_PLUGIN(SheetBuilderPlugin) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.h index f1299dfba..504d0914d 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.h @@ -28,11 +28,6 @@ namespace NLMISC class CLibraryContext; } -namespace ExtensionSystem -{ -class IPluginSpec; -} - namespace Plugin { @@ -43,25 +38,18 @@ class SheetBuilderPlugin : public QObject, public ExtensionSystem::IPlugin public: bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString); void extensionsInitialized(); - void setNelContext(NLMISC::INelContext *nelContext); - QString name() const; - QString version() const; - QString vendor() const; - QString description() const; - QStringList dependencies() const; - void buildSheet(bool clean); private Q_SLOTS: void execBuilderDialog(); protected: - NLMISC::CLibraryContext *_LibContext; + NLMISC::CLibraryContext *m_LibContext; private: - ExtensionSystem::IPluginManager *_plugMan; + ExtensionSystem::IPluginManager *m_plugMan; }; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/sheetbuilder.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/sheetbuilder.h index aac097c9b..eb9b3bc22 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/sheetbuilder.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/sheetbuilder.h @@ -54,7 +54,7 @@ union TFormId } }; -bool operator<(const TFormId& fid1, const TFormId& fid2) +bool operator<(const TFormId &fid1, const TFormId &fid2) { return fid1.Id(outputLine.data())),(uint)outputLine.size()); + output.serialBuffer((uint8 *)(const_cast(outputLine.data())),(uint)outputLine.size()); } displayInfo (tr("------------- results ----------------")); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/ovqt_plugin_zone_painter.xml b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/ovqt_plugin_zone_painter.xml new file mode 100644 index 000000000..cf9e8afde --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/ovqt_plugin_zone_painter.xml @@ -0,0 +1,10 @@ + + ovqt_plugin_zone_painter + ZonePainter + 0.0 + Ryzom Core + Zone Painter Plugin + + + + \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.cpp index 01086f231..e0c2dab0c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.cpp @@ -11,7 +11,7 @@ #include "painter_dock_widget.h" #include "../core/icore.h" -#include "../core/imenu_manager.h" +#include "../core/menu_manager.h" #include "../core/core_constants.h" ZonePainterMainWindow::ZonePainterMainWindow(QWidget *parent) : @@ -145,6 +145,7 @@ void ZonePainterMainWindow::loadConfig() { QColor color; color = settings->value("BackgroundColor", QColor(80, 80, 80)).value(); + settings->endGroup(); m_nelWidget->setBackgroundColor(NLMISC::CRGBA(color.red(), color.green(), color.blue(), color.alpha())); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_plugin.cpp index 9ccfb9053..ed7d601b9 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_plugin.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_plugin.cpp @@ -3,7 +3,7 @@ #include "zone_painter_settings_page.h" #include "../core/icore.h" #include "../core/core_constants.h" -#include "../core/imenu_manager.h" +#include "../core/menu_manager.h" #include "../../extension_system/iplugin_spec.h" // NeL includes @@ -19,22 +19,22 @@ namespace Plugin { - NLMISC_SAFE_SINGLETON_IMPL(CZoneManager) +// NLMISC_SAFE_SINGLETON_IMPL(CZoneManager) ZonePainterPlugin::~ZonePainterPlugin() { - Q_FOREACH(QObject *obj, _autoReleaseObjects) + Q_FOREACH(QObject *obj, m_autoReleaseObjects) { - _plugMan->removeObject(obj); + m_plugMan->removeObject(obj); } - qDeleteAll(_autoReleaseObjects); - _autoReleaseObjects.clear(); + qDeleteAll(m_autoReleaseObjects); + m_autoReleaseObjects.clear(); } bool ZonePainterPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) { Q_UNUSED(errorString); - _plugMan = pluginManager; + m_plugMan = pluginManager; addAutoReleasedObject(new CZonePainterSettingsPage(this)); addAutoReleasedObject(new CZonePainterContext(this)); @@ -45,19 +45,7 @@ bool ZonePainterPlugin::initialize(ExtensionSystem::IPluginManager *pluginManage void ZonePainterPlugin::extensionsInitialized() { Core::ICore *core = Core::ICore::instance(); - Core::IMenuManager *menuManager = core->menuManager(); - //menuManager = _plugMan->getObject(); - QAction *exampleAction1 = new QAction("Zone1", this); - QAction *exampleAction2 = new QAction("Zone2", this); - QAction *aboutQtAction = menuManager->action(Core::Constants::ABOUT_QT); - QMenu *helpMenu = menuManager->menu(Core::Constants::M_HELP); - helpMenu->insertAction(aboutQtAction, exampleAction1); - helpMenu->addSeparator(); - helpMenu->addAction(exampleAction2); - QMenu *zoneMenu = menuManager->menuBar()->addMenu("ZoneMenu"); - zoneMenu->insertAction(aboutQtAction, exampleAction1); - zoneMenu->addSeparator(); - zoneMenu->addAction(exampleAction2); + Core::MenuManager *menuManager = core->menuManager(); } void ZonePainterPlugin::setNelContext(NLMISC::INelContext *nelContext) @@ -67,57 +55,13 @@ void ZonePainterPlugin::setNelContext(NLMISC::INelContext *nelContext) // This only applies to platforms without PIC, e.g. Windows. nlassert(!NLMISC::INelContext::isContextInitialised()); #endif // NL_OS_WINDOWS - _LibContext = new NLMISC::CLibraryContext(*nelContext); -} - -QString ZonePainterPlugin::name() const -{ - return "ZonePainterPlugin"; -} - -QString ZonePainterPlugin::version() const -{ - return "0.2"; -} - -QString ZonePainterPlugin::vendor() const -{ - return "Ryzom Core"; -} - -QString ZonePainterPlugin::description() const -{ - return "Zone Painter Plugin"; -} - -QStringList ZonePainterPlugin::dependencies() const -{ - QStringList list; - list.append(Core::Constants::OVQT_CORE_PLUGIN); - //list.append("ObjectViewer"); - return list; + m_LibContext = new NLMISC::CLibraryContext(*nelContext); } void ZonePainterPlugin::addAutoReleasedObject(QObject *obj) { - _plugMan->addObject(obj); - _autoReleaseObjects.prepend(obj); -} - -QObject* ZonePainterPlugin::objectByName(const QString &name) const -{ - Q_FOREACH (QObject *qobj, _plugMan->allObjects()) - if (qobj->objectName() == name) - return qobj; - return 0; -} - -ExtensionSystem::IPluginSpec *ZonePainterPlugin::pluginByName(const QString &name) const -{ - Q_FOREACH (ExtensionSystem::IPluginSpec *spec, _plugMan->plugins()) - if (spec->name() == name) - return spec; - return 0; + m_plugMan->addObject(obj); + m_autoReleaseObjects.prepend(obj); } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_plugin.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_plugin.h index 2c1dff53e..dee4f3124 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_plugin.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_plugin.h @@ -31,7 +31,7 @@ class IPluginSpec; namespace Plugin { - class CZoneManager +/* class CZoneManager { NLMISC_SAFE_SINGLETON_DECL(CZoneManager) public: @@ -41,7 +41,7 @@ namespace Plugin NL3D::CLandscapeModel *m_painterLandscape; NL3D::CZone *m_currentZone; }; - +*/ class ZonePainterPlugin : public QObject, public ExtensionSystem::IPlugin { Q_OBJECT @@ -52,28 +52,16 @@ public: bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString); void extensionsInitialized(); - void setNelContext(NLMISC::INelContext *nelContext); - QString name() const; - QString version() const; - QString vendor() const; - QString description() const; - QStringList dependencies() const; - void addAutoReleasedObject(QObject *obj); - QObject *objectByName(const QString &name) const; - ExtensionSystem::IPluginSpec *pluginByName(const QString &name) const; - - - protected: - NLMISC::CLibraryContext *_LibContext; + NLMISC::CLibraryContext *m_LibContext; private: - ExtensionSystem::IPluginManager *_plugMan; - QList _autoReleaseObjects; + ExtensionSystem::IPluginManager *m_plugMan; + QList m_autoReleaseObjects; }; class CZonePainterContext: public Core::IContext