mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
refs #927, linked button with component
This commit is contained in:
committed by
Mathew Sutcliffe
parent
81caa32003
commit
6863bf2937
@@ -55,6 +55,11 @@ namespace BlackGui
|
|||||||
ui->comp_CockpitComComponent->setSelectedTransponderModeStateIdent();
|
ui->comp_CockpitComComponent->setSelectedTransponderModeStateIdent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CCockpitComponent::showAudio()
|
||||||
|
{
|
||||||
|
ui->comp_CockpitInfoArea->selectArea(CCockpitInfoAreaComponent::InfoAreaAudio);
|
||||||
|
}
|
||||||
|
|
||||||
void CCockpitComponent::ps_onToggleShowHideDetails(bool show)
|
void CCockpitComponent::ps_onToggleShowHideDetails(bool show)
|
||||||
{
|
{
|
||||||
// use the toggle method to set the sizes
|
// use the toggle method to set the sizes
|
||||||
|
|||||||
@@ -14,14 +14,12 @@
|
|||||||
|
|
||||||
#include "blackgui/blackguiexport.h"
|
#include "blackgui/blackguiexport.h"
|
||||||
#include "blackgui/components/enablefordockwidgetinfoarea.h"
|
#include "blackgui/components/enablefordockwidgetinfoarea.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QScopedPointer>
|
#include <QScopedPointer>
|
||||||
#include <QSize>
|
#include <QSize>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
namespace Ui { class CCockpitComponent; }
|
namespace Ui { class CCockpitComponent; }
|
||||||
|
|
||||||
namespace BlackGui
|
namespace BlackGui
|
||||||
{
|
{
|
||||||
class CDockWidgetInfoArea;
|
class CDockWidgetInfoArea;
|
||||||
@@ -40,7 +38,7 @@ namespace BlackGui
|
|||||||
explicit CCockpitComponent(QWidget *parent = nullptr);
|
explicit CCockpitComponent(QWidget *parent = nullptr);
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
~CCockpitComponent();
|
virtual ~CCockpitComponent();
|
||||||
|
|
||||||
//! \copydoc CEnableForDockWidgetInfoArea::setParentDockWidgetInfoArea
|
//! \copydoc CEnableForDockWidgetInfoArea::setParentDockWidgetInfoArea
|
||||||
virtual bool setParentDockWidgetInfoArea(BlackGui::CDockWidgetInfoArea *parentDockableWidget) override;
|
virtual bool setParentDockWidgetInfoArea(BlackGui::CDockWidgetInfoArea *parentDockableWidget) override;
|
||||||
@@ -52,6 +50,9 @@ namespace BlackGui
|
|||||||
//! \copydoc BlackGui::Components::CTransponderModeSelector::setSelectedTransponderModeStateIdent
|
//! \copydoc BlackGui::Components::CTransponderModeSelector::setSelectedTransponderModeStateIdent
|
||||||
void setSelectedTransponderModeStateIdent();
|
void setSelectedTransponderModeStateIdent();
|
||||||
|
|
||||||
|
//! Show the audio ui
|
||||||
|
void showAudio();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
//! Show or hide cockpit details
|
//! Show or hide cockpit details
|
||||||
void ps_onToggleShowHideDetails(bool show);
|
void ps_onToggleShowHideDetails(bool show);
|
||||||
@@ -68,9 +69,7 @@ namespace BlackGui
|
|||||||
QSize m_sizeFloatingHidden; //! size when info area is hidden
|
QSize m_sizeFloatingHidden; //! size when info area is hidden
|
||||||
int m_minHeightInfoArea = -1; //! minimum height of the info area
|
int m_minHeightInfoArea = -1; //! minimum height of the info area
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
#endif // guard
|
#endif // guard
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ class QPixmap;
|
|||||||
class QWidget;
|
class QWidget;
|
||||||
|
|
||||||
namespace Ui { class CCockpitInfoAreaComponent; }
|
namespace Ui { class CCockpitInfoAreaComponent; }
|
||||||
|
|
||||||
namespace BlackGui
|
namespace BlackGui
|
||||||
{
|
{
|
||||||
namespace Components
|
namespace Components
|
||||||
@@ -39,7 +38,7 @@ namespace BlackGui
|
|||||||
explicit CCockpitInfoAreaComponent(QWidget *parent = nullptr);
|
explicit CCockpitInfoAreaComponent(QWidget *parent = nullptr);
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
~CCockpitInfoAreaComponent();
|
virtual ~CCockpitInfoAreaComponent();
|
||||||
|
|
||||||
//! Info areas
|
//! Info areas
|
||||||
enum InfoArea
|
enum InfoArea
|
||||||
|
|||||||
@@ -189,6 +189,11 @@ void SwiftGuiStd::initGuiSignals()
|
|||||||
connect(ui->comp_MainKeypadArea, &CMainKeypadAreaComponent::identPressed, ui->comp_MainInfoArea->getCockpitComponent(), &CCockpitComponent::setSelectedTransponderModeStateIdent);
|
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_MainKeypadArea, &CMainKeypadAreaComponent::commandEntered, ui->comp_MainInfoArea->getTextMessageComponent(), &CTextMessageComponent::handleGlobalCommandLine);
|
||||||
connect(ui->comp_MainInfoArea, &CMainInfoAreaComponent::changedInfoAreaStatus, ui->comp_MainKeypadArea, &CMainKeypadAreaComponent::onMainInfoAreaChanged);
|
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
|
// menu
|
||||||
connect(ui->menu_TestLocationsEDDF, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
connect(ui->menu_TestLocationsEDDF, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||||
|
|||||||
Reference in New Issue
Block a user