diff --git a/src/blackgui/components/settingsatcstationsinlinecomponent.cpp b/src/blackgui/components/settingsatcstationsinlinecomponent.cpp new file mode 100644 index 000000000..5785d94f3 --- /dev/null +++ b/src/blackgui/components/settingsatcstationsinlinecomponent.cpp @@ -0,0 +1,43 @@ +/* Copyright (C) 2016 + * 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 "settingsatcstationsinlinecomponent.h" +#include "ui_settingsatcstationsinlinecomponent.h" + +using namespace BlackGui::Settings; + +namespace BlackGui +{ + namespace Components + { + CSettingsAtcStationsInlineComponent::CSettingsAtcStationsInlineComponent(QWidget *parent) : + QFrame(parent), + ui(new Ui::CSettingsAtcStationsInlineComponent) + { + ui->setupUi(this); + connect(ui->rb_InRange, &QRadioButton::released, this, &CSettingsAtcStationsInlineComponent::changeSettings); + } + + CSettingsAtcStationsInlineComponent::~CSettingsAtcStationsInlineComponent() + { } + + void CSettingsAtcStationsInlineComponent::settingsChanged() + { + const CAtcStationsSettings s = m_atcSettings.getThreadLocal(); + ui->rb_InRange->setChecked(s.showOnlyInRange()); + } + + void CSettingsAtcStationsInlineComponent::changeSettings() + { + CAtcStationsSettings s = m_atcSettings.getThreadLocal(); + s.setShowOnlyInRange(ui->rb_InRange->isChecked()); + m_atcSettings.setAndSave(s); + } + } // ns +} // ns diff --git a/src/blackgui/components/settingsatcstationsinlinecomponent.h b/src/blackgui/components/settingsatcstationsinlinecomponent.h new file mode 100644 index 000000000..af8225b81 --- /dev/null +++ b/src/blackgui/components/settingsatcstationsinlinecomponent.h @@ -0,0 +1,49 @@ +/* Copyright (C) 2016 + * 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. + */ + +//! \file + +#ifndef BLACKGUI_COMPONENTS_SETTINGSATCSTATIONSINLINECOMPONENT_H +#define BLACKGUI_COMPONENTS_SETTINGSATCSTATIONSINLINECOMPONENT_H + +#include "blackgui/settings/atcstationssettings.h" +#include + +namespace Ui { class CSettingsAtcStationsInlineComponent; } +namespace BlackGui +{ + namespace Components + { + /*! + * How ATC stations will be displayed + */ + class CSettingsAtcStationsInlineComponent : public QFrame + { + Q_OBJECT + + public: + //! Constructor + explicit CSettingsAtcStationsInlineComponent(QWidget *parent = nullptr); + + //! Destructor + virtual ~CSettingsAtcStationsInlineComponent(); + + private: + //! Settings have been changed + void settingsChanged(); + + //! Change the settings + void changeSettings(); + + QScopedPointer ui; + BlackMisc::CSetting m_atcSettings { this, &CSettingsAtcStationsInlineComponent::settingsChanged }; + }; + } // ns +} // ns +#endif // guard diff --git a/src/blackgui/components/settingsatcstationsinlinecomponent.ui b/src/blackgui/components/settingsatcstationsinlinecomponent.ui new file mode 100644 index 000000000..d39beb82a --- /dev/null +++ b/src/blackgui/components/settingsatcstationsinlinecomponent.ui @@ -0,0 +1,63 @@ + + + CSettingsAtcStationsInlineComponent + + + + 0 + 0 + 159 + 26 + + + + Frame + + + + 3 + + + 3 + + + 3 + + + 3 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + all + + + + + + + in range + + + true + + + + + + + +