diff --git a/src/blackcore/context_application.cpp b/src/blackcore/context_application.cpp index 7f495bc9d..d35ef9c7b 100644 --- a/src/blackcore/context_application.cpp +++ b/src/blackcore/context_application.cpp @@ -59,7 +59,6 @@ namespace BlackCore CSettingsCache::instance()->changeValuesFromRemote(settings, origin); }); - changeSettings(IContextSettings::SettingsHotKeys); bool s = connect(CInputManager::instance(), &CInputManager::hotkeyActionRegistered, [this](const QStringList &actions) { this->registerHotkeyActions(actions, {}); @@ -110,18 +109,7 @@ namespace BlackCore void IContextApplication::changeSettings(uint typeValue) { - auto type = static_cast(typeValue); - switch (type) - { - case IContextSettings::SettingsHotKeys: - { - CSettingKeyboardHotkeyList hotkeys = getIContextSettings()->getHotkeys(); - CInputManager::getInstance()->changeHotkeySettings(hotkeys); - break; - } - default: - break; - } + Q_UNUSED(typeValue); } } // namespace diff --git a/src/blackcore/context_application.h b/src/blackcore/context_application.h index 790beb870..9d7f5cce8 100644 --- a/src/blackcore/context_application.h +++ b/src/blackcore/context_application.h @@ -136,6 +136,7 @@ namespace BlackCore virtual bool existsFile(const QString &fileName) const = 0; //! Change settings + //! \todo Remove with old settings void changeSettings(uint typeValue); }; diff --git a/src/blackcore/context_settings.h b/src/blackcore/context_settings.h index 9d38b91be..98e2f344e 100644 --- a/src/blackcore/context_settings.h +++ b/src/blackcore/context_settings.h @@ -16,7 +16,6 @@ #include "blackcore/context.h" #include "blackcore/dbus_server.h" #include "blackinput/keyboard.h" -#include "blackmisc/setkeyboardhotkeylist.h" #include "blackmisc/statusmessagelist.h" #include "blackmisc/dbus.h" #include "blackmisc/variant.h" @@ -48,7 +47,6 @@ namespace BlackCore //! Settings type enum SettingsType { - SettingsHotKeys, SettingsNetwork, SettingsAudio, SettingsSimulator @@ -91,13 +89,6 @@ namespace BlackCore return s; } - //! Path for hotkeys - static const QString &PathHotkeys() - { - static QString s("hotkeys"); - return s; - } - //! Factory method static IContextSettings *create(CRuntime *parent, CRuntimeConfig::ContextMode mode, CDBusServer *server, QDBusConnection &conn); @@ -116,9 +107,6 @@ namespace BlackCore //! Audio settings virtual BlackMisc::Settings::CSettingsAudio getAudioSettings() const = 0; - //! Hotkeys - virtual BlackMisc::Settings::CSettingKeyboardHotkeyList getHotkeys() const = 0; - //! Save settings virtual BlackMisc::CStatusMessage write() const = 0; diff --git a/src/blackcore/context_settings_impl.cpp b/src/blackcore/context_settings_impl.cpp index 61d820dbf..7baa531b3 100644 --- a/src/blackcore/context_settings_impl.cpp +++ b/src/blackcore/context_settings_impl.cpp @@ -14,7 +14,7 @@ using namespace BlackMisc; using namespace BlackMisc::Settings; -using namespace BlackMisc::Hardware; +using namespace BlackMisc::Input; namespace BlackCore { @@ -57,15 +57,6 @@ namespace BlackCore this->m_settingsAudio.initDefaultValues(); } - // init own members - if (jsonObject.contains(IContextSettings::PathHotkeys())) - { - this->m_hotkeys.convertFromJson( - jsonObject.value(IContextSettings::PathHotkeys()).toObject() - ); - } - this->m_hotkeys.initAsHotkeyList(false); // update missing parts - if (ok) { return CStatusMessage(CStatusMessage::SeverityInfo, QString("Read settings: %1").arg(this->getSettingsFileName())); @@ -108,7 +99,6 @@ namespace BlackCore */ CStatusMessage CContextSettings::reset(bool write) { - this->m_hotkeys.initAsHotkeyList(true); this->m_settingsAudio.initDefaultValues(); this->emitCompletelyChanged(); if (write) @@ -134,7 +124,6 @@ namespace BlackCore { QJsonObject jsonObject; jsonObject.insert(IContextSettings::PathAudioSettings(), this->m_settingsAudio.toJson()); - jsonObject.insert(IContextSettings::PathHotkeys(), this->m_hotkeys.toJson()); QJsonDocument doc(jsonObject); return doc; } @@ -144,20 +133,11 @@ namespace BlackCore */ void CContextSettings::emitCompletelyChanged() { - emit this->changedSettings(IContextSettings::SettingsHotKeys); emit this->changedSettings(IContextSettings::SettingsNetwork); emit this->changedSettings(IContextSettings::SettingsAudio); emit this->changedSettings(IContextSettings::SettingsSimulator); } - /* - * Hotkeys - */ - CSettingKeyboardHotkeyList CContextSettings::getHotkeys() const - { - return this->m_hotkeys; - } - /* * Audio settings */ @@ -177,17 +157,6 @@ namespace BlackCore BlackMisc::CStatusMessageList msgs; if (path.contains(IContextSettings::PathRoot())) { - if (path.contains(IContextSettings::PathHotkeys())) - { - if (command == CSettingUtilities::CmdUpdate()) - { - auto hotkeys = value.value(); - this->m_hotkeys = hotkeys; - msgs.push_back(this->write()); // write settings - emit this->changedSettings(static_cast(SettingsHotKeys)); - return msgs; - } - } } // next level diff --git a/src/blackcore/context_settings_impl.h b/src/blackcore/context_settings_impl.h index 1fc314dc5..05ebf3807 100644 --- a/src/blackcore/context_settings_impl.h +++ b/src/blackcore/context_settings_impl.h @@ -19,7 +19,6 @@ #include "blackcore/settingsallclasses.h" #include "blackmisc/statusmessagelist.h" -#include "blackmisc/hardware/keyboardkeylist.h" namespace BlackCore { @@ -57,9 +56,6 @@ namespace BlackCore //! \copydoc IContextSettings::getAudioSettings() virtual BlackMisc::Settings::CSettingsAudio getAudioSettings() const override; - //! \copydoc IContextSettings::getHotkeys() - virtual BlackMisc::Settings::CSettingKeyboardHotkeyList getHotkeys() const override; - //! read settings virtual BlackMisc::CStatusMessage read() override; @@ -80,7 +76,6 @@ namespace BlackCore const QString &getSettingsDirectory() const { return BlackMisc::Settings::CSettingUtilities::getSettingsDirectory(); } BlackMisc::Settings::CSettingsAudio m_settingsAudio; - BlackMisc::Settings::CSettingKeyboardHotkeyList m_hotkeys; QJsonDocument toJsonDocument() const; void emitCompletelyChanged(); }; diff --git a/src/blackcore/context_settings_proxy.cpp b/src/blackcore/context_settings_proxy.cpp index 6c8c2d298..41180dc87 100644 --- a/src/blackcore/context_settings_proxy.cpp +++ b/src/blackcore/context_settings_proxy.cpp @@ -14,7 +14,7 @@ using namespace BlackMisc; using namespace BlackMisc::Settings; using namespace BlackMisc::Network; -using namespace BlackMisc::Hardware; +using namespace BlackMisc::Input; namespace BlackCore { @@ -49,14 +49,6 @@ namespace BlackCore return this->m_dBusInterface->callDBusRet(QLatin1Literal("getAudioSettings")); } - /* - * Relay to DBus - */ - CSettingKeyboardHotkeyList CContextSettingsProxy::getHotkeys() const - { - return this->m_dBusInterface->callDBusRet(QLatin1Literal("getHotkeys")); - } - /* * Relay to DBus, but make this no slot */ diff --git a/src/blackcore/context_settings_proxy.h b/src/blackcore/context_settings_proxy.h index 1b420800e..f82343df1 100644 --- a/src/blackcore/context_settings_proxy.h +++ b/src/blackcore/context_settings_proxy.h @@ -12,7 +12,6 @@ #include "blackmisc/statusmessagelist.h" #include "blackmisc/genericdbusinterface.h" #include "blackmisc/settingutilities.h" -#include "blackmisc/hardware/keyboardkeylist.h" namespace BlackCore { @@ -46,9 +45,6 @@ namespace BlackCore //! \copydoc IContextSettings::getAudioSettings() virtual BlackMisc::Settings::CSettingsAudio getAudioSettings() const override; - //! \copydoc IContextSettings::getHotkeys() - virtual BlackMisc::Settings::CSettingKeyboardHotkeyList getHotkeys() const override; - //! \copydoc IContextSettings::value virtual BlackMisc::CStatusMessageList value(const QString &path, const QString &command, const BlackMisc::CVariant &value) override; diff --git a/src/swiftgui_standard/swiftguistd.cpp b/src/swiftgui_standard/swiftguistd.cpp index 8244a572c..05e13b172 100644 --- a/src/swiftgui_standard/swiftguistd.cpp +++ b/src/swiftgui_standard/swiftguistd.cpp @@ -262,12 +262,6 @@ void SwiftGuiStd::ps_displayStatusMessageInGui(const CStatusMessage &statusMessa } } -void SwiftGuiStd::ps_onChangedSetttings(uint typeValue) -{ - IContextSettings::SettingsType type = static_cast(typeValue); - if (type == IContextSettings::SettingsHotKeys) this->ps_registerHotkeyFunctions(); -} - void SwiftGuiStd::ps_onConnectionTerminated() { this->updateGuiStatusInformation(); diff --git a/src/swiftgui_standard/swiftguistd.h b/src/swiftgui_standard/swiftguistd.h index 0760c1936..97653eac0 100644 --- a/src/swiftgui_standard/swiftguistd.h +++ b/src/swiftgui_standard/swiftguistd.h @@ -26,7 +26,6 @@ #include "blackgui/models/serverlistmodel.h" #include "blackgui/models/userlistmodel.h" #include "blackgui/models/statusmessagelistmodel.h" -#include "blackgui/models/keyboardkeylistmodel.h" #include "blackgui/enableforframelesswindow.h" #include "blackgui/managedstatusbar.h" #include "blackmisc/network/textmessage.h" @@ -195,9 +194,6 @@ private slots: //! Display status message void ps_displayStatusMessageInGui(const BlackMisc::CStatusMessage &); - //! Settings have been changed - void ps_onChangedSetttings(uint typeValue); - //! Connection status changed //! \param from old status, as int so it is compliant with DBus //! \param to new status, as int so it is compliant with DBus