From 2181c4603f146303d63fdc76231fd300fbe980e3 Mon Sep 17 00:00:00 2001 From: cemycc Date: Tue, 14 Jun 2011 18:01:21 +0300 Subject: [PATCH] Changed: #1307 Update the plugin to work with the latest plugin system --- .../src/plugins/translation_manager/extract_bot_names.cpp | 1 + .../src/plugins/translation_manager/simple_viewer.cpp | 2 ++ .../src/plugins/translation_manager/simple_viewer.h | 4 +++- .../translation_manager/translation_manager_plugin.cpp | 8 ++++---- .../translation_manager/translation_manager_plugin.h | 8 ++++++++ .../translation_manager_settings_page.cpp | 5 +++++ .../translation_manager_settings_page.h | 3 ++- .../translation_manager_settings_page.ui | 2 +- 8 files changed, 26 insertions(+), 7 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/extract_bot_names.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/extract_bot_names.cpp index 75a97d3bb..3a24127e3 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/extract_bot_names.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/extract_bot_names.cpp @@ -36,6 +36,7 @@ vector Filters; static CLigoConfig LigoConfig; static bool RemoveOlds = false; + struct TCreatureInfo { CSheetId SheetId; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/simple_viewer.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/simple_viewer.cpp index e128710c4..1f6df9117 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/simple_viewer.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/simple_viewer.cpp @@ -37,6 +37,8 @@ CSimpleViewer::CSimpleViewer(QWidget *parent) gridLayout->setContentsMargins(0, 0, 0, 0); NLQT::QNLWidget *_nelWidget = new NLQT::QNLWidget(this); gridLayout->addWidget(_nelWidget, 0, 0, 1, 1); + + m_undoStack = new QUndoStack(this); } bool CCoreListener::closeMainWindow() const diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/simple_viewer.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/simple_viewer.h index bbff7e9e0..14b782c22 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/simple_viewer.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/simple_viewer.h @@ -25,7 +25,7 @@ // Qt includes #include - +#include class QWidget; namespace Plugin @@ -37,6 +37,8 @@ class CSimpleViewer : public QWidget public: CSimpleViewer(QWidget *parent = 0); virtual ~CSimpleViewer() {} + + QUndoStack *m_undoStack; }; class CCoreListener : public Core::ICoreListener diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_plugin.cpp index 233780ca5..f82024c79 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_plugin.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_plugin.cpp @@ -57,10 +57,10 @@ void TranslationManagerPlugin::extensionsInitialized() helpMenu->addSeparator(); helpMenu->insertAction(aboutQtAction, aboutTManPlugin); QMenu *transMenu = menuManager->menuBar()->addMenu("Translation Manager"); - /* Words extraction*/ - QAction *botnamesAct = new QAction("Extract bot_names", this); - connect(botnamesAct, SIGNAL(triggered()), this, SLOT(extractBotNames())); - transMenu->addAction(botnamesAct); + // Words extraction + QAction *botnamesAct = new QAction("Extract bot_names", this); + connect(botnamesAct, SIGNAL(triggered()), this, SLOT(extractBotNames())); + transMenu->addAction(botnamesAct); } void TranslationManagerPlugin::extractBotNames() diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_plugin.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_plugin.h index 07bf0d434..0dc6e6510 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_plugin.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_plugin.h @@ -92,6 +92,14 @@ public: { return m_simpleViewer; } + virtual QUndoStack *undoStack() + { + return m_simpleViewer->m_undoStack; + } + virtual void open() + { + + } CSimpleViewer *m_simpleViewer; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_settings_page.cpp index b3a731ae5..d99cc8642 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_settings_page.cpp @@ -59,6 +59,11 @@ QString CTranslationManagerSettingsPage::trCategory() const return tr("General"); } +QIcon CTranslationManagerSettingsPage::categoryIcon() const +{ + return QIcon(); +} + QWidget *CTranslationManagerSettingsPage::createPage(QWidget *parent) { _currentPage = new QWidget(parent); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_settings_page.h index 4fec51fb6..7a082f199 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_settings_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_settings_page.h @@ -43,8 +43,9 @@ public: virtual QString trName() const; virtual QString category() const; virtual QString trCategory() const; + virtual QIcon categoryIcon() const; virtual QWidget *createPage(QWidget *parent); - + virtual void apply(); virtual void finish() {} private Q_SLOTS: diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_settings_page.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_settings_page.ui index c58533185..6da7b0d8b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_settings_page.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_settings_page.ui @@ -7,7 +7,7 @@ 0 0 490 - 495 + 482