mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 02:55:44 +08:00
refs #312, preparation for small navigation bars
This commit is contained in:
@@ -149,9 +149,9 @@ bool SwiftGuiStd::isContextAudioAvailableCheck()
|
||||
|
||||
void SwiftGuiStd::ps_displayStatusMessageInGui(const CStatusMessage &statusMessage)
|
||||
{
|
||||
if (!this->m_init) return;
|
||||
if (statusMessage.isRedundant()) return;
|
||||
if (statusMessage.wasHandledBy(this)) return;
|
||||
if (!this->m_init) { return; }
|
||||
if (statusMessage.isRedundant()) { return; }
|
||||
if (statusMessage.wasHandledBy(this)) { return; }
|
||||
statusMessage.markAsHandledBy(this);
|
||||
this->m_statusBar.displayStatusMessage(statusMessage);
|
||||
this->ui->comp_MainInfoArea->displayStatusMessage(statusMessage);
|
||||
@@ -308,6 +308,17 @@ void SwiftGuiStd::ps_onChangedMainInfoAreaFloating(bool floating)
|
||||
Q_UNUSED(floating);
|
||||
}
|
||||
|
||||
void SwiftGuiStd::ps_toggleNavigatorHorizontal()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void SwiftGuiStd::ps_toggleNavigatorVertical()
|
||||
{
|
||||
bool v = ui->ndw_NavigatorVertical->isVisible();
|
||||
ui->ndw_NavigatorVertical->setVisible(!v);
|
||||
}
|
||||
|
||||
void SwiftGuiStd::playNotifcationSound(CNotificationSounds::Notification notification) const
|
||||
{
|
||||
if (!this->m_contextAudioAvailable) return;
|
||||
|
||||
@@ -121,6 +121,9 @@ private:
|
||||
//! Init GUI signals
|
||||
void initGuiSignals();
|
||||
|
||||
//! Init the navigstion bars
|
||||
void initNavigationBars();
|
||||
|
||||
//! Init dynamic menus
|
||||
void initDynamicMenus();
|
||||
|
||||
@@ -139,19 +142,15 @@ private:
|
||||
//! Context availability, used by watchdog
|
||||
void setContextAvailability();
|
||||
|
||||
/*!
|
||||
* \brief Position of own plane for testing
|
||||
* \param wgsLatitude WGS latitude
|
||||
* \param wgsLongitude WGS longitude
|
||||
* \param altitude
|
||||
*/
|
||||
//! \brief Position of own plane for testing
|
||||
//! \param wgsLatitude WGS latitude
|
||||
//! \param wgsLongitude WGS longitude
|
||||
//! \param altitude
|
||||
void setTestPosition(const QString &wgsLatitude, const QString &wgsLongitude, const BlackMisc::Aviation::CAltitude &altitude);
|
||||
|
||||
/*!
|
||||
* \brief Is given main page selected?
|
||||
* \param mainPage index to be checked
|
||||
* \return
|
||||
*/
|
||||
//! Is given main page selected?
|
||||
//! \param mainPage index to be checked
|
||||
//! \return
|
||||
bool isMainPageSelected(MainPageIndex mainPage) const;
|
||||
|
||||
//! Start all update timers
|
||||
@@ -242,6 +241,12 @@ private slots:
|
||||
//! Whole main info area floating
|
||||
void ps_onChangedMainInfoAreaFloating(bool floating);
|
||||
|
||||
//! Toggle horizontal navigator
|
||||
void ps_toggleNavigatorHorizontal();
|
||||
|
||||
//! Toggle vertical navigator
|
||||
void ps_toggleNavigatorVertical();
|
||||
|
||||
};
|
||||
|
||||
#pragma pop_macro("interface")
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>350</width>
|
||||
<height>550</height>
|
||||
<width>20</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -305,6 +305,8 @@
|
||||
<addaction name="menu_WindowFont"/>
|
||||
<addaction name="menu_WindowMinimize"/>
|
||||
<addaction name="menu_WindowToggleOnTop"/>
|
||||
<addaction name="menu_NavigatorVertical"/>
|
||||
<addaction name="menu_NavigatorHorizontal"/>
|
||||
</widget>
|
||||
<addaction name="menu_File"/>
|
||||
<addaction name="menuWindow"/>
|
||||
@@ -347,6 +349,42 @@
|
||||
</attribute>
|
||||
<widget class="BlackGui::Components::CInfoBarStatusComponent" name="comp_InfoBarStatus"/>
|
||||
</widget>
|
||||
<widget class="BlackGui::Components::CNavigatorDockWidget" name="ndw_NavigatorHorizontal">
|
||||
<property name="floating">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="features">
|
||||
<set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable</set>
|
||||
</property>
|
||||
<property name="allowedAreas">
|
||||
<set>Qt::NoDockWidgetArea</set>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Horizontal navigator</string>
|
||||
</property>
|
||||
<attribute name="dockWidgetArea">
|
||||
<number>1</number>
|
||||
</attribute>
|
||||
<widget class="QWidget" name="qw_NavigatorHorizontal"/>
|
||||
</widget>
|
||||
<widget class="BlackGui::Components::CNavigatorDockWidget" name="ndw_NavigatorVertical">
|
||||
<property name="floating">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="features">
|
||||
<set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable</set>
|
||||
</property>
|
||||
<property name="allowedAreas">
|
||||
<set>Qt::NoDockWidgetArea</set>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Vertical navigator</string>
|
||||
</property>
|
||||
<attribute name="dockWidgetArea">
|
||||
<number>1</number>
|
||||
</attribute>
|
||||
<widget class="QWidget" name="qw_NavigatorVertical"/>
|
||||
</widget>
|
||||
<action name="menu_TestLocationsEDDF">
|
||||
<property name="text">
|
||||
<string>Position EDDF (Frankfurt, GER)</string>
|
||||
@@ -428,6 +466,16 @@
|
||||
<string>Ctrl+W, Ctrl+T</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="menu_NavigatorVertical">
|
||||
<property name="text">
|
||||
<string>Vertical navigator</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="menu_NavigatorHorizontal">
|
||||
<property name="text">
|
||||
<string>Horizontal navigator</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
@@ -467,6 +515,12 @@
|
||||
<header>blackgui/components/internalscomponent.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>BlackGui::Components::CNavigatorDockWidget</class>
|
||||
<extends>QDockWidget</extends>
|
||||
<header>blackgui/components/navigatordockwidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
||||
@@ -38,9 +38,8 @@ using namespace BlackGui::Components;
|
||||
*/
|
||||
void SwiftGuiStd::init(const CRuntimeConfig &runtimeConfig)
|
||||
{
|
||||
if (this->m_init) return;
|
||||
|
||||
this->setVisible(false);
|
||||
if (this->m_init) { return; }
|
||||
this->setVisible(false); // hide all, so no flashing windows during init
|
||||
|
||||
// icon, initial position where intro was before
|
||||
this->setWindowIcon(CIcons::swift24());
|
||||
@@ -69,7 +68,7 @@ void SwiftGuiStd::init(const CRuntimeConfig &runtimeConfig)
|
||||
}
|
||||
|
||||
// timers
|
||||
if (this->m_timerContextWatchdog == nullptr) this->m_timerContextWatchdog = new QTimer(this);
|
||||
if (this->m_timerContextWatchdog == nullptr) { this->m_timerContextWatchdog = new QTimer(this) ; }
|
||||
|
||||
// context
|
||||
this->createRuntime(runtimeConfig, this);
|
||||
@@ -106,6 +105,9 @@ void SwiftGuiStd::init(const CRuntimeConfig &runtimeConfig)
|
||||
this->ps_setMainPageToInfoArea();
|
||||
this->initDynamicMenus();
|
||||
|
||||
// navigation bars
|
||||
// this->initNavigationBars();
|
||||
|
||||
// starting
|
||||
this->getIContextApplication()->notifyAboutComponentChange(IContextApplication::ApplicationGui, IContextApplication::ApplicationStarts);
|
||||
|
||||
@@ -126,6 +128,15 @@ void SwiftGuiStd::init(const CRuntimeConfig &runtimeConfig)
|
||||
this->m_init = true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Init navigation bars
|
||||
*/
|
||||
void SwiftGuiStd::initNavigationBars()
|
||||
{
|
||||
ui->ndw_NavigatorHorizontal->setVisible(false);
|
||||
ui->ndw_NavigatorVertical->setVisible(false);
|
||||
}
|
||||
|
||||
/*
|
||||
* GUI signals
|
||||
*/
|
||||
@@ -159,7 +170,9 @@ void SwiftGuiStd::initGuiSignals()
|
||||
connect(this->ui->menu_WindowFont, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||
connect(this->ui->menu_WindowMinimize, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||
connect(this->ui->menu_WindowToggleOnTop, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||
connect(this->ui->menu_DebugMetaTypes, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||
connect(this->ui->menu_NavigatorHorizontal, &QAction::triggered, this, &SwiftGuiStd::ps_toggleNavigatorHorizontal);
|
||||
connect(this->ui->menu_NavigatorVertical, &QAction::triggered, this, &SwiftGuiStd::ps_toggleNavigatorVertical);
|
||||
connect(this->ui->menu_DebugMetaTypes, &QAction::triggered, this, &SwiftGuiStd::ps_toggleNavigatorHorizontal);
|
||||
|
||||
// command line / text messages
|
||||
connect(this->ui->comp_MainInfoArea->getTextMessageComponent(), &CTextMessageComponent::displayInInfoWindow, this->m_compInfoWindow, &CInfoWindowComponent::display);
|
||||
|
||||
Reference in New Issue
Block a user