Changed: #1193 moved OV actions in a separatly menu.

This commit is contained in:
dnk-88 2011-03-04 23:56:37 +02:00
parent cf39fcd06c
commit a58624791b
5 changed files with 96 additions and 92 deletions

View file

@ -46,36 +46,36 @@ class IPlugin
public: public:
virtual ~IPlugin() {} virtual ~IPlugin() {}
/** /**
@brief Called after the plugin has been loaded and the IPlugin instance has been created. @brief Called after the plugin has been loaded and the IPlugin instance has been created.
@details The initialize methods of plugins that depend @details The initialize methods of plugins that depend
on this plugin are called after the initialize method of this plugin on this plugin are called after the initialize method of this plugin
has been called. Plugins should initialize their internal state in this has been called. Plugins should initialize their internal state in this
method. Returns if initialization of successful. If it wasn't successful, method. Returns if initialization of successful. If it wasn't successful,
the \a errorString should be set to a user-readable message the \a errorString should be set to a user-readable message
describing the reason. describing the reason.
*/ */
virtual bool initialize(IPluginManager *pluginManager, QString *errorString) = 0; virtual bool initialize(IPluginManager *pluginManager, QString *errorString) = 0;
/** /**
@brief Called after the IPlugin::initialize() method has been called, @brief Called after the IPlugin::initialize() method has been called,
and after both the IPlugin::initialize() and IPlugin::extensionsInitialized() and after both the IPlugin::initialize() and IPlugin::extensionsInitialized()
methods of plugins that depend on this plugin have been called. methods of plugins that depend on this plugin have been called.
@details In this method, the plugin can assume that plugins that depend on @details In this method, the plugin can assume that plugins that depend on
this plugin are fully 'up and running'. It is a good place to this plugin are fully 'up and running'. It is a good place to
look in the plugin manager's object pool for objects that have look in the plugin manager's object pool for objects that have
been provided by dependent plugins. been provided by dependent plugins.
*/ */
virtual void extensionsInitialized() = 0; virtual void extensionsInitialized() = 0;
/** /**
@\brief Called during a shutdown sequence in the same order as initialization @\brief Called during a shutdown sequence in the same order as initialization
before the plugins get deleted in reverse order. before the plugins get deleted in reverse order.
@details This method should be used to disconnect from other plugins, @details This method should be used to disconnect from other plugins,
hide all UI, and optimize shutdown in general. hide all UI, and optimize shutdown in general.
*/ */
virtual void shutdown() { } virtual void shutdown() { }
@ -83,14 +83,14 @@ public:
@\brief This method should be implemented to work properly NeL singletons. @\brief This method should be implemented to work properly NeL singletons.
Called immediately after loading the plugin. Called immediately after loading the plugin.
@code @code
void Plugin::setNelContext(NLMISC::INelContext *nelContext) void Plugin::setNelContext(NLMISC::INelContext *nelContext)
{ {
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
// Ensure that a context doesn't exist yet. // Ensure that a context doesn't exist yet.
// This only applies to platforms without PIC, e.g. Windows. // This only applies to platforms without PIC, e.g. Windows.
nlassert(!NLMISC::INelContext::isContextInitialised()); nlassert(!NLMISC::INelContext::isContextInitialised());
#endif // NL_OS_WINDOWS #endif // NL_OS_WINDOWS
_LibContext = new NLMISC::CLibraryContext(*nelContext); _LibContext = new NLMISC::CLibraryContext(*nelContext);
} }
@endcode @endcode
*/ */

View file

@ -1,19 +1,19 @@
// Object Viewer Qt - MMORPG Framework <http://dev.ryzom.com/projects/nel/> // Object Viewer Qt - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited // Copyright (C) 2010 Winch Gate Property Limited
// Copyright (C) 2011 Dzmitry Kamiahin <dnk-88@tut.by> // Copyright (C) 2011 Dzmitry Kamiahin <dnk-88@tut.by>
// Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. // Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009.
// //
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as // it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the // published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version. // License, or (at your option) any later version.
// //
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details. // GNU Affero General Public License for more details.
// //
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "plugin_manager.h" #include "plugin_manager.h"

View file

@ -1,19 +1,19 @@
// Object Viewer Qt - MMORPG Framework <http://dev.ryzom.com/projects/nel/> // Object Viewer Qt - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited // Copyright (C) 2010 Winch Gate Property Limited
// Copyright (C) 2011 Dzmitry Kamiahin <dnk-88@tut.by> // Copyright (C) 2011 Dzmitry Kamiahin <dnk-88@tut.by>
// Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. // Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009.
// //
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as // it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the // published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version. // License, or (at your option) any later version.
// //
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details. // GNU Affero General Public License for more details.
// //
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "plugin_spec.h" #include "plugin_spec.h"

View file

@ -88,9 +88,9 @@ QString MyPlugin::description() const
QStringList MyPlugin::dependencies() const QStringList MyPlugin::dependencies() const
{ {
QStringList list; QStringList list;
list.append(Core::Constants::OVQT_CORE_PLUGIN); list.append(Core::Constants::OVQT_CORE_PLUGIN);
list.append("ObjectViewer"); list.append("ObjectViewer");
return list; return list;
} }

View file

@ -241,14 +241,14 @@ void CMainWindow::settings()
void CMainWindow::updateStatusBar() void CMainWindow::updateStatusBar()
{ {
/* if (_isGraphicsInitialized) /* if (_isGraphicsInitialized)
{ {
_statusInfo->setText(QString("%1, Nb tri: %2 , Texture used (Mb): %3 , fps: %4 ").arg( _statusInfo->setText(QString("%1, Nb tri: %2 , Texture used (Mb): %3 , fps: %4 ").arg(
Modules::objView().getDriver()->getVideocardInformation()).arg( Modules::objView().getDriver()->getVideocardInformation()).arg(
_numTri).arg( _numTri).arg(
_texMem, 0,'f',4).arg( _texMem, 0,'f',4).arg(
_fps, 0,'f',2)); _fps, 0,'f',2));
}*/ }*/
} }
void CMainWindow::createActions() void CMainWindow::createActions()
@ -285,10 +285,10 @@ void CMainWindow::createActions()
void CMainWindow::createMenus() void CMainWindow::createMenus()
{ {
Core::IMenuManager *menuManager = Core::ICore::instance()->menuManager(); Core::IMenuManager *menuManager = Core::ICore::instance()->menuManager();
// register actions for file menu // register actions for file menu
menuManager->registerAction(_openAction, "ObjectViewer.File.Open"); menuManager->registerAction(_openAction, "ObjectViewer.File.Open");
// add actions in file menu // add actions in file menu
QMenu *fileMenu = menuManager->menu(Core::Constants::M_FILE); QMenu *fileMenu = menuManager->menu(Core::Constants::M_FILE);
QAction *exitAction = menuManager->action(Core::Constants::EXIT); QAction *exitAction = menuManager->action(Core::Constants::EXIT);
@ -301,7 +301,7 @@ void CMainWindow::createMenus()
menuManager->registerAction(_resetSceneAction, "ObjectViewer.View.ResetScene"); menuManager->registerAction(_resetSceneAction, "ObjectViewer.View.ResetScene");
menuManager->registerAction(_reloadTexturesAction, "ObjectViewer.View.ReloadTextures"); menuManager->registerAction(_reloadTexturesAction, "ObjectViewer.View.ReloadTextures");
menuManager->registerAction(_saveScreenshotAction, "ObjectViewer.View.SaveScreenshot"); menuManager->registerAction(_saveScreenshotAction, "ObjectViewer.View.SaveScreenshot");
// add actions in view menu // add actions in view menu
QMenu *viewMenu = menuManager->menu(Core::Constants::M_VIEW); QMenu *viewMenu = menuManager->menu(Core::Constants::M_VIEW);
viewMenu->addAction(_setBackColorAction); viewMenu->addAction(_setBackColorAction);
@ -313,40 +313,44 @@ void CMainWindow::createMenus()
// add actions in tools menu // add actions in tools menu
QMenu *toolsMenu = menuManager->menu(Core::Constants::M_TOOLS); QMenu *toolsMenu = menuManager->menu(Core::Constants::M_TOOLS);
QAction *settingsAction = menuManager->action(Core::Constants::SETTINGS); QAction *settingsAction = menuManager->action(Core::Constants::SETTINGS);
toolsMenu->insertAction(settingsAction ,_AnimationDialog->toggleViewAction()); QMenu *ovMenu = new QMenu("Object Viewer", this);
menuManager->registerMenu(ovMenu, "ObjectViewerQt.ObjectViewer");
toolsMenu->insertMenu(settingsAction, ovMenu);
ovMenu->insertAction(settingsAction ,_AnimationDialog->toggleViewAction());
_AnimationDialog->toggleViewAction()->setIcon(QIcon(":/images/anim.png")); _AnimationDialog->toggleViewAction()->setIcon(QIcon(":/images/anim.png"));
toolsMenu->insertAction(settingsAction ,_AnimationSetDialog->toggleViewAction()); ovMenu->insertAction(settingsAction ,_AnimationSetDialog->toggleViewAction());
_AnimationSetDialog->toggleViewAction()->setIcon(QIcon(":/images/animset.png")); _AnimationSetDialog->toggleViewAction()->setIcon(QIcon(":/images/animset.png"));
toolsMenu->insertAction(settingsAction ,_SlotManagerDialog->toggleViewAction()); ovMenu->insertAction(settingsAction ,_SlotManagerDialog->toggleViewAction());
_SlotManagerDialog->toggleViewAction()->setIcon(QIcon(":/images/mixer.png")); _SlotManagerDialog->toggleViewAction()->setIcon(QIcon(":/images/mixer.png"));
toolsMenu->insertAction(settingsAction ,_ParticleControlDialog->toggleViewAction()); ovMenu->insertAction(settingsAction ,_ParticleControlDialog->toggleViewAction());
_ParticleControlDialog->toggleViewAction()->setIcon(QIcon(":/images/pqrticles.png")); _ParticleControlDialog->toggleViewAction()->setIcon(QIcon(":/images/pqrticles.png"));
toolsMenu->insertAction(settingsAction ,_DayNightDialog->toggleViewAction()); ovMenu->insertAction(settingsAction ,_DayNightDialog->toggleViewAction());
_DayNightDialog->toggleViewAction()->setIcon(QIcon(":/images/dqynight.png")); _DayNightDialog->toggleViewAction()->setIcon(QIcon(":/images/dqynight.png"));
toolsMenu->insertAction(settingsAction ,_WaterPoolDialog->toggleViewAction()); ovMenu->insertAction(settingsAction ,_WaterPoolDialog->toggleViewAction());
_WaterPoolDialog->toggleViewAction()->setIcon(QIcon(":/images/water.png")); _WaterPoolDialog->toggleViewAction()->setIcon(QIcon(":/images/water.png"));
_WaterPoolDialog->toggleViewAction()->setEnabled(false); _WaterPoolDialog->toggleViewAction()->setEnabled(false);
toolsMenu->insertAction(settingsAction ,_VegetableDialog->toggleViewAction()); ovMenu->insertAction(settingsAction ,_VegetableDialog->toggleViewAction());
_VegetableDialog->toggleViewAction()->setIcon(QIcon(":/images/veget.png")); _VegetableDialog->toggleViewAction()->setIcon(QIcon(":/images/veget.png"));
toolsMenu->insertAction(settingsAction ,_GlobalWindDialog->toggleViewAction()); ovMenu->insertAction(settingsAction ,_GlobalWindDialog->toggleViewAction());
_GlobalWindDialog->toggleViewAction()->setIcon(QIcon(":/images/wind.png")); _GlobalWindDialog->toggleViewAction()->setIcon(QIcon(":/images/wind.png"));
toolsMenu->insertAction(settingsAction ,_SkeletonScaleDialog->toggleViewAction()); ovMenu->insertAction(settingsAction ,_SkeletonScaleDialog->toggleViewAction());
_SkeletonScaleDialog->toggleViewAction()->setIcon(QIcon(":/images/ico_skelscale.png")); _SkeletonScaleDialog->toggleViewAction()->setIcon(QIcon(":/images/ico_skelscale.png"));
toolsMenu->insertAction(settingsAction ,_TuneTimerDialog->toggleViewAction()); ovMenu->insertAction(settingsAction ,_TuneTimerDialog->toggleViewAction());
_TuneTimerDialog->toggleViewAction()->setIcon(QIcon(":/images/ico_framedelay.png")); _TuneTimerDialog->toggleViewAction()->setIcon(QIcon(":/images/ico_framedelay.png"));
toolsMenu->insertAction(settingsAction ,_SunColorDialog->toggleViewAction()); ovMenu->insertAction(settingsAction ,_SunColorDialog->toggleViewAction());
toolsMenu->insertAction(settingsAction ,_TuneMRMDialog->toggleViewAction()); ovMenu->insertAction(settingsAction ,_TuneMRMDialog->toggleViewAction());
_TuneMRMDialog->toggleViewAction()->setIcon(QIcon(":/images/ico_mrm_mesh.png")); _TuneMRMDialog->toggleViewAction()->setIcon(QIcon(":/images/ico_mrm_mesh.png"));
connect(_ParticleControlDialog->toggleViewAction(), SIGNAL(triggered(bool)), connect(_ParticleControlDialog->toggleViewAction(), SIGNAL(triggered(bool)),
@ -355,7 +359,7 @@ void CMainWindow::createMenus()
connect(_ParticleControlDialog->toggleViewAction(), SIGNAL(triggered(bool)), connect(_ParticleControlDialog->toggleViewAction(), SIGNAL(triggered(bool)),
_ParticleWorkspaceDialog->_PropertyDialog, SLOT(setVisible(bool))); _ParticleWorkspaceDialog->_PropertyDialog, SLOT(setVisible(bool)));
toolsMenu->insertAction(settingsAction ,_settingsAction); ovMenu->insertAction(settingsAction ,_settingsAction);
toolsMenu->insertSeparator(settingsAction); toolsMenu->insertSeparator(settingsAction);
} }
@ -367,7 +371,7 @@ void CMainWindow::createToolBars()
//_viewToolBar = addToolBar(tr("&Edit")); //_viewToolBar = addToolBar(tr("&Edit"));
_toolsBar = addToolBar(tr("&Tools")); _toolsBar = addToolBar(tr("&Tools"));
_toolsBar->addAction(_setBackColorAction); _toolsBar->addAction(_setBackColorAction);
_toolsBar->addSeparator(); _toolsBar->addSeparator();