From f5a42f16de89523acf50bf5fdb5d87dd9c4cd9a3 Mon Sep 17 00:00:00 2001 From: sfb Date: Sun, 8 May 2011 14:59:27 -0500 Subject: [PATCH] Changed: Started fixing up the menus. --- .../zone_painter/zone_painter_model.cpp | 40 ++++++++++++++++++ .../plugins/zone_painter/zone_painter_model.h | 42 +++++++++++++++++++ .../zone_painter/zone_painter_plugin.cpp | 32 ++++++++------ .../zone_painter/zone_painter_plugin.h | 5 +++ 4 files changed, 107 insertions(+), 12 deletions(-) create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_model.cpp create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_model.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_model.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_model.cpp new file mode 100644 index 000000000..4ab93d62d --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_model.cpp @@ -0,0 +1,40 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "zone_painter_model.h" + +// STL includes + +// Qt includes + +// NeL includes + +namespace Plugin +{ + +CZonePainterModel::CZonePainterModel() +{ + +} + +CZonePainterModel::~CZonePainterModel() +{ + +} + +} /* namespace Plugin */ + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_model.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_model.h new file mode 100644 index 000000000..259634b63 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_model.h @@ -0,0 +1,42 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef ZONE_PAINTER_MODEL_H +#define ZONE_PAINTER_MODEL_H + +// NeL includes +#include +#include +#include + +// Qt includes + +namespace Plugin +{ + +class CZonePainterModel +{ +public: + CZonePainterModel(); + virtual ~CZonePainterModel(); + +}; /* class CZonePainterModel */ + +} /* namespace Plugin */ + + +#endif // ZONE_PAINTER_MODEL_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_plugin.cpp index 7b8237ccb..bfd310e95 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_plugin.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_plugin.cpp @@ -16,6 +16,7 @@ #include #include #include +#include namespace Plugin { @@ -37,6 +38,7 @@ bool ZonePainterPlugin::initialize(ExtensionSystem::IPluginManager *pluginManage addAutoReleasedObject(new CZonePainterSettingsPage(this)); addAutoReleasedObject(new CZonePainterContext(this)); //addAutoReleasedObject(new CCoreListener(this)); + return true; } @@ -44,20 +46,26 @@ void ZonePainterPlugin::extensionsInitialized() { Core::ICore *core = Core::ICore::instance(); Core::IMenuManager *menuManager = core->menuManager(); - //menuManager = _plugMan->getObject(); - QAction *exampleAction1 = new QAction("Zone1", this); - QAction *exampleAction2 = new QAction("Zone2", this); - QAction *aboutQtAction = menuManager->action(Core::Constants::ABOUT_QT); - QMenu *helpMenu = menuManager->menu(Core::Constants::M_HELP); - helpMenu->insertAction(aboutQtAction, exampleAction1); - helpMenu->addSeparator(); - helpMenu->addAction(exampleAction2); - QMenu *zoneMenu = menuManager->menuBar()->addMenu("ZoneMenu"); - zoneMenu->insertAction(aboutQtAction, exampleAction1); - zoneMenu->addSeparator(); - zoneMenu->addAction(exampleAction2); + QAction *loadZoneAction = new QAction("Load Zone", this); + QAction *saveZoneAction = new QAction("Save Zone", this); + + QMenu *toolsMenu = menuManager->menu(Core::Constants::M_TOOLS); + QMenu *zoneMenu = toolsMenu->addMenu("Zone Painter"); + zoneMenu->addAction(loadZoneAction); + connect(loadZoneAction, SIGNAL(triggered()), this, SLOT(clickLoadZoneAction())); + zoneMenu->addAction(saveZoneAction); } +/****** SLOTS ******/ +void ZonePainterPlugin::clickLoadZoneAction() { + QString zoneFile = QFileDialog::getOpenFileName(NULL, tr("Open Zone File"), ".", tr("Zone Files (*.zone);;")); +} + +void ZonePainterPlugin::clickSaveZoneAction() { + +} +/****** END SLOTS ******/ + void ZonePainterPlugin::setNelContext(NLMISC::INelContext *nelContext) { #ifdef NL_OS_WINDOWS 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..2731637ed 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 @@ -65,7 +65,10 @@ public: QObject *objectByName(const QString &name) const; ExtensionSystem::IPluginSpec *pluginByName(const QString &name) const; +public Q_SLOTS: + void clickLoadZoneAction(); + void clickSaveZoneAction(); protected: NLMISC::CLibraryContext *_LibContext; @@ -73,6 +76,8 @@ protected: private: ExtensionSystem::IPluginManager *_plugMan; QList _autoReleaseObjects; + + NL3D::CLandscapeModel *m_Landscape; }; class CZonePainterContext: public Core::IContext