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.

This commit is contained in:
dnk-88 2011-09-26 02:53:15 +03:00
parent f07731ad20
commit 95382a9d35
9 changed files with 40 additions and 87 deletions

View file

@ -67,33 +67,6 @@ void LandscapeEditorPlugin::setNelContext(NLMISC::INelContext *nelContext)
m_libContext = new NLMISC::CLibraryContext(*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) void LandscapeEditorPlugin::addAutoReleasedObject(QObject *obj)
{ {
m_plugMan->addObject(obj); m_plugMan->addObject(obj);

View file

@ -54,15 +54,8 @@ public:
bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString); bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString);
void extensionsInitialized(); void extensionsInitialized();
void shutdown(); void shutdown();
void setNelContext(NLMISC::INelContext *nelContext); void setNelContext(NLMISC::INelContext *nelContext);
QString name() const;
QString version() const;
QString vendor() const;
QString description() const;
QStringList dependencies() const;
void addAutoReleasedObject(QObject *obj); void addAutoReleasedObject(QObject *obj);
protected: protected:

View file

@ -24,7 +24,7 @@
#include "snapshot_dialog.h" #include "snapshot_dialog.h"
#include "../core/icore.h" #include "../core/icore.h"
#include "../core/imenu_manager.h" #include "../core/menu_manager.h"
#include "../core/core_constants.h" #include "../core/core_constants.h"
// NeL includes // NeL includes
@ -348,12 +348,12 @@ void LandscapeEditorWindow::updateStatusBar()
void LandscapeEditorWindow::createMenus() void LandscapeEditorWindow::createMenus()
{ {
Core::IMenuManager *menuManager = Core::ICore::instance()->menuManager(); Core::MenuManager *menuManager = Core::ICore::instance()->menuManager();
} }
void LandscapeEditorWindow::createToolBars() void LandscapeEditorWindow::createToolBars()
{ {
Core::IMenuManager *menuManager = Core::ICore::instance()->menuManager(); Core::MenuManager *menuManager = Core::ICore::instance()->menuManager();
//QAction *action = menuManager->action(Core::Constants::NEW); //QAction *action = menuManager->action(Core::Constants::NEW);
//m_ui.fileToolBar->addAction(action); //m_ui.fileToolBar->addAction(action);
//action = menuManager->action(Core::Constants::SAVE); //action = menuManager->action(Core::Constants::SAVE);

View file

@ -0,0 +1,10 @@
<plugin-spec>
<library-name>ovqt_plugin_landscape_editor</library-name>
<name>LandscapeEditor</name>
<version>0.8</version>
<vendor>GSoC2011_dnk-88</vendor>
<description>Landscape editor ovqt plugin.</description>
<dependencies>
<dependency plugin-name="Core" version="0.8"/>
</dependencies>
</plugin-spec>

View file

@ -0,0 +1,11 @@
<plugin-spec>
<library-name>ovqt_plugin_world_editor</library-name>
<name>WorldEditor</name>
<version>0.6</version>
<vendor>GSoC2011_dnk-88</vendor>
<description>Landscape editor ovqt plugin.</description>
<dependencies>
<dependency plugin-name="Core" version="0.8"/>
<dependency plugin-name="LandscapeEditor" version="0.6"/>
</dependencies>
</plugin-spec>

View file

@ -158,20 +158,20 @@ void addNewGraphicsItems(const QModelIndex &primIndex, PrimitivesTreeModel *mode
primitive->getPropertyByName ("Color", color); primitive->getPropertyByName ("Color", color);
item->setColor(QColor(color.R, color.G, color.B)); item->setColor(QColor(color.R, color.G, color.B));
QVariant variantNode;
variantNode.setValue<Node *>(node);
item->setData(Constants::WORLD_EDITOR_NODE, variantNode);
QVariant graphicsData;
graphicsData.setValue<AbstractWorldItem *>(item);
node->setData(Constants::GRAPHICS_DATA_QT4_2D, graphicsData);
QVariant persistenVariant;
QPersistentModelIndex *persistentIndex = new QPersistentModelIndex(primIndex);
persistenVariant.setValue<QPersistentModelIndex *>(persistentIndex);
item->setData(Constants::NODE_PERISTENT_INDEX, persistenVariant);
} }
QVariant variantNode;
variantNode.setValue<Node *>(node);
item->setData(Constants::WORLD_EDITOR_NODE, variantNode);
QVariant graphicsData;
graphicsData.setValue<AbstractWorldItem *>(item);
node->setData(Constants::GRAPHICS_DATA_QT4_2D, graphicsData);
QVariant persistenVariant;
QPersistentModelIndex *persistentIndex = new QPersistentModelIndex(primIndex);
persistenVariant.setValue<QPersistentModelIndex *>(persistentIndex);
item->setData(Constants::NODE_PERISTENT_INDEX, persistenVariant);
} }
int count = model->rowCount(primIndex); int count = model->rowCount(primIndex);

View file

@ -103,33 +103,6 @@ void WorldEditorPlugin::setNelContext(NLMISC::INelContext *nelContext)
m_libContext = new NLMISC::CLibraryContext(*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) void WorldEditorPlugin::addAutoReleasedObject(QObject *obj)
{ {
m_plugMan->addObject(obj); m_plugMan->addObject(obj);

View file

@ -56,15 +56,8 @@ public:
bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString); bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString);
void extensionsInitialized(); void extensionsInitialized();
void shutdown(); void shutdown();
void setNelContext(NLMISC::INelContext *nelContext); void setNelContext(NLMISC::INelContext *nelContext);
QString name() const;
QString version() const;
QString vendor() const;
QString description() const;
QStringList dependencies() const;
void addAutoReleasedObject(QObject *obj); void addAutoReleasedObject(QObject *obj);
protected: protected:

View file

@ -26,7 +26,7 @@
// Core // Core
#include "../core/icore.h" #include "../core/icore.h"
#include "../core/imenu_manager.h" #include "../core/menu_manager.h"
#include "../core/core_constants.h" #include "../core/core_constants.h"
// Lanscape Editor plugin // Lanscape Editor plugin
@ -347,12 +347,12 @@ void WorldEditorWindow::hideEvent(QHideEvent *hideEvent)
void WorldEditorWindow::createMenus() void WorldEditorWindow::createMenus()
{ {
Core::IMenuManager *menuManager = Core::ICore::instance()->menuManager(); Core::MenuManager *menuManager = Core::ICore::instance()->menuManager();
} }
void WorldEditorWindow::createToolBars() void WorldEditorWindow::createToolBars()
{ {
Core::IMenuManager *menuManager = Core::ICore::instance()->menuManager(); Core::MenuManager *menuManager = Core::ICore::instance()->menuManager();
//QAction *action = menuManager->action(Core::Constants::NEW); //QAction *action = menuManager->action(Core::Constants::NEW);
//m_ui.fileToolBar->addAction(action); //m_ui.fileToolBar->addAction(action);