diff --git a/src/blackcore/context_audio_impl.h b/src/blackcore/context_audio_impl.h index e825b3da7..c26e316a2 100644 --- a/src/blackcore/context_audio_impl.h +++ b/src/blackcore/context_audio_impl.h @@ -21,6 +21,7 @@ #include "voice_channel.h" #include "audio_device.h" #include "audio_mixer.h" +#include "actionbind.h" #include "blackinput/keyboard.h" #include "blackmisc/audio/voiceroomlist.h" @@ -153,6 +154,7 @@ namespace BlackCore QSharedPointer getVoiceChannelBy(const BlackMisc::Audio::CVoiceRoom &voiceRoom); + CActionBind m_actionPtt { "/Voice/Activate push-to-talk", this, &CContextAudio::ps_setVoiceTransmission }; std::unique_ptr m_voice; //!< underlying voice lib std::unique_ptr m_audioMixer; diff --git a/src/blackgui/components/settingshotkeycomponent.cpp b/src/blackgui/components/settingshotkeycomponent.cpp index ec4bf5e3c..31cf26aa1 100644 --- a/src/blackgui/components/settingshotkeycomponent.cpp +++ b/src/blackgui/components/settingshotkeycomponent.cpp @@ -134,5 +134,9 @@ namespace BlackGui return true; } + void CSettingsHotkeyComponent::ps_hotkeySlot(bool keyDown) + { + if (keyDown) QMessageBox::information(this, "Test", "Push-To-Talk"); + } } // ns } // ns diff --git a/src/blackgui/components/settingshotkeycomponent.h b/src/blackgui/components/settingshotkeycomponent.h index fcd3ce710..d2720da14 100644 --- a/src/blackgui/components/settingshotkeycomponent.h +++ b/src/blackgui/components/settingshotkeycomponent.h @@ -15,7 +15,7 @@ #include "blackgui/models/actionhotkeylistmodel.h" #include "blackgui/components/enableforruntime.h" #include "blackcore/settings/application.h" - +#include "blackcore/actionbind.h" #include namespace Ui { @@ -55,6 +55,7 @@ namespace BlackGui QScopedPointer ui; BlackGui::Models::CActionHotkeyListModel m_model; BlackCore::CSetting m_actionHotkeys { this }; + BlackCore::CActionBind m_action { "/Test/Message", this, &CSettingsHotkeyComponent::ps_hotkeySlot }; void ps_hotkeySlot(bool keyDown); }; diff --git a/src/swiftgui_standard/swiftguistd.h b/src/swiftgui_standard/swiftguistd.h index 97653eac0..888547aa3 100644 --- a/src/swiftgui_standard/swiftguistd.h +++ b/src/swiftgui_standard/swiftguistd.h @@ -18,6 +18,7 @@ #include "guimodeenums.h" #include "blackcore/context_all_interfaces.h" +#include "blackcore/actionbind.h" #include "blackgui/components/enableforruntime.h" #include "blackgui/components/infowindowcomponent.h" #include "blackgui/components/maininfoareacomponent.h" @@ -126,6 +127,10 @@ private: QString m_transponderResetValue; //!< Temp. storage of XPdr mode to reset, req. until timer allows singleShoot with Lambdas QWidget *m_inputFocusedWidget = nullptr; //!< currently used widget for input, mainly used with cockpit + // actions + BlackCore::CActionBind m_action50 { "/swiftGui/Change opacity to 50%", this, &SwiftGuiStd::ps_onChangedWindowOpacityTo50 }; + BlackCore::CActionBind m_action100 { "/swiftGui/Change opacity to 100%", this, &SwiftGuiStd::ps_onChangedWindowOpacityTo100 }; + //! GUI status update void updateGuiStatusInformation(); @@ -224,6 +229,12 @@ private slots: //! Update timer void ps_handleTimerBasedUpdates(); + //! Change opacity 0-100 + void ps_onChangedWindowOpacityTo50(bool) { ps_onChangedWindowOpacity(50); } + + //! Change opacity 0-100 + void ps_onChangedWindowOpacityTo100(bool) { ps_onChangedWindowOpacity(100); } + //! Change opacity 0-100 void ps_onChangedWindowOpacity(int opacity = -1);