1 // Object Viewer Qt - BNP Manager Plugin - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2011 Roland WINKLMEIER <roland.m.winklmeier@gmail.com>
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2014 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Affero General Public License as
9 // published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Affero General Public License for more details.
17 // You should have received a copy of the GNU Affero General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #include "bnp_manager_plugin.h"
22 #include "bnp_manager_window.h"
24 #include "../core/icore.h"
25 #include "../core/core_constants.h"
26 #include "../core/menu_manager.h"
29 #include "nel/misc/debug.h"
32 #include <QtCore/QObject>
33 #include <QtGui/QMainWindow>
38 BNPManagerPlugin::BNPManagerPlugin()
42 BNPManagerPlugin::~BNPManagerPlugin()
44 Q_FOREACH(QObject
*obj
, m_autoReleaseObjects
)
46 m_plugMan
->removeObject(obj
);
48 qDeleteAll(m_autoReleaseObjects
);
49 m_autoReleaseObjects
.clear();
55 bool BNPManagerPlugin::initialize(ExtensionSystem::IPluginManager
*pluginManager
, QString
*errorString
)
57 Q_UNUSED(errorString
);
58 m_plugMan
= pluginManager
;
60 addAutoReleasedObject(new BNPManagerContext(this));
64 void BNPManagerPlugin::extensionsInitialized()
68 void BNPManagerPlugin::shutdown()
73 void BNPManagerPlugin::setNelContext(NLMISC::INelContext
*nelContext
)
76 // Ensure that a context doesn't exist yet.
77 // This only applies to platforms without PIC, e.g. Windows.
78 nlassert(!NLMISC::INelContext::isContextInitialised());
79 #endif // NL_OS_WINDOWS
80 m_libContext
= new NLMISC::CLibraryContext(*nelContext
);
83 void BNPManagerPlugin::addAutoReleasedObject(QObject
*obj
)
85 m_plugMan
->addObject(obj
);
86 m_autoReleaseObjects
.prepend(obj
);
89 /*void BNPManagerContext::open()
91 m_BnpManagerWindow->open();
95 Q_EXPORT_PLUGIN(BNPManager::BNPManagerPlugin
)