refs #313 Application context acts as com layer between settings and InputManager

This commit is contained in:
Roland Winklmeier
2014-08-04 20:40:30 +02:00
parent 88e7a38796
commit 1adfd16ec9
3 changed files with 29 additions and 3 deletions

View File

@@ -1,11 +1,14 @@
#include "blackcore/context_application.h"
#include "blackcore/context_application_impl.h"
#include "blackcore/context_application_proxy.h"
#include "blackcore/context_settings.h"
#include "blackcore/input_manager.h"
#include "blackmisc/statusmessage.h"
#include <QCoreApplication>
#include <QThread>
using namespace BlackMisc;
using namespace BlackMisc::Settings;
namespace BlackCore
{
@@ -57,6 +60,8 @@ namespace BlackCore
IContextApplication::s_oldHandler = qInstallMessageHandler(IContextApplication::messageHandlerDispatch);
}
IContextApplication::s_contexts.append(this);
changeSettings(IContextSettings::SettingsHotKeys);
}
/*
@@ -81,6 +86,22 @@ namespace BlackCore
qInstallMessageHandler(0);
}
void IContextApplication::changeSettings(uint typeValue)
{
IContextSettings::SettingsType type = static_cast<IContextSettings::SettingsType>(typeValue);
switch (type)
{
case IContextSettings::SettingsHotKeys:
{
CSettingKeyboardHotkeyList hotkeys = getIContextSettings()->getHotkeys();
CInputManager::getInstance()->changeHotkeySettings(hotkeys);
break;
}
default:
break;
}
}
/*
* Dispatch message
*/