refs #927, linked button with component

This commit is contained in:
Klaus Basan
2017-04-02 22:26:52 +02:00
committed by Mathew Sutcliffe
parent 81caa32003
commit 6863bf2937
4 changed files with 15 additions and 7 deletions

View File

@@ -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

View File

@@ -14,14 +14,12 @@
#include "blackgui/blackguiexport.h"
#include "blackgui/components/enablefordockwidgetinfoarea.h"
#include <QObject>
#include <QScopedPointer>
#include <QSize>
#include <QWidget>
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

View File

@@ -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

View File

@@ -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);