refs #347, renamed the application main window to swiftguistd

This commit is contained in:
Klaus Basan
2014-11-24 00:54:13 +01:00
committed by Roland Winklmeier
parent e873025455
commit 7507d0f7bb
7 changed files with 108 additions and 87 deletions

View File

@@ -8,7 +8,7 @@
*/
#include "introwindow.h"
#include "mainwindow.h"
#include "swiftguistd.h"
#include "guimodeenums.h"
#include "blackgui/stylesheetutility.h"
#include "blackcore/blackcorefreefunctions.h"
@@ -69,7 +69,7 @@ int main(int argc, char *argv[])
a.setStyleSheet(s);
// modes
BlackGui::CMainWindow::WindowMode windowMode;
BlackGui::CEnableForFramelessWindow::WindowMode windowMode;
// Dialog to decide external or internal core
CIntroWindow intro;
@@ -100,9 +100,10 @@ int main(int argc, char *argv[])
intro.close();
// show window
MainWindow w(windowMode);
w.show();
SwiftGuiStd w(windowMode);
w.init(runtimeConfig); // object is complete by now
w.show();
int r = a.exec();
return r;
}

View File

@@ -7,8 +7,8 @@
* contained in the LICENSE file.
*/
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "swiftguistd.h"
#include "ui_swiftguistd.h"
#include "blackmisc/icon.h"
#include "blackgui/stylesheetutility.h"
#include "blackgui/models/atcstationlistmodel.h"
@@ -21,6 +21,7 @@
#include "blackmisc/logmessage.h"
#include "blackmisc/notificationsounds.h"
#include <QMouseEvent>
#include <QMainWindow>
using namespace BlackCore;
using namespace BlackSound;
@@ -38,9 +39,10 @@ using namespace BlackMisc::Hardware;
/*
* Constructor
*/
MainWindow::MainWindow(BlackGui::CMainWindow::WindowMode windowMode, QWidget *parent) :
BlackGui::CMainWindow(windowMode, parent),
ui(new Ui::MainWindow)
SwiftGuiStd::SwiftGuiStd(BlackGui::CEnableForFramelessWindow::WindowMode windowMode, QWidget *parent) :
QMainWindow(parent, CEnableForFramelessWindow::modeToWindowFlags(windowMode)),
CEnableForFramelessWindow(windowMode, true, this),
ui(new Ui::SwiftGuiStd)
{
// GUI
ui->setupUi(this);
@@ -51,13 +53,13 @@ MainWindow::MainWindow(BlackGui::CMainWindow::WindowMode windowMode, QWidget *pa
/*
* Destructor
*/
MainWindow::~MainWindow()
SwiftGuiStd::~SwiftGuiStd()
{ }
/*
* Graceful shutdown
*/
void MainWindow::performGracefulShutdown()
void SwiftGuiStd::performGracefulShutdown()
{
if (!this->m_init) { return; }
this->m_init = false;
@@ -100,7 +102,7 @@ void MainWindow::performGracefulShutdown()
/*
* Close event, window closes
*/
void MainWindow::closeEvent(QCloseEvent *event)
void SwiftGuiStd::closeEvent(QCloseEvent *event)
{
Q_UNUSED(event);
this->performGracefulShutdown();
@@ -111,12 +113,12 @@ void MainWindow::closeEvent(QCloseEvent *event)
/*
* Set main page
*/
void MainWindow::ps_setMainPage(MainWindow::MainPageIndex mainPage)
void SwiftGuiStd::ps_setMainPage(SwiftGuiStd::MainPageIndex mainPage)
{
this->ui->sw_MainMiddle->setCurrentIndex(mainPage);
}
void MainWindow::ps_setMainPageInfoArea(CMainInfoAreaComponent::InfoArea infoArea)
void SwiftGuiStd::ps_setMainPageInfoArea(CMainInfoAreaComponent::InfoArea infoArea)
{
this->ps_setMainPageToInfoArea();
this->ui->comp_MainInfoArea->selectArea(infoArea);
@@ -125,12 +127,12 @@ void MainWindow::ps_setMainPageInfoArea(CMainInfoAreaComponent::InfoArea infoAre
/*
* Given main page selected?
*/
bool MainWindow::isMainPageSelected(MainWindow::MainPageIndex mainPage) const
bool SwiftGuiStd::isMainPageSelected(SwiftGuiStd::MainPageIndex mainPage) const
{
return this->ui->sw_MainMiddle->currentIndex() == static_cast<int>(mainPage);
}
void MainWindow::ps_loginRequested()
void SwiftGuiStd::ps_loginRequested()
{
if (this->ui->sw_MainMiddle->currentIndex() == static_cast<int>(MainPageLogin))
{
@@ -146,7 +148,7 @@ void MainWindow::ps_loginRequested()
/*
* Is the network context available?
*/
bool MainWindow::isContextNetworkAvailableCheck()
bool SwiftGuiStd::isContextNetworkAvailableCheck()
{
if (this->m_contextNetworkAvailable) return true;
this->ps_displayStatusMessageInGui(CLogMessage(this).error("Network context not available, no updates this time"));
@@ -156,7 +158,7 @@ bool MainWindow::isContextNetworkAvailableCheck()
/*
* Is the audio context available?
*/
bool MainWindow::isContextAudioAvailableCheck()
bool SwiftGuiStd::isContextAudioAvailableCheck()
{
if (this->m_contextAudioAvailable) return true;
this->ps_displayStatusMessageInGui(CLogMessage(this).error("Voice context not available"));
@@ -166,7 +168,7 @@ bool MainWindow::isContextAudioAvailableCheck()
/*
* Display a status message
*/
void MainWindow::ps_displayStatusMessageInGui(const CStatusMessage &statusMessage)
void SwiftGuiStd::ps_displayStatusMessageInGui(const CStatusMessage &statusMessage)
{
if (!this->m_init) return;
if (statusMessage.isRedundant()) return;
@@ -185,7 +187,7 @@ void MainWindow::ps_displayStatusMessageInGui(const CStatusMessage &statusMessag
}
}
void MainWindow::ps_onChangedSetttings(uint typeValue)
void SwiftGuiStd::ps_onChangedSetttings(uint typeValue)
{
IContextSettings::SettingsType type = static_cast<IContextSettings::SettingsType>(typeValue);
if (type == IContextSettings::SettingsHotKeys) this->ps_registerHotkeyFunctions();
@@ -194,7 +196,7 @@ void MainWindow::ps_onChangedSetttings(uint typeValue)
/*
* Connection terminated
*/
void MainWindow::ps_onConnectionTerminated()
void SwiftGuiStd::ps_onConnectionTerminated()
{
this->updateGuiStatusInformation();
}
@@ -202,7 +204,7 @@ void MainWindow::ps_onConnectionTerminated()
/*
* Connection status changed
*/
void MainWindow::ps_onConnectionStatusChanged(uint /** from **/, uint to, const QString & /* message */)
void SwiftGuiStd::ps_onConnectionStatusChanged(uint /** from **/, uint to, const QString & /* message */)
{
this->updateGuiStatusInformation();
INetwork::ConnectionStatus newStatus = static_cast<INetwork::ConnectionStatus>(to);
@@ -227,7 +229,7 @@ void MainWindow::ps_onConnectionStatusChanged(uint /** from **/, uint to, const
/*
* Timer event
*/
void MainWindow::ps_handleTimerBasedUpdates()
void SwiftGuiStd::ps_handleTimerBasedUpdates()
{
QObject *sender = QObject::sender();
if (sender == this->m_timerContextWatchdog)
@@ -243,7 +245,7 @@ void MainWindow::ps_handleTimerBasedUpdates()
/*
* Context availability
*/
void MainWindow::setContextAvailability()
void SwiftGuiStd::setContextAvailability()
{
qint64 t = QDateTime::currentMSecsSinceEpoch();
this->m_coreAvailable = this->getIContextApplication()->ping(t) == t;
@@ -254,7 +256,7 @@ void MainWindow::setContextAvailability()
/*
* Update GUI
*/
void MainWindow::updateGuiStatusInformation()
void SwiftGuiStd::updateGuiStatusInformation()
{
const QString now = QDateTime::currentDateTimeUtc().toString("yyyy-MM-dd HH:mm:ss");
QString network("unavailable");
@@ -273,7 +275,7 @@ void MainWindow::updateGuiStatusInformation()
/*
* Opacity 0-100
*/
void MainWindow::ps_changeWindowOpacity(int opacity)
void SwiftGuiStd::ps_changeWindowOpacity(int opacity)
{
qreal o = opacity / 100.0;
o = o < 0.3 ? 0.3 : o;
@@ -285,7 +287,7 @@ void MainWindow::ps_changeWindowOpacity(int opacity)
/*
* Stay on top
*/
void MainWindow::ps_toogleWindowStayOnTop()
void SwiftGuiStd::ps_toogleWindowStayOnTop()
{
Qt::WindowFlags flags = this->windowFlags();
if (Qt::WindowStaysOnTopHint & flags)
@@ -307,7 +309,7 @@ void MainWindow::ps_toogleWindowStayOnTop()
/*
* Hotkey functions
*/
void MainWindow::ps_registerHotkeyFunctions()
void SwiftGuiStd::ps_registerHotkeyFunctions()
{
CInputManager *m_inputManager = BlackCore::CInputManager::getInstance();
@@ -330,7 +332,7 @@ void MainWindow::ps_registerHotkeyFunctions()
/*
* Styles
*/
void MainWindow::ps_onStyleSheetsChanged()
void SwiftGuiStd::ps_onStyleSheetsChanged()
{
const QString s = CStyleSheetUtility::instance().styles(
{
@@ -341,7 +343,7 @@ void MainWindow::ps_onStyleSheetsChanged()
this->setStyleSheet(s);
}
void MainWindow::ps_onCurrentMainWidgetChanged(int currentIndex)
void SwiftGuiStd::ps_onCurrentMainWidgetChanged(int currentIndex)
{
emit currentMainInfoAreaChanged(this->ui->sw_MainMiddle->currentWidget());
Q_UNUSED(currentIndex);
@@ -350,7 +352,7 @@ void MainWindow::ps_onCurrentMainWidgetChanged(int currentIndex)
/*
* Notification
*/
void MainWindow::playNotifcationSound(CNotificationSounds::Notification notification) const
void SwiftGuiStd::playNotifcationSound(CNotificationSounds::Notification notification) const
{
if (!this->m_contextAudioAvailable) return;
if (!this->ui->comp_MainInfoArea->getSettingsComponent()->playNotificationSounds()) return;

View File

@@ -9,8 +9,8 @@
//! \file
#ifndef STDGUI_SWIFTGUI_H
#define STDGUI_SWIFTGUI_H
#ifndef STDGUI_SWIFTGUISTD_H
#define STDGUI_SWIFTGUISTD_H
// clash with struct interface in objbase.h used to happen
#pragma push_macro("interface")
@@ -29,7 +29,7 @@
#include "blackgui/models/userlistmodel.h"
#include "blackgui/models/statusmessagelistmodel.h"
#include "blackgui/models/keyboardkeylistmodel.h"
#include "blackgui/mainwindow.h"
#include "blackgui/enableforframelesswindow.h"
#include "blackgui/managedstatusbar.h"
#include "blackmisc/nwtextmessage.h"
#include "blackmisc/loghandler.h"
@@ -41,11 +41,12 @@
#include <QLabel>
#include <QTimer>
namespace Ui { class MainWindow; }
namespace Ui { class SwiftGuiStd; }
//! swift GUI
class MainWindow :
public BlackGui::CMainWindow,
class SwiftGuiStd :
public QMainWindow,
public BlackGui::CEnableForFramelessWindow,
public BlackGui::Components::CEnableForRuntime
{
Q_OBJECT
@@ -61,16 +62,16 @@ public:
};
//! Constructor
explicit MainWindow(BlackGui::CMainWindow::WindowMode windowMode, QWidget *parent = nullptr);
explicit SwiftGuiStd(BlackGui::CEnableForFramelessWindow::WindowMode windowMode, QWidget *parent = nullptr);
//! Destructor
~MainWindow();
~SwiftGuiStd();
//! Init data
void init(const BlackCore::CRuntimeConfig &runtimeConfig);
//! Log message category
static QString getMessageCategory() { return "swift.gui.component.mainwindow"; }
static QString getMessageCategory() { return "swift.gui.stdgui"; }
signals:
//! GUI is shutting down, request graceful shutdown
@@ -81,16 +82,22 @@ signals:
void currentMainInfoAreaChanged(const QWidget *currentWidget);
protected:
//! Close event, e.g. when window is closed
void closeEvent(QCloseEvent *event);
//! \copy QMainWindow::mouseMoveEvent
void mouseMoveEvent(QMouseEvent *event) override { if (!handleMouseMoveEvent(event)) { QMainWindow::mouseMoveEvent(event); } ; }
//! \copy QMainWindow::mousePressEvent
void mousePressEvent(QMouseEvent *event) override { if (!handleMousePressEvent(event)) { QMainWindow::mousePressEvent(event); } }
//! \copydoc QMainWindow::closeEvent
void closeEvent(QCloseEvent *event) override;
private:
QScopedPointer<Ui::MainWindow> ui;
QScopedPointer<Ui::SwiftGuiStd> ui;
bool m_init = false;
BlackGui::Components::CInfoWindowComponent *m_compInfoWindow = nullptr; //!< the info window (popup
BlackGui::CManagedStatusBar m_statusBar;
BlackInput::IKeyboard *m_keyboard = nullptr; //!< hotkeys
BlackMisc::CLogSubscriber m_logSubscriber { this, &MainWindow::ps_displayStatusMessageInGui };
BlackMisc::CLogSubscriber m_logSubscriber { this, &SwiftGuiStd::ps_displayStatusMessageInGui };
// contexts
bool m_coreAvailable = false;

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<class>SwiftGuiStd</class>
<widget class="QMainWindow" name="SwiftGuiStd">
<property name="geometry">
<rect>
<x>0</x>

View File

@@ -1,5 +1,13 @@
#include "mainwindow.h"
#include "ui_mainwindow.h"
/* Copyright (C) 2013
* swift project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
#include "swiftguistd.h"
#include "blackgui/models/atcstationlistmodel.h"
#include "blackcore/dbus_server.h"
#include "blackcore/context_network.h"
@@ -17,7 +25,7 @@ using namespace BlackMisc::Audio;
/*
* Load own aircraft
*/
bool MainWindow::ps_reloadOwnAircraft()
bool SwiftGuiStd::ps_reloadOwnAircraft()
{
if (!this->isContextNetworkAvailableCheck()) return false;
@@ -35,7 +43,7 @@ bool MainWindow::ps_reloadOwnAircraft()
/*
* Position
*/
void MainWindow::setTestPosition(const QString &wgsLatitude, const QString &wgsLongitude, const CAltitude &altitude)
void SwiftGuiStd::setTestPosition(const QString &wgsLatitude, const QString &wgsLongitude, const CAltitude &altitude)
{
CCoordinateGeodetic coordinate(
CLatitude::fromWgs84(wgsLatitude),
@@ -44,5 +52,5 @@ void MainWindow::setTestPosition(const QString &wgsLatitude, const QString &wgsL
this->m_ownAircraft.setPosition(coordinate);
this->m_ownAircraft.setAltitude(altitude);
this->getIContextOwnAircraft()->updateOwnPosition(coordinate, altitude, MainWindow::swiftGuiStandardOriginator());
this->getIContextOwnAircraft()->updateOwnPosition(coordinate, altitude, SwiftGuiStd::swiftGuiStandardOriginator());
}

View File

@@ -7,8 +7,8 @@
* contained in the LICENSE file.
*/
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "swiftguistd.h"
#include "ui_swiftguistd.h"
#include "blackcore/dbus_server.h"
#include "blackcore/context_all_interfaces.h"
#include "blackgui/stylesheetutility.h"
@@ -36,10 +36,12 @@ using namespace BlackGui::Components;
/*
* Init data
*/
void MainWindow::init(const CRuntimeConfig &runtimeConfig)
void SwiftGuiStd::init(const CRuntimeConfig &runtimeConfig)
{
if (this->m_init) return;
this->setVisible(false);
// icon, initial position where intro was before
this->setWindowIcon(CIcons::swift24());
this->setWindowTitle(CProject::systemNameAndVersion());
@@ -76,11 +78,11 @@ void MainWindow::init(const CRuntimeConfig &runtimeConfig)
this->m_statusBar.initStatusBar(this->ui->sb_MainStatusBar);
// signal / slots contexts / timers
connect(this->getIContextNetwork(), &IContextNetwork::connectionTerminated, this, &MainWindow::ps_onConnectionTerminated);
connect(this->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &MainWindow::ps_onConnectionStatusChanged);
connect(this->getIContextNetwork(), &IContextNetwork::connectionTerminated, this, &SwiftGuiStd::ps_onConnectionTerminated);
connect(this->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &SwiftGuiStd::ps_onConnectionStatusChanged);
connect(this->getIContextNetwork(), &IContextNetwork::textMessagesReceived, this->ui->comp_MainInfoArea->getTextMessageComponent(), &CTextMessageComponent::onTextMessageReceived);
connect(this->m_timerContextWatchdog, &QTimer::timeout, this, &MainWindow::ps_handleTimerBasedUpdates);
connect(this->getIContextSettings(), &IContextSettings::changedSettings, this, &MainWindow::ps_onChangedSetttings);
connect(this->m_timerContextWatchdog, &QTimer::timeout, this, &SwiftGuiStd::ps_handleTimerBasedUpdates);
connect(this->getIContextSettings(), &IContextSettings::changedSettings, this, &SwiftGuiStd::ps_onChangedSetttings);
// log messages
m_logSubscriber.changeSubscription(CLogPattern().withSeverityAtOrAbove(CStatusMessage::SeverityInfo));
@@ -113,24 +115,26 @@ void MainWindow::init(const CRuntimeConfig &runtimeConfig)
// do this as last statement, so it can be used as flag
// whether init has been completed
this->setVisible(true);
this->m_init = true;
}
//
// GUI signals
//
void MainWindow::initGuiSignals()
void SwiftGuiStd::initGuiSignals()
{
// Remark: With new style, only methods of same signature can be connected
// This is why we still have some "old" SIGNAL/SLOT connections here
// main window
connect(this->ui->sw_MainMiddle, &QStackedWidget::currentChanged, this, &MainWindow::ps_onCurrentMainWidgetChanged);
connect(this->ui->sw_MainMiddle, &QStackedWidget::currentChanged, this, &SwiftGuiStd::ps_onCurrentMainWidgetChanged);
// main keypad
connect(this->ui->comp_MainKeypadArea, &CMainKeypadAreaComponent::selectedMainInfoAreaDockWidget, this, &MainWindow::ps_setMainPageInfoArea);
connect(this->ui->comp_MainKeypadArea, &CMainKeypadAreaComponent::connectPressed, this, &MainWindow::ps_loginRequested);
connect(this->ui->comp_MainKeypadArea, &CMainKeypadAreaComponent::changedOpacity, this , &MainWindow::ps_changeWindowOpacity);
connect(this->ui->comp_MainKeypadArea, &CMainKeypadAreaComponent::selectedMainInfoAreaDockWidget, this, &SwiftGuiStd::ps_setMainPageInfoArea);
connect(this->ui->comp_MainKeypadArea, &CMainKeypadAreaComponent::connectPressed, this, &SwiftGuiStd::ps_loginRequested);
connect(this->ui->comp_MainKeypadArea, &CMainKeypadAreaComponent::changedOpacity, this , &SwiftGuiStd::ps_changeWindowOpacity);
connect(this->ui->comp_MainKeypadArea, &CMainKeypadAreaComponent::identPressed, this->ui->comp_MainInfoArea->getCockpitComponent(), &CCockpitComponent::setSelectedTransponderModeStateIdent);
connect(this->ui->comp_MainInfoArea, &CMainInfoAreaComponent::changedInfoAreaStatus, ui->comp_MainKeypadArea, &CMainKeypadAreaComponent::onMainInfoAreaChanged);
@@ -138,23 +142,23 @@ void MainWindow::initGuiSignals()
connect(this->ui->comp_MainKeypadArea, &CMainKeypadAreaComponent::commandEntered, this->ui->comp_MainInfoArea->getTextMessageComponent(), &CTextMessageComponent::parseCommandLine);
// menu
connect(this->ui->menu_ReloadSettings, &QAction::triggered, this, &MainWindow::ps_onMenuClicked);
connect(this->ui->menu_TestLocationsEDDF, &QAction::triggered, this, &MainWindow::ps_onMenuClicked);
connect(this->ui->menu_TestLocationsEDDM, &QAction::triggered, this, &MainWindow::ps_onMenuClicked);
connect(this->ui->menu_TestLocationsEDNX, &QAction::triggered, this, &MainWindow::ps_onMenuClicked);
connect(this->ui->menu_TestLocationsEDRY, &QAction::triggered, this, &MainWindow::ps_onMenuClicked);
connect(this->ui->menu_FileClose, &QAction::triggered, this, &MainWindow::ps_onMenuClicked);
connect(this->ui->menu_FileSettingsDirectory, &QAction::triggered, this, &MainWindow::ps_onMenuClicked);
connect(this->ui->menu_FileResetSettings, &QAction::triggered, this, &MainWindow::ps_onMenuClicked);
connect(this->ui->menu_FileReloadStyleSheets, &QAction::triggered, this, &MainWindow::ps_onMenuClicked);
connect(this->ui->menu_FileFont, &QAction::triggered, this, &MainWindow::ps_onMenuClicked);
connect(this->ui->menu_ReloadSettings, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
connect(this->ui->menu_TestLocationsEDDF, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
connect(this->ui->menu_TestLocationsEDDM, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
connect(this->ui->menu_TestLocationsEDNX, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
connect(this->ui->menu_TestLocationsEDRY, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
connect(this->ui->menu_FileClose, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
connect(this->ui->menu_FileSettingsDirectory, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
connect(this->ui->menu_FileResetSettings, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
connect(this->ui->menu_FileReloadStyleSheets, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
connect(this->ui->menu_FileFont, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
// command line / text messages
connect(this->ui->comp_MainInfoArea->getTextMessageComponent(), &CTextMessageComponent::displayInInfoWindow, this->m_compInfoWindow, &CInfoWindowComponent::display);
// settings (GUI component), styles
connect(this->ui->comp_MainInfoArea->getSettingsComponent(), &CSettingsComponent::changedWindowsOpacity, this, &MainWindow::ps_changeWindowOpacity);
connect(&CStyleSheetUtility::instance(), &CStyleSheetUtility::styleSheetsChanged, this, &MainWindow::ps_onStyleSheetsChanged);
connect(this->ui->comp_MainInfoArea->getSettingsComponent(), &CSettingsComponent::changedWindowsOpacity, this, &SwiftGuiStd::ps_changeWindowOpacity);
connect(&CStyleSheetUtility::instance(), &CStyleSheetUtility::styleSheetsChanged, this, &SwiftGuiStd::ps_onStyleSheetsChanged);
// sliders
connect(this->ui->comp_MainInfoArea->getSettingsComponent(), &CSettingsComponent::changedUsersUpdateInterval, this->ui->comp_MainInfoArea->getUserComponent(), &CUserComponent::setUpdateIntervalSeconds);
@@ -162,10 +166,10 @@ void MainWindow::initGuiSignals()
connect(this->ui->comp_MainInfoArea->getSettingsComponent(), &CSettingsComponent::changedAtcStationsUpdateInterval, this->ui->comp_MainInfoArea->getAtcStationComponent(), &::CAtcStationComponent::setUpdateIntervalSeconds);
// login
connect(this->ui->comp_Login, &CLoginComponent::loginOrLogoffCancelled, this, &MainWindow::ps_setMainPageToInfoArea);
connect(this->ui->comp_Login, &CLoginComponent::loginOrLogoffSuccessful, this, &MainWindow::ps_setMainPageToInfoArea);
connect(this->ui->comp_Login, &CLoginComponent::loginOrLogoffCancelled, this, &SwiftGuiStd::ps_setMainPageToInfoArea);
connect(this->ui->comp_Login, &CLoginComponent::loginOrLogoffSuccessful, this, &SwiftGuiStd::ps_setMainPageToInfoArea);
connect(this->ui->comp_Login, &CLoginComponent::loginOrLogoffSuccessful, this->ui->comp_MainInfoArea->getFlightPlanComponent(), &CFlightPlanComponent::loginDataSet);
connect(this, &MainWindow::currentMainInfoAreaChanged, this->ui->comp_Login, &CLoginComponent::mainInfoAreaChanged);
connect(this, &SwiftGuiStd::currentMainInfoAreaChanged, this->ui->comp_Login, &CLoginComponent::mainInfoAreaChanged);
connect(this->ui->comp_Login, &CLoginComponent::requestNetworkSettings, this->ui->comp_MainInfoArea->getFlightPlanComponent(), [ = ]()
{
this->ps_setMainPageInfoArea(CMainInfoAreaComponent::InfoAreaSettings);
@@ -177,7 +181,7 @@ void MainWindow::initGuiSignals()
/*
* Init data when started
*/
void MainWindow::initialDataReads()
void SwiftGuiStd::initialDataReads()
{
qint64 t = QDateTime::currentMSecsSinceEpoch();
this->m_coreAvailable = (this->getIContextNetwork()->isUsingImplementingObject() || (this->getIContextApplication()->ping(t) == t));
@@ -195,7 +199,7 @@ void MainWindow::initialDataReads()
/*
* Start update timers
*/
void MainWindow::startUpdateTimersWhenConnected()
void SwiftGuiStd::startUpdateTimersWhenConnected()
{
this->ui->comp_MainInfoArea->getAtcStationComponent()->setUpdateIntervalSeconds(this->ui->comp_MainInfoArea->getSettingsComponent()->getAtcUpdateIntervalSeconds());
this->ui->comp_MainInfoArea->getAircraftComponent()->setUpdateIntervalSeconds(this->ui->comp_MainInfoArea->getSettingsComponent()->getAircraftUpdateIntervalSeconds());
@@ -205,7 +209,7 @@ void MainWindow::startUpdateTimersWhenConnected()
/*
* Stop udate timers
*/
void MainWindow::stopUpdateTimersWhenDisconnected()
void SwiftGuiStd::stopUpdateTimersWhenDisconnected()
{
this->ui->comp_MainInfoArea->getAtcStationComponent()->stopTimer();
this->ui->comp_MainInfoArea->getAircraftComponent()->stopTimer();
@@ -215,7 +219,7 @@ void MainWindow::stopUpdateTimersWhenDisconnected()
/*
* Stop all timers
*/
void MainWindow::stopAllTimers(bool disconnect)
void SwiftGuiStd::stopAllTimers(bool disconnect)
{
this->m_timerContextWatchdog->stop();
this->stopUpdateTimersWhenDisconnected();

View File

@@ -1,5 +1,5 @@
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "swiftguistd.h"
#include "ui_swiftguistd.h"
#include "blackgui/stylesheetutility.h"
#include "blackmisc/statusmessagelist.h"
#include "blackmisc/avaltitude.h"
@@ -18,7 +18,7 @@ using namespace BlackMisc::Aviation;
/*
* Menu clicked
*/
void MainWindow::ps_onMenuClicked()
void SwiftGuiStd::ps_onMenuClicked()
{
QObject *sender = QObject::sender();
if (sender == this->ui->menu_TestLocationsEDRY)
@@ -68,8 +68,7 @@ void MainWindow::ps_onMenuClicked()
}
}
void MainWindow::initDynamicMenus()
void SwiftGuiStd::initDynamicMenus()
{
Q_ASSERT(this->ui->menu_InfoAreas);
Q_ASSERT(this->ui->comp_MainInfoArea);