From ede23b7077c153066378a4a22037acc3cc27407d Mon Sep 17 00:00:00 2001 From: dnk-88 Date: Mon, 26 Sep 2011 02:53:15 +0300 Subject: [PATCH] Changed: #1193 Updated landscape editor and world editor plugins with latest API changes to OVQT plugin system. Added the plugin-spec files for each plugin. --- .../landscape_editor_plugin.cpp | 27 ------------------- .../landscape_editor_plugin.h | 7 ----- .../landscape_editor_window.cpp | 6 ++--- .../ovqt_plugin_landscape_editor.xml | 10 +++++++ .../world_editor/ovqt_plugin_world_editor.xml | 11 ++++++++ .../world_editor/world_editor_actions.cpp | 26 +++++++++--------- .../world_editor/world_editor_plugin.cpp | 27 ------------------- .../world_editor/world_editor_plugin.h | 7 ----- .../world_editor/world_editor_window.cpp | 6 ++--- 9 files changed, 40 insertions(+), 87 deletions(-) create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/ovqt_plugin_landscape_editor.xml create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/ovqt_plugin_world_editor.xml diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_plugin.cpp index e7665b42f..bbd285adc 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_plugin.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_plugin.cpp @@ -67,33 +67,6 @@ void LandscapeEditorPlugin::setNelContext(NLMISC::INelContext *nelContext) m_libContext = new NLMISC::CLibraryContext(*nelContext); } -QString LandscapeEditorPlugin::name() const -{ - return tr("LandscapeEditor"); -} - -QString LandscapeEditorPlugin::version() const -{ - return "0.8"; -} - -QString LandscapeEditorPlugin::vendor() const -{ - return "GSoC2011_dnk-88"; -} - -QString LandscapeEditorPlugin::description() const -{ - return "Landscape editor ovqt plugin."; -} - -QStringList LandscapeEditorPlugin::dependencies() const -{ - QStringList list; - list.append(Core::Constants::OVQT_CORE_PLUGIN); - return list; -} - void LandscapeEditorPlugin::addAutoReleasedObject(QObject *obj) { m_plugMan->addObject(obj); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_plugin.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_plugin.h index 4515da8be..145972e29 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_plugin.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_plugin.h @@ -54,15 +54,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/landscape_editor/landscape_editor_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.cpp index 69b27c660..6b4377a37 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.cpp @@ -24,7 +24,7 @@ #include "snapshot_dialog.h" #include "../core/icore.h" -#include "../core/imenu_manager.h" +#include "../core/menu_manager.h" #include "../core/core_constants.h" // NeL includes @@ -348,12 +348,12 @@ void LandscapeEditorWindow::updateStatusBar() void LandscapeEditorWindow::createMenus() { - Core::IMenuManager *menuManager = Core::ICore::instance()->menuManager(); + Core::MenuManager *menuManager = Core::ICore::instance()->menuManager(); } void LandscapeEditorWindow::createToolBars() { - Core::IMenuManager *menuManager = Core::ICore::instance()->menuManager(); + Core::MenuManager *menuManager = Core::ICore::instance()->menuManager(); //QAction *action = menuManager->action(Core::Constants::NEW); //m_ui.fileToolBar->addAction(action); //action = menuManager->action(Core::Constants::SAVE); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/ovqt_plugin_landscape_editor.xml b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/ovqt_plugin_landscape_editor.xml new file mode 100644 index 000000000..ab71b7044 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/ovqt_plugin_landscape_editor.xml @@ -0,0 +1,10 @@ + + ovqt_plugin_landscape_editor + LandscapeEditor + 0.8 + GSoC2011_dnk-88 + Landscape editor ovqt plugin. + + + + \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/ovqt_plugin_world_editor.xml b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/ovqt_plugin_world_editor.xml new file mode 100644 index 000000000..7a37eaf56 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/ovqt_plugin_world_editor.xml @@ -0,0 +1,11 @@ + + ovqt_plugin_world_editor + WorldEditor + 0.6 + GSoC2011_dnk-88 + Landscape editor ovqt plugin. + + + + + \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_actions.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_actions.cpp index 1e27c9f12..7e78cdaf5 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_actions.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_actions.cpp @@ -158,20 +158,20 @@ void addNewGraphicsItems(const QModelIndex &primIndex, PrimitivesTreeModel *mode primitive->getPropertyByName ("Color", color); item->setColor(QColor(color.R, color.G, color.B)); + + QVariant variantNode; + variantNode.setValue(node); + item->setData(Constants::WORLD_EDITOR_NODE, variantNode); + + QVariant graphicsData; + graphicsData.setValue(item); + node->setData(Constants::GRAPHICS_DATA_QT4_2D, graphicsData); + + QVariant persistenVariant; + QPersistentModelIndex *persistentIndex = new QPersistentModelIndex(primIndex); + persistenVariant.setValue(persistentIndex); + item->setData(Constants::NODE_PERISTENT_INDEX, persistenVariant); } - - QVariant variantNode; - variantNode.setValue(node); - item->setData(Constants::WORLD_EDITOR_NODE, variantNode); - - QVariant graphicsData; - graphicsData.setValue(item); - node->setData(Constants::GRAPHICS_DATA_QT4_2D, graphicsData); - - QVariant persistenVariant; - QPersistentModelIndex *persistentIndex = new QPersistentModelIndex(primIndex); - persistenVariant.setValue(persistentIndex); - item->setData(Constants::NODE_PERISTENT_INDEX, persistenVariant); } int count = model->rowCount(primIndex); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_plugin.cpp index 23b51e9e3..aa995777a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_plugin.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_plugin.cpp @@ -103,33 +103,6 @@ void WorldEditorPlugin::setNelContext(NLMISC::INelContext *nelContext) m_libContext = new NLMISC::CLibraryContext(*nelContext); } -QString WorldEditorPlugin::name() const -{ - return tr("WorldEditor"); -} - -QString WorldEditorPlugin::version() const -{ - return "0.1"; -} - -QString WorldEditorPlugin::vendor() const -{ - return "GSoC2011_dnk-88"; -} - -QString WorldEditorPlugin::description() const -{ - return "World editor ovqt plugin."; -} - -QStringList WorldEditorPlugin::dependencies() const -{ - QStringList list; - list.append(Core::Constants::OVQT_CORE_PLUGIN); - return list; -} - void WorldEditorPlugin::addAutoReleasedObject(QObject *obj) { m_plugMan->addObject(obj); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_plugin.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_plugin.h index 11e2c7871..4a107d11b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_plugin.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_plugin.h @@ -56,15 +56,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/world_editor/world_editor_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_window.cpp index b2691fba3..f1b8b17f1 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_window.cpp @@ -26,7 +26,7 @@ // Core #include "../core/icore.h" -#include "../core/imenu_manager.h" +#include "../core/menu_manager.h" #include "../core/core_constants.h" // Lanscape Editor plugin @@ -347,12 +347,12 @@ void WorldEditorWindow::hideEvent(QHideEvent *hideEvent) void WorldEditorWindow::createMenus() { - Core::IMenuManager *menuManager = Core::ICore::instance()->menuManager(); + Core::MenuManager *menuManager = Core::ICore::instance()->menuManager(); } void WorldEditorWindow::createToolBars() { - Core::IMenuManager *menuManager = Core::ICore::instance()->menuManager(); + Core::MenuManager *menuManager = Core::ICore::instance()->menuManager(); //QAction *action = menuManager->action(Core::Constants::NEW); //m_ui.fileToolBar->addAction(action);