Files
pilotclient/src/swiftguistandard/swiftguistdmenus.cpp
Roland Winklmeier 0326d1fc81 Fix swiftguistd header includes
* Include only what is used
* Use forward declaration when possible
* Sorted includes

refs #598
2016-05-20 01:31:53 +02:00

77 lines
2.8 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* 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 "blackgui/components/maininfoareacomponent.h"
#include "blackgui/components/settingscomponent.h"
#include "blackgui/guiapplication.h"
#include "blackmisc/aviation/altitude.h"
#include "blackmisc/pq/units.h"
#include "swiftguistd.h"
#include "ui_swiftguistd.h"
#include <QAction>
#include <QMenu>
#include <QObject>
#include <QScopedPointer>
#include <QStackedWidget>
#include <QtGlobal>
using namespace BlackGui;
using namespace BlackCore;
using namespace BlackMisc;
using namespace BlackMisc::PhysicalQuantities;
using namespace BlackMisc::Aviation;
/*
* Menu clicked
*/
void SwiftGuiStd::ps_onMenuClicked()
{
QObject *sender = QObject::sender();
if (sender == this->ui->menu_TestLocationsEDRY)
{
this->setTestPosition("N 049° 18' 17", "E 008° 27' 05", CAltitude(312, CAltitude::MeanSeaLevel, CLengthUnit::ft()));
}
else if (sender == this->ui->menu_TestLocationsEDNX)
{
this->setTestPosition("N 048° 14 22", "E 011° 33 41", CAltitude(486, CAltitude::MeanSeaLevel, CLengthUnit::m()));
}
else if (sender == this->ui->menu_TestLocationsEDDM)
{
this->setTestPosition("N 048° 21 14", "E 011° 47 10", CAltitude(448, CAltitude::MeanSeaLevel, CLengthUnit::m()));
}
else if (sender == this->ui->menu_TestLocationsEDDF)
{
this->setTestPosition("N 50° 2 0", "E 8° 34 14", CAltitude(100, CAltitude::MeanSeaLevel, CLengthUnit::m()));
}
else if (sender == this->ui->menu_TestLocationsLOWW)
{
this->setTestPosition("N 48° 7 6.3588", "E 16° 33 39.924", CAltitude(100, CAltitude::MeanSeaLevel, CLengthUnit::m()));
}
else if (sender == this->ui->menu_WindowFont)
{
this->ps_setMainPageToInfoArea();
this->ui->comp_MainInfoArea->selectSettingsTab(BlackGui::Components::CSettingsComponent::SettingTabGui);
}
else if (sender == this->ui->menu_InternalsPage)
{
this->ui->sw_MainMiddle->setCurrentIndex(MainPageInternals);
}
}
void SwiftGuiStd::initMenus()
{
Q_ASSERT(this->ui->menu_InfoAreas);
Q_ASSERT(this->ui->comp_MainInfoArea);
sGui->addMenuFile(*this->ui->menu_File);
sGui->addMenuInternals(*this->ui->menu_Internals);
sGui->addMenuWindow(*this->ui->menu_Window);
this->ui->menu_InfoAreas->addActions(this->ui->comp_MainInfoArea->getInfoAreaSelectActions(this->ui->menu_InfoAreas));
}