mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Naming conventions, typos
This commit is contained in:
@@ -31,6 +31,9 @@ namespace BlackGui
|
||||
namespace Components
|
||||
{
|
||||
|
||||
/*
|
||||
* Constructor
|
||||
*/
|
||||
CSettingsComponent::CSettingsComponent(QWidget *parent) :
|
||||
QTabWidget(parent), CRuntimeBasedComponent(nullptr, false), ui(new Ui::CSettingsComponent),
|
||||
m_audioTestRunning(NoAudioTest)
|
||||
@@ -40,6 +43,9 @@ namespace BlackGui
|
||||
this->m_timerAudioTests = new QTimer(this);
|
||||
}
|
||||
|
||||
/*
|
||||
* Destructor
|
||||
*/
|
||||
CSettingsComponent::~CSettingsComponent()
|
||||
{
|
||||
delete ui;
|
||||
@@ -55,41 +61,65 @@ namespace BlackGui
|
||||
icao.setAircraftCombinedType(this->ui->le_SettingsIcaoCombinedType->text());
|
||||
}
|
||||
|
||||
/*
|
||||
* Opacity
|
||||
*/
|
||||
void CSettingsComponent::setGuiOpacity(double value)
|
||||
{
|
||||
this->ui->hs_SettingsGuiOpacity->setValue(value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Login as observer
|
||||
*/
|
||||
bool CSettingsComponent::loginAsObserver() const
|
||||
{
|
||||
return this->ui->rb_SettingsLoginStealthMode->isChecked();
|
||||
}
|
||||
|
||||
/*
|
||||
* Stealth
|
||||
*/
|
||||
bool CSettingsComponent::loginStealth() const
|
||||
{
|
||||
return this->ui->rb_SettingsLoginStealthMode->isChecked();
|
||||
}
|
||||
|
||||
/*
|
||||
* Notification sounds
|
||||
*/
|
||||
bool CSettingsComponent::playNotificationSounds() const
|
||||
{
|
||||
return this->ui->cb_SettingsAudioPlayNotificationSounds->isChecked();
|
||||
}
|
||||
|
||||
/*
|
||||
* Update interval
|
||||
*/
|
||||
int CSettingsComponent::getAtcUpdateIntervalSeconds() const
|
||||
{
|
||||
return this->ui->hs_SettingsGuiAtcRefreshTime->value();
|
||||
}
|
||||
|
||||
/*
|
||||
* Update interval
|
||||
*/
|
||||
int CSettingsComponent::getAircraftUpdateIntervalSeconds() const
|
||||
{
|
||||
return this->ui->hs_SettingsGuiAircraftRefreshTime->value();
|
||||
}
|
||||
|
||||
/*
|
||||
* Update interval
|
||||
*/
|
||||
int CSettingsComponent::getUsersUpdateIntervalSeconds() const
|
||||
{
|
||||
return this->ui->hs_SettingsGuiUserRefreshTime->value();
|
||||
}
|
||||
|
||||
/*
|
||||
* Own callsign
|
||||
*/
|
||||
QString CSettingsComponent::getOwnCallsignFromGui() const
|
||||
{
|
||||
return this->ui->le_SettingsAircraftCallsign->text();
|
||||
@@ -135,8 +165,8 @@ namespace BlackGui
|
||||
Q_ASSERT(connected);
|
||||
connected = this->connect(this->ui->cb_SettingsAudioOutputDevice, SIGNAL(currentIndexChanged(int)), this, SLOT(audioDeviceSelected(int)));
|
||||
Q_ASSERT(connected);
|
||||
this->connect(this->ui->pb_SettingsAudioMicrophoneTest, &QPushButton::clicked, this, &CSettingsComponent::startAudioTest);
|
||||
this->connect(this->ui->pb_SettingsAudioSquelchTest, &QPushButton::clicked, this, &CSettingsComponent::startAudioTest);
|
||||
this->connect(this->ui->pb_SettingsAudioMicrophoneTest, &QPushButton::clicked, this, &CSettingsComponent::ps_startAudioTest);
|
||||
this->connect(this->ui->pb_SettingsAudioSquelchTest, &QPushButton::clicked, this, &CSettingsComponent::ps_startAudioTest);
|
||||
}
|
||||
|
||||
// Opacity, intervals
|
||||
@@ -146,32 +176,33 @@ namespace BlackGui
|
||||
this->connect(this->ui->hs_SettingsGuiUserRefreshTime, &QSlider::valueChanged, this, &CSettingsComponent::changedUsersUpdateInterval);
|
||||
|
||||
// Settings server
|
||||
this->connect(this->ui->pb_SettingsTnCurrentServer, &QPushButton::released, this, &CSettingsComponent::alterTrafficServer);
|
||||
this->connect(this->ui->pb_SettingsTnRemoveServer, &QPushButton::released, this, &CSettingsComponent::alterTrafficServer);
|
||||
this->connect(this->ui->pb_SettingsTnSaveServer, &QPushButton::released, this, &CSettingsComponent::alterTrafficServer);
|
||||
this->connect(this->ui->tvp_SettingsTnServers, &QTableView::clicked, this, &CSettingsComponent::networkServerSelected);
|
||||
this->connect(this->ui->pb_SettingsTnCurrentServer, &QPushButton::released, this, &CSettingsComponent::ps_alterTrafficServer);
|
||||
this->connect(this->ui->pb_SettingsTnRemoveServer, &QPushButton::released, this, &CSettingsComponent::ps_alterTrafficServer);
|
||||
this->connect(this->ui->pb_SettingsTnSaveServer, &QPushButton::released, this, &CSettingsComponent::ps_alterTrafficServer);
|
||||
this->connect(this->ui->tvp_SettingsTnServers, &QTableView::clicked, this, &CSettingsComponent::ps_networkServerSelected);
|
||||
|
||||
// Settings hotkeys
|
||||
this->connect(this->ui->pb_SettingsMiscCancel, &QPushButton::clicked, this, &CSettingsComponent::reloadSettings);
|
||||
this->connect(this->ui->pb_SettingsMiscSave, &QPushButton::clicked, this, &CSettingsComponent::saveHotkeys);
|
||||
this->connect(this->ui->pb_SettingsMiscRemove, &QPushButton::clicked, this, &CSettingsComponent::clearHotkey);
|
||||
this->connect(this->ui->pb_SettingsMiscSave, &QPushButton::clicked, this, &CSettingsComponent::ps_saveHotkeys);
|
||||
this->connect(this->ui->pb_SettingsMiscRemove, &QPushButton::clicked, this, &CSettingsComponent::ps_clearHotkey);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Network has been selected
|
||||
*/
|
||||
void CSettingsComponent::networkServerSelected(QModelIndex index)
|
||||
void CSettingsComponent::ps_networkServerSelected(QModelIndex index)
|
||||
{
|
||||
const CServer clickedServer = this->ui->tvp_SettingsTnServers->at<CServer>(index);
|
||||
this->updateGuiSelectedServerTextboxes(clickedServer);
|
||||
this->ps_updateGuiSelectedServerTextboxes(clickedServer);
|
||||
}
|
||||
|
||||
/*
|
||||
* Alter server
|
||||
*/
|
||||
void CSettingsComponent::alterTrafficServer()
|
||||
void CSettingsComponent::ps_alterTrafficServer()
|
||||
{
|
||||
CServer server = this->selectedServerFromTextboxes();
|
||||
CServer server = this->ps_selectedServerFromTextboxes();
|
||||
if (!server.isValidForLogin())
|
||||
{
|
||||
const CStatusMessage validation = CStatusMessage::getValidationError("Wrong settings for server");
|
||||
@@ -202,7 +233,7 @@ namespace BlackGui
|
||||
/*
|
||||
* Settings did changed
|
||||
*/
|
||||
void CSettingsComponent::changedSettings(uint typeValue)
|
||||
void CSettingsComponent::ps_changedSettings(uint typeValue)
|
||||
{
|
||||
IContextSettings::SettingsType type = static_cast<IContextSettings::SettingsType>(typeValue);
|
||||
this->reloadSettings();
|
||||
@@ -212,7 +243,7 @@ namespace BlackGui
|
||||
/*
|
||||
* Textboxes from server
|
||||
*/
|
||||
void CSettingsComponent::updateGuiSelectedServerTextboxes(const CServer &server)
|
||||
void CSettingsComponent::ps_updateGuiSelectedServerTextboxes(const CServer &server)
|
||||
{
|
||||
this->ui->le_SettingsTnCsName->setText(server.getName());
|
||||
this->ui->le_SettingsTnCsDescription->setText(server.getDescription());
|
||||
@@ -226,7 +257,7 @@ namespace BlackGui
|
||||
/*
|
||||
* Server settings from textboxes
|
||||
*/
|
||||
CServer CSettingsComponent::selectedServerFromTextboxes() const
|
||||
CServer CSettingsComponent::ps_selectedServerFromTextboxes() const
|
||||
{
|
||||
CServer server;
|
||||
bool portOk = false;
|
||||
@@ -248,7 +279,7 @@ namespace BlackGui
|
||||
/*
|
||||
* Save the hotkeys
|
||||
*/
|
||||
void CSettingsComponent::saveHotkeys()
|
||||
void CSettingsComponent::ps_saveHotkeys()
|
||||
{
|
||||
const QString path = CSettingUtilities::appendPaths(IContextSettings::PathRoot(), IContextSettings::PathHotkeys());
|
||||
CStatusMessageList msgs = this->getIContextSettings()->value(path, CSettingUtilities::CmdUpdate(), this->ui->tvp_SettingsMiscHotkeys->derivedModel()->getContainer().toQVariant());
|
||||
@@ -260,7 +291,7 @@ namespace BlackGui
|
||||
/*
|
||||
* Clear particular hotkey
|
||||
*/
|
||||
void CSettingsComponent::clearHotkey()
|
||||
void CSettingsComponent::ps_clearHotkey()
|
||||
{
|
||||
QModelIndex i = this->ui->tvp_SettingsMiscHotkeys->currentIndex();
|
||||
if (i.row() < 0 || i.row() >= this->ui->tvp_SettingsMiscHotkeys->rowCount()) return;
|
||||
@@ -307,7 +338,7 @@ namespace BlackGui
|
||||
/*
|
||||
* Start the voice tests
|
||||
*/
|
||||
void CSettingsComponent::startAudioTest()
|
||||
void CSettingsComponent::ps_startAudioTest()
|
||||
{
|
||||
if (!this->getIContextAudio())
|
||||
{
|
||||
@@ -346,7 +377,7 @@ namespace BlackGui
|
||||
/*
|
||||
* Start the voice tests
|
||||
*/
|
||||
void CSettingsComponent::audioTestUpdate()
|
||||
void CSettingsComponent::ps_audioTestUpdate()
|
||||
{
|
||||
Q_ASSERT(this->getIContextAudio());
|
||||
if (!this->getIContextAudio()) return;
|
||||
@@ -388,7 +419,7 @@ namespace BlackGui
|
||||
/*
|
||||
* Select audio device
|
||||
*/
|
||||
void CSettingsComponent::audioDeviceSelected(int index)
|
||||
void CSettingsComponent::ps_audioDeviceSelected(int index)
|
||||
{
|
||||
if (!this->getIContextAudio()) return;
|
||||
if (index < 0)return;
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKGUI_SETTINGSCOMPONENT_H
|
||||
#define BLACKGUI_SETTINGSCOMPONENT_H
|
||||
|
||||
//! \file
|
||||
|
||||
#include "blackgui/components/runtimebasedcomponent.h"
|
||||
#include <QTabWidget>
|
||||
#include <QModelIndex>
|
||||
@@ -88,40 +88,40 @@ namespace BlackGui
|
||||
private slots:
|
||||
|
||||
//! Network server selected
|
||||
void networkServerSelected(QModelIndex index);
|
||||
void ps_networkServerSelected(QModelIndex index);
|
||||
|
||||
//! Alter traffic server
|
||||
void alterTrafficServer();
|
||||
void ps_alterTrafficServer();
|
||||
|
||||
/*!
|
||||
* \brief Update the selected server textboxes
|
||||
* \param server to be displayed
|
||||
*/
|
||||
void updateGuiSelectedServerTextboxes(const BlackMisc::Network::CServer &server);
|
||||
void ps_updateGuiSelectedServerTextboxes(const BlackMisc::Network::CServer &server);
|
||||
|
||||
//! Selected server from textboxes
|
||||
BlackMisc::Network::CServer selectedServerFromTextboxes() const;
|
||||
BlackMisc::Network::CServer ps_selectedServerFromTextboxes() const;
|
||||
|
||||
//! Settings have been changed
|
||||
void changedSettings(uint typeValue);
|
||||
void ps_changedSettings(uint typeValue);
|
||||
|
||||
//! Save the Hotkeys
|
||||
void saveHotkeys();
|
||||
void ps_saveHotkeys();
|
||||
|
||||
//! Clear single hotkey
|
||||
void clearHotkey();
|
||||
void ps_clearHotkey();
|
||||
|
||||
//! start the MIC tests (Squelch)
|
||||
void startAudioTest();
|
||||
void ps_startAudioTest();
|
||||
|
||||
//! Audio test updates (timer) for progressbar and fetching results
|
||||
void audioTestUpdate();
|
||||
void ps_audioTestUpdate();
|
||||
|
||||
/*!
|
||||
* \brief Audio device selected
|
||||
* \param index audio device index (COM1, COM2)
|
||||
*/
|
||||
void audioDeviceSelected(int index);
|
||||
void ps_audioDeviceSelected(int index);
|
||||
|
||||
private:
|
||||
//! Audio test modes
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright (C) 2013
|
||||
* Swift Project Community / Contributors
|
||||
* 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,
|
||||
@@ -37,7 +37,6 @@ namespace BlackGui
|
||||
this->connect(this->ui->pb_SettingsFsxOpenSimconnectCfg, &QPushButton::clicked, this, &CSettingsFsxComponent::simConnectCfgFile);
|
||||
this->connect(this->ui->pb_SettingsFsxDeleteSimconnectCfg, &QPushButton::clicked, this, &CSettingsFsxComponent::simConnectCfgFile);
|
||||
this->connect(this->ui->pb_SettingsFsxExistsSimconncetCfg, &QPushButton::clicked, this, &CSettingsFsxComponent::simConnectCfgFile);
|
||||
|
||||
}
|
||||
|
||||
CSettingsFsxComponent::~CSettingsFsxComponent()
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKGUI_STYLESHEETUTILITY_H
|
||||
#define BLACKGUI_STYLESHEETUTILITY_H
|
||||
|
||||
//! \file
|
||||
|
||||
#include <QMap>
|
||||
#include <QObject>
|
||||
#include <QFont>
|
||||
@@ -28,7 +28,7 @@ namespace BlackGui
|
||||
//! Read the *.qss files
|
||||
bool read();
|
||||
|
||||
//! Style for file name
|
||||
//! Style for given file name
|
||||
QString style(const QString &fileName) const;
|
||||
|
||||
//! Multiple styles concatenated
|
||||
|
||||
Reference in New Issue
Block a user