Ref T609, encapsulate PTT action/key

This commit is contained in:
Klaus Basan
2019-04-18 00:58:19 +02:00
parent c69a833598
commit 13a2465424
7 changed files with 63 additions and 20 deletions

View File

@@ -14,6 +14,7 @@
#include "blackcore/actionbind.h"
#include "blackcore/network.h"
#include "blackgui/blackguiexport.h"
#include "blackmisc/input/actionhotkeydefs.h"
#include <QFrame>
#include <QObject>
@@ -58,7 +59,7 @@ namespace BlackGui
private:
QScopedPointer<Ui::CInfoBarStatusComponent> ui;
BlackCore::CActionBind m_actionPtt { "/Voice/Activate push-to-talk", BlackMisc::CIcons::radio16(), this, &CInfoBarStatusComponent::onPttChanged };
BlackCore::CActionBind m_actionPtt { BlackMisc::Input::pttHotkeyAction(), BlackMisc::Input::pttHotkeyIcon(), this, &CInfoBarStatusComponent::onPttChanged };
BlackMisc::CDigestSignal m_dsResize { this, &CInfoBarStatusComponent::adjustTextSize, 1000, 50 };
//! Init the LEDs

View File

@@ -13,6 +13,7 @@
#include "blackcore/context/contextapplication.h"
#include "blackcore/context/contextaudio.h"
#include "blackcore/inputmanager.h"
#include "blackmisc/input/actionhotkeydefs.h"
#include "ui_settingshotkeycomponent.h"
#include <QAbstractItemModel>
@@ -67,7 +68,7 @@ namespace BlackGui
void CSettingsHotkeyComponent::registerDummyPttEntry()
{
Q_ASSERT_X(sApp && sApp->getInputManager(), Q_FUNC_INFO, "Missing input manager");
sApp->getInputManager()->registerAction(IContextAudio::pttHotkeyAction(), IContextAudio::pttHotkeyIcon());
sApp->getInputManager()->registerAction(pttHotkeyAction(), pttHotkeyIcon());
}
void CSettingsHotkeyComponent::addEntry()