|
|
|
@ -15,42 +15,42 @@ GNU General Public License for more details.
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "log_plugin.h"
|
|
|
|
|
#include "log_settings_page.h"
|
|
|
|
|
|
|
|
|
|
// Qt includes
|
|
|
|
|
#include <QtCore/QObject>
|
|
|
|
|
#include <QtGui/QMessageBox>
|
|
|
|
|
#include <QtGui/QMainWindow>
|
|
|
|
|
#include <QtGui/QMenu>
|
|
|
|
|
#include <QtGui/QAction>
|
|
|
|
|
#include <QtGui/QMenuBar>
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "log_plugin.h"
|
|
|
|
|
#include "log_settings_page.h"
|
|
|
|
|
|
|
|
|
|
// Qt includes
|
|
|
|
|
#include <QtCore/QObject>
|
|
|
|
|
#include <QtGui/QMessageBox>
|
|
|
|
|
#include <QtGui/QMainWindow>
|
|
|
|
|
#include <QtGui/QMenu>
|
|
|
|
|
#include <QtGui/QAction>
|
|
|
|
|
#include <QtGui/QMenuBar>
|
|
|
|
|
#include <QtGui/QWidget>
|
|
|
|
|
#include <QFile>
|
|
|
|
|
#include <QDateTime>
|
|
|
|
|
#include <QTextStream>
|
|
|
|
|
|
|
|
|
|
#include <QTextStream>
|
|
|
|
|
|
|
|
|
|
// NeL includes
|
|
|
|
|
#include <nel/misc/debug.h>
|
|
|
|
|
|
|
|
|
|
// Project includes
|
|
|
|
|
#include "../../extension_system/iplugin_spec.h"
|
|
|
|
|
#include "qt_displayer.h"
|
|
|
|
|
|
|
|
|
|
using namespace Plugin;
|
|
|
|
|
|
|
|
|
|
namespace ExtensionSystem
|
|
|
|
|
{
|
|
|
|
|
class IPluginSpec;
|
|
|
|
|
}
|
|
|
|
|
#include "qt_displayer.h"
|
|
|
|
|
|
|
|
|
|
using namespace Plugin;
|
|
|
|
|
|
|
|
|
|
namespace ExtensionSystem
|
|
|
|
|
{
|
|
|
|
|
class IPluginSpec;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CLogPlugin::CLogPlugin(QWidget *parent): QDockWidget(parent)
|
|
|
|
|
{
|
|
|
|
|
_ui.setupUi(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CLogPlugin::~CLogPlugin()
|
|
|
|
|
{
|
|
|
|
|
NLMISC::ErrorLog->removeDisplayer(_displayer);
|
|
|
|
@ -98,7 +98,7 @@ void CLogPlugin::setNelContext(NLMISC::INelContext *nelContext)
|
|
|
|
|
// Ensure that a context doesn't exist yet.
|
|
|
|
|
// This only applies to platforms without PIC, e.g. Windows.
|
|
|
|
|
nlassert(!NLMISC::INelContext::isContextInitialised());
|
|
|
|
|
#endif // fdef NL_OS_WINDOWS^M
|
|
|
|
|
#endif // fdef NL_OS_WINDOWS^M
|
|
|
|
|
_LibContext = new NLMISC::CLibraryContext(*nelContext);
|
|
|
|
|
|
|
|
|
|
_displayer = new NLQT::CQtDisplayer(_ui.plainTextEdit);
|
|
|
|
@ -120,30 +120,30 @@ QString CLogPlugin::vendor() const
|
|
|
|
|
return "aquiles";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString CLogPlugin::description() const
|
|
|
|
|
QString CLogPlugin::description() const
|
|
|
|
|
{
|
|
|
|
|
return "DockWidget to display all log messages from NeL.";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QList<QString> CLogPlugin::dependencies() const
|
|
|
|
|
{
|
|
|
|
|
return QList<QString>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QObject* CLogPlugin::objectByName(const QString &name) const
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
QList<QString> CLogPlugin::dependencies() const
|
|
|
|
|
{
|
|
|
|
|
return QList<QString>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QObject* CLogPlugin::objectByName(const QString &name) const
|
|
|
|
|
{
|
|
|
|
|
Q_FOREACH (QObject *qobj, _plugMan->allObjects())
|
|
|
|
|
if (qobj->objectName() == name)
|
|
|
|
|
return qobj;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ExtensionSystem::IPluginSpec *CLogPlugin::pluginByName(const QString &name) const
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ExtensionSystem::IPluginSpec *CLogPlugin::pluginByName(const QString &name) const
|
|
|
|
|
{
|
|
|
|
|
Q_FOREACH (ExtensionSystem::IPluginSpec *spec, _plugMan->plugins())
|
|
|
|
|
if (spec->name() == name)
|
|
|
|
|
return spec;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Q_EXPORT_PLUGIN(CLogPlugin)
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Q_EXPORT_PLUGIN(CLogPlugin)
|
|
|
|
|