From 181bff3a2d46b411da9f13e95b109f22626faf1c Mon Sep 17 00:00:00 2001 From: dnk-88 Date: Mon, 29 Nov 2010 18:46:43 +0200 Subject: [PATCH] Changed: #1206 ovqt plugin system. --- .../src/extension_system/iplugin_manager.h | 2 + .../src/extension_system/morph_mesh_form.ui | 92 +++++++++++++++++++ .../src/extension_system/plugin_manager.cpp | 7 +- .../src/extension_system/plugin_manager.h | 2 +- .../src/extension_system/plugin_spec.cpp | 13 ++- 5 files changed, 104 insertions(+), 12 deletions(-) create mode 100644 code/nel/tools/3d/object_viewer_qt/src/extension_system/morph_mesh_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_manager.h b/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_manager.h index 05aabe856..4592c0f47 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_manager.h +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_manager.h @@ -46,6 +46,8 @@ public: virtual void setPluginPaths(const QStringList &paths) = 0; virtual QList plugins() const = 0; + virtual CPluginSpec *pluginByName(const QString &name) const = 0; + Q_SIGNALS: void objectAdded(QObject *obj); void aboutToRemoveObject(QObject *obj); diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/morph_mesh_form.ui b/code/nel/tools/3d/object_viewer_qt/src/extension_system/morph_mesh_form.ui new file mode 100644 index 000000000..e65206408 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/morph_mesh_form.ui @@ -0,0 +1,92 @@ + + + CPluginView + + + + 0 + 0 + 691 + 249 + + + + Plugins + + + true + + + + + + + State + + + + + Name + + + + + Version + + + + + Vendor + + + + + Location + + + + + + + + Details + + + + + + + false + + + Error details + + + + + + + Qt::Horizontal + + + + 427 + 20 + + + + + + + + Close + + + + + + + + + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp index 551f4222f..03f4fe3ac 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp @@ -141,10 +141,9 @@ void CPluginManager::readPluginPaths() Q_FOREACH (const QString &pluginFile, pluginsList) { CPluginSpec *spec = new CPluginSpec; - if (spec->setFileName(pluginFile)) - _pluginSpecs.append(spec); - else - delete spec; + spec->setFileName(pluginFile); + spec->_pluginManager = this; + _pluginSpecs.append(spec); } Q_EMIT pluginsChanged(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.h b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.h index 63a781eee..3fb92e282 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.h +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.h @@ -50,7 +50,7 @@ public: virtual void setPluginPaths(const QStringList &paths); virtual QList plugins() const; - CPluginSpec *pluginByName(const QString &name) const; + virtual CPluginSpec *pluginByName(const QString &name) const; private: void setPluginState(CPluginSpec *spec, int destState); 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 8237e1dd7..2d6c5e34d 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 @@ -98,14 +98,13 @@ QString CPluginSpec::errorString() const bool CPluginSpec::setFileName(const QString &fileName) { - _name - = _version - = _vendor + _name = _version + = _vendor = _description - = _location - = _filePath - = _fileName - = ""; + = _location + = _filePath + = _fileName + = ""; _state = State::Invalid; _hasError = false; _errorString = "";