From 31f1d3af169068671914ad476fa912189e5cf5f2 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Wed, 7 May 2014 00:53:07 +0200 Subject: [PATCH] Same as before... --- .hgignore | 1 - code/studio/src/plugins/core/core.cpp | 77 +++++++++++++++++++++++++++ code/studio/src/plugins/core/core.h | 54 +++++++++++++++++++ code/studio/src/plugins/core/core.qrc | 21 ++++++++ 4 files changed, 152 insertions(+), 1 deletion(-) create mode 100644 code/studio/src/plugins/core/core.cpp create mode 100644 code/studio/src/plugins/core/core.h create mode 100644 code/studio/src/plugins/core/core.qrc diff --git a/.hgignore b/.hgignore index 5587652fd..6b7285bac 100644 --- a/.hgignore +++ b/.hgignore @@ -43,7 +43,6 @@ default_c *.so *.so.* *_debug -core.* *.pc *.gch diff --git a/code/studio/src/plugins/core/core.cpp b/code/studio/src/plugins/core/core.cpp new file mode 100644 index 000000000..b21d934c8 --- /dev/null +++ b/code/studio/src/plugins/core/core.cpp @@ -0,0 +1,77 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. +// +// 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 "core.h" +#include "context_manager.h" +#include "main_window.h" +#include "../../extension_system/iplugin_manager.h" + +static Core::CoreImpl *m_coreInstance = 0; + +namespace Core +{ + +ICore *ICore::instance() +{ + return m_coreInstance; +} + +CoreImpl::CoreImpl(MainWindow *mainWindow) +{ + m_mainWindow = mainWindow; + m_coreInstance = this; +} + +CoreImpl::~CoreImpl() +{ + m_coreInstance = 0; +} + +bool CoreImpl::showOptionsDialog(const QString &group, + const QString &page, + QWidget *parent) +{ + return m_mainWindow->showOptionsDialog(group, page, parent); +} + +MenuManager *CoreImpl::menuManager() const +{ + return m_mainWindow->menuManager(); +} + +ContextManager *CoreImpl::contextManager() const +{ + return m_mainWindow->contextManager(); +} + +QSettings *CoreImpl::settings() const +{ + return m_mainWindow->settings(); +} + +QMainWindow *CoreImpl::mainWindow() const +{ + return m_mainWindow; +} + +ExtensionSystem::IPluginManager *CoreImpl::pluginManager() const +{ + return m_mainWindow->pluginManager(); +} + +} // namespace Core diff --git a/code/studio/src/plugins/core/core.h b/code/studio/src/plugins/core/core.h new file mode 100644 index 000000000..f34dd6ae6 --- /dev/null +++ b/code/studio/src/plugins/core/core.h @@ -0,0 +1,54 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. +// +// 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 CORE_H +#define CORE_H + +#include "icore.h" + +namespace Core +{ +class MainWindow; + +class CoreImpl : public ICore +{ + Q_OBJECT + +public: + explicit CoreImpl(MainWindow *mainWindow); + virtual ~CoreImpl(); + + virtual bool showOptionsDialog(const QString &group = QString(), + const QString &page = QString(), + QWidget *parent = 0); + + virtual MenuManager *menuManager() const; + virtual ContextManager *contextManager() const; + + virtual QSettings *settings() const; + virtual QMainWindow *mainWindow() const; + + virtual ExtensionSystem::IPluginManager *pluginManager() const; +private: + MainWindow *m_mainWindow; + friend class MainWindow; +}; + +} // namespace Core + +#endif // CORE_H diff --git a/code/studio/src/plugins/core/core.qrc b/code/studio/src/plugins/core/core.qrc new file mode 100644 index 000000000..68b6ad141 --- /dev/null +++ b/code/studio/src/plugins/core/core.qrc @@ -0,0 +1,21 @@ + + + icons/ic_nel_add_item.png + icons/ic_nel_redo.png + icons/ic_nel_undo.png + icons/ic_nel_crash.png + icons/ic_nel_delete_item.png + icons/ic_nel_down_item.png + icons/ic_nel_generic_settings.png + icons/ic_nel_open.png + icons/ic_nel_new.png + icons/ic_nel_save.png + icons/ic_nel_save_as.png + icons/ic_nel_path_settings.png + icons/ic_nel_pill.png + icons/ic_nel_reset_all.png + icons/ic_nel_up_item.png + images/nel.png + images/preferences.png + +