diff --git a/src/blackgui/components/cockpitcomponent.cpp b/src/blackgui/components/cockpitcomponent.cpp index 6fecc2245..3e4afda1c 100644 --- a/src/blackgui/components/cockpitcomponent.cpp +++ b/src/blackgui/components/cockpitcomponent.cpp @@ -55,6 +55,11 @@ namespace BlackGui ui->comp_CockpitComComponent->setSelectedTransponderModeStateIdent(); } + void CCockpitComponent::showAudio() + { + ui->comp_CockpitInfoArea->selectArea(CCockpitInfoAreaComponent::InfoAreaAudio); + } + void CCockpitComponent::ps_onToggleShowHideDetails(bool show) { // use the toggle method to set the sizes diff --git a/src/blackgui/components/cockpitcomponent.h b/src/blackgui/components/cockpitcomponent.h index 1a68f154f..fbabd3e38 100644 --- a/src/blackgui/components/cockpitcomponent.h +++ b/src/blackgui/components/cockpitcomponent.h @@ -14,14 +14,12 @@ #include "blackgui/blackguiexport.h" #include "blackgui/components/enablefordockwidgetinfoarea.h" - #include #include #include #include namespace Ui { class CCockpitComponent; } - namespace BlackGui { class CDockWidgetInfoArea; @@ -40,7 +38,7 @@ namespace BlackGui explicit CCockpitComponent(QWidget *parent = nullptr); //! Destructor - ~CCockpitComponent(); + virtual ~CCockpitComponent(); //! \copydoc CEnableForDockWidgetInfoArea::setParentDockWidgetInfoArea virtual bool setParentDockWidgetInfoArea(BlackGui::CDockWidgetInfoArea *parentDockableWidget) override; @@ -52,6 +50,9 @@ namespace BlackGui //! \copydoc BlackGui::Components::CTransponderModeSelector::setSelectedTransponderModeStateIdent void setSelectedTransponderModeStateIdent(); + //! Show the audio ui + void showAudio(); + private slots: //! Show or hide cockpit details void ps_onToggleShowHideDetails(bool show); @@ -68,9 +69,7 @@ namespace BlackGui QSize m_sizeFloatingHidden; //! size when info area is hidden int m_minHeightInfoArea = -1; //! minimum height of the info area }; - } // namespace } // namespace - #endif // guard diff --git a/src/blackgui/components/cockpitinfoareacomponent.h b/src/blackgui/components/cockpitinfoareacomponent.h index d4366a005..236cd7b8c 100644 --- a/src/blackgui/components/cockpitinfoareacomponent.h +++ b/src/blackgui/components/cockpitinfoareacomponent.h @@ -23,7 +23,6 @@ class QPixmap; class QWidget; namespace Ui { class CCockpitInfoAreaComponent; } - namespace BlackGui { namespace Components @@ -39,7 +38,7 @@ namespace BlackGui explicit CCockpitInfoAreaComponent(QWidget *parent = nullptr); //! Destructor - ~CCockpitInfoAreaComponent(); + virtual ~CCockpitInfoAreaComponent(); //! Info areas enum InfoArea diff --git a/src/swiftguistandard/swiftguistdinit.cpp b/src/swiftguistandard/swiftguistdinit.cpp index 569c76155..905d27ac6 100644 --- a/src/swiftguistandard/swiftguistdinit.cpp +++ b/src/swiftguistandard/swiftguistdinit.cpp @@ -189,6 +189,11 @@ void SwiftGuiStd::initGuiSignals() connect(ui->comp_MainKeypadArea, &CMainKeypadAreaComponent::identPressed, ui->comp_MainInfoArea->getCockpitComponent(), &CCockpitComponent::setSelectedTransponderModeStateIdent); connect(ui->comp_MainKeypadArea, &CMainKeypadAreaComponent::commandEntered, ui->comp_MainInfoArea->getTextMessageComponent(), &CTextMessageComponent::handleGlobalCommandLine); connect(ui->comp_MainInfoArea, &CMainInfoAreaComponent::changedInfoAreaStatus, ui->comp_MainKeypadArea, &CMainKeypadAreaComponent::onMainInfoAreaChanged); + connect(ui->comp_MainKeypadArea, &CMainKeypadAreaComponent::audioPressed, [ = ] + { + ui->comp_MainInfoArea->getCockpitComponent()->showAudio(); + ui->comp_MainInfoArea->selectArea(CMainInfoAreaComponent::InfoAreaCockpit); + }); // menu connect(ui->menu_TestLocationsEDDF, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);