From 14e41c2c071dbdcdab0f875094b7340de19ea2ce Mon Sep 17 00:00:00 2001 From: sfb Date: Tue, 31 May 2011 07:34:42 -0500 Subject: [PATCH] Changed: Merged in latest API changes to OVQT plugin system. --- .../zone_painter/zone_painter_main_window.cpp | 2 +- .../zone_painter/zone_painter_main_window.h | 5 +- .../zone_painter/zone_painter_plugin.h | 54 +++++++++++-------- .../zone_painter_settings_page.cpp | 7 ++- .../zone_painter/zone_painter_settings_page.h | 1 + 5 files changed, 43 insertions(+), 26 deletions(-) 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 1bd91f667..01086f231 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 @@ -77,7 +77,7 @@ ZonePainterMainWindow::ZonePainterMainWindow(QWidget *parent) : Core::ICore::instance()->mainWindow()->statusBar()->addPermanentWidget(m_statusInfo); - + m_undoStack = new QUndoStack(this); } void ZonePainterMainWindow::showEvent(QShowEvent *showEvent) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.h index d55eb39e5..0dbfd9948 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.h @@ -5,6 +5,7 @@ #include #include #include +#include namespace NLQT { class QNLWidget; @@ -26,7 +27,7 @@ public: void loadConfig(); void saveConfig(); - + QUndoStack *getUndoStack() { return m_undoStack; } public Q_SLOTS: void setToolMode(int value); void setToolMode(); @@ -49,7 +50,7 @@ private: QAction *_toolSelectModeAction; QAction *_toolPickModeAction; QMenu *_toolModeMenu; - + QUndoStack *m_undoStack; //QAction *m_setBackColorAction; }; 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 aeae39ba6..0d5b9296a 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 @@ -79,28 +79,38 @@ class CZonePainterContext: public Core::IContext { Q_OBJECT public: - CZonePainterContext(QObject *parent = 0): IContext(parent) - { - m_zonePainterMainWindow = new ZonePainterMainWindow(); - } - virtual ~CZonePainterContext() {} - - virtual QString id() const - { - return QLatin1String("ZonePainterContext"); - } - virtual QString trName() const - { - return tr("Zone Painter"); - } - virtual QIcon icon() const - { - return QIcon(); - } - virtual QWidget *widget() - { - return m_zonePainterMainWindow; - } + CZonePainterContext(QObject *parent = 0): IContext(parent) + { + m_zonePainterMainWindow = new ZonePainterMainWindow(); + } + virtual ~CZonePainterContext() {} + + virtual QString id() const + { + return QLatin1String("ZonePainterContext"); + } + virtual QString trName() const + { + return tr("Zone Painter"); + } + virtual QIcon icon() const + { + return QIcon(); + } + virtual QWidget *widget() + { + return m_zonePainterMainWindow; + } + + virtual QUndoStack *undoStack() + { + return m_zonePainterMainWindow->getUndoStack(); + } + virtual void open() + { + } + + ZonePainterMainWindow *m_zonePainterMainWindow; }; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_settings_page.cpp index 69c4e7525..e59f76da1 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_settings_page.cpp @@ -53,6 +53,11 @@ QString CZonePainterSettingsPage::trCategory() const return tr("General"); } +QIcon CZonePainterSettingsPage::categoryIcon() const +{ + return QIcon(); +} + QWidget *CZonePainterSettingsPage::createPage(QWidget *parent) { _currentPage = new QWidget(parent); @@ -64,4 +69,4 @@ void CZonePainterSettingsPage::apply() { } -} /* namespace Plugin */ \ No newline at end of file +} /* namespace Plugin */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_settings_page.h index 8e4b3f3d6..d84b117eb 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_settings_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_settings_page.h @@ -43,6 +43,7 @@ public: virtual QString trName() const; virtual QString category() const; virtual QString trCategory() const; + QIcon categoryIcon() const; virtual QWidget *createPage(QWidget *parent); virtual void apply();