mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
147 lines
4.1 KiB
C++
147 lines
4.1 KiB
C++
/* 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.
|
|
*/
|
|
|
|
//! \file
|
|
|
|
#ifndef BLACKGUI_SETTINGSCOMPONENT_H
|
|
#define BLACKGUI_SETTINGSCOMPONENT_H
|
|
|
|
#include "blackgui/components/enableforruntime.h"
|
|
#include "blackmisc/nwserver.h"
|
|
#include "blackmisc/avaircrafticao.h"
|
|
#include <QTabWidget>
|
|
#include <QModelIndex>
|
|
#include <QTimer>
|
|
#include <QScopedPointer>
|
|
|
|
namespace Ui { class CSettingsComponent; }
|
|
|
|
namespace BlackGui
|
|
{
|
|
namespace Components
|
|
{
|
|
|
|
//! Settings component
|
|
class CSettingsComponent :
|
|
public QTabWidget,
|
|
public CEnableForRuntime
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
//! Tabs
|
|
enum SettingTab
|
|
{
|
|
SettingTabNetwork = 0,
|
|
SettingTabAircraft,
|
|
SettingTabAircraftAudio,
|
|
SettingTabSimulator,
|
|
SettingTabGui,
|
|
SettingTabMisc
|
|
};
|
|
|
|
//! Constructor
|
|
explicit CSettingsComponent(QWidget *parent = nullptr);
|
|
|
|
//! Destructor
|
|
~CSettingsComponent();
|
|
|
|
//! \copydoc CAudioSetupComponent::playNotificationSounds
|
|
bool playNotificationSounds() const;
|
|
|
|
//! ICAO data from GUI
|
|
void setOwnAircraftIcaoDataFromGui(BlackMisc::Aviation::CAircraftIcao &icao) const;
|
|
|
|
//! GUI Opacity 0-100%
|
|
void setGuiOpacity(double value);
|
|
|
|
//! Login as observer
|
|
bool loginAsObserver() const;
|
|
|
|
//! Login as observer
|
|
bool loginStealth() const;
|
|
|
|
//! ATC refresh time
|
|
int getAtcUpdateIntervalSeconds() const;
|
|
|
|
//! Aircraft refresh time
|
|
int getAircraftUpdateIntervalSeconds() const;
|
|
|
|
//! Aircraft refresh time
|
|
int getUsersUpdateIntervalSeconds() const;
|
|
|
|
//! Own callsign
|
|
QString getOwnCallsignFromGui() const;
|
|
|
|
signals:
|
|
//! Change the windows opacity 0..100
|
|
void changedWindowsOpacity(int opacity);
|
|
|
|
//! Update interval changed (ATC)
|
|
void changedAtcStationsUpdateInterval(int seconds);
|
|
|
|
//! Update interval changed (aircrafts)
|
|
void changedAircraftsUpdateInterval(int seconds);
|
|
|
|
//! Update interval changed (users)
|
|
void changedUsersUpdateInterval(int seconds);
|
|
|
|
public slots:
|
|
//! Reload settings
|
|
void reloadSettings();
|
|
|
|
//! Set the tab
|
|
void setSettingsTab(SettingTab tab);
|
|
|
|
protected:
|
|
//! \copydoc CRuntimeBasedComponent::runtimeHasBeenSet
|
|
virtual void runtimeHasBeenSet() override;
|
|
|
|
private slots:
|
|
|
|
//! Network server selected
|
|
void ps_networkServerSelected(QModelIndex index);
|
|
|
|
//! Alter traffic server
|
|
void ps_alterTrafficServer();
|
|
|
|
/*!
|
|
* \brief Update the selected server textboxes
|
|
* \param server to be displayed
|
|
*/
|
|
void ps_updateGuiSelectedServerTextboxes(const BlackMisc::Network::CServer &server);
|
|
|
|
//! Selected server from textboxes
|
|
BlackMisc::Network::CServer ps_selectedServerFromTextboxes() const;
|
|
|
|
//! Settings have been changed
|
|
void ps_changedSettings(uint typeValue);
|
|
|
|
//! Save the Hotkeys
|
|
void ps_saveHotkeys();
|
|
|
|
//! Clear single hotkey
|
|
void ps_clearHotkey();
|
|
|
|
//! Font has been changed
|
|
void ps_fontChanged();
|
|
|
|
//! Font color dialof
|
|
void ps_fontColorDialog();
|
|
|
|
private:
|
|
QScopedPointer<Ui::CSettingsComponent> ui;
|
|
QColor m_fontColor;
|
|
};
|
|
}
|
|
} // namespace
|
|
|
|
#endif // guard
|