/* 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 #include #include #include #include #include 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)); }