mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-13 15:45:42 +08:00
refs #297 Removed old network settings.
This commit is contained in:
@@ -41,7 +41,6 @@ namespace BlackCore
|
||||
IContextNetwork(mode, runtime)
|
||||
{
|
||||
Q_ASSERT(this->getRuntime());
|
||||
Q_ASSERT(this->getIContextSettings());
|
||||
Q_ASSERT(this->getIContextOwnAircraft());
|
||||
Q_ASSERT(this->getIContextOwnAircraft()->isUsingImplementingObject());
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "blackmisc/simulation/remoteaircraftprovider.h"
|
||||
#include "blackmisc/aviation/atcstationlist.h"
|
||||
#include "blackmisc/aviation/aircraftsituationlist.h"
|
||||
#include "blackmisc/setnetwork.h"
|
||||
#include "blackmisc/network/clientlist.h"
|
||||
#include "blackmisc/digestsignal.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
@@ -248,14 +247,6 @@ namespace BlackCore
|
||||
CIcaoDataReader *m_icaoDataReader = nullptr;
|
||||
QTimer *m_dataUpdateTimer = nullptr; //!< general updates such as ATIS, frequencies, see requestDataUpdates()
|
||||
|
||||
//! Get network settings
|
||||
BlackMisc::Settings::CSettingsNetwork getNetworkSettings() const
|
||||
{
|
||||
Q_ASSERT(this->getRuntime());
|
||||
Q_ASSERT(this->getRuntime()->getIContextSettings());
|
||||
return this->getRuntime()->getIContextSettings()->getNetworkSettings();
|
||||
}
|
||||
|
||||
//! Own aircraft from \sa CContextOwnAircraft
|
||||
const BlackMisc::Simulation::CSimulatedAircraft ownAircraft() const;
|
||||
|
||||
|
||||
@@ -77,16 +77,6 @@ namespace BlackCore
|
||||
//! \copydoc CContext::getPathAndContextId()
|
||||
virtual QString getPathAndContextId() const { return this->buildPathAndContextId(ObjectPath()); }
|
||||
|
||||
/*!
|
||||
* \brief Path for network settings
|
||||
* \remarks no to be confused with DBus paths
|
||||
*/
|
||||
static const QString &PathNetworkSettings()
|
||||
{
|
||||
static QString s("network");
|
||||
return s;
|
||||
}
|
||||
|
||||
//! Path for audio settings
|
||||
static const QString &PathAudioSettings()
|
||||
{
|
||||
@@ -123,9 +113,6 @@ namespace BlackCore
|
||||
//! Handle value
|
||||
virtual BlackMisc::CStatusMessageList value(const QString &path, const QString &command, const BlackMisc::CVariant &value) = 0;
|
||||
|
||||
//! Network settings
|
||||
virtual BlackMisc::Settings::CSettingsNetwork getNetworkSettings() const = 0;
|
||||
|
||||
//! Audio settings
|
||||
virtual BlackMisc::Settings::CSettingsAudio getAudioSettings() const = 0;
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Settings;
|
||||
using namespace BlackMisc::Network;
|
||||
using namespace BlackMisc::Hardware;
|
||||
|
||||
namespace BlackCore
|
||||
@@ -46,18 +45,6 @@ namespace BlackCore
|
||||
}
|
||||
jsonFile.close();
|
||||
|
||||
// init network
|
||||
if (jsonObject.contains(IContextSettings::PathNetworkSettings()))
|
||||
{
|
||||
this->m_settingsNetwork.convertFromJson(
|
||||
jsonObject.value(IContextSettings::PathNetworkSettings()).toObject()
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->m_settingsNetwork.initDefaultValues();
|
||||
}
|
||||
|
||||
// init audio
|
||||
if (jsonObject.contains(IContextSettings::PathAudioSettings()))
|
||||
{
|
||||
@@ -122,7 +109,6 @@ namespace BlackCore
|
||||
CStatusMessage CContextSettings::reset(bool write)
|
||||
{
|
||||
this->m_hotkeys.initAsHotkeyList(true);
|
||||
this->m_settingsNetwork.initDefaultValues();
|
||||
this->m_settingsAudio.initDefaultValues();
|
||||
this->emitCompletelyChanged();
|
||||
if (write)
|
||||
@@ -147,7 +133,6 @@ namespace BlackCore
|
||||
QJsonDocument CContextSettings::toJsonDocument() const
|
||||
{
|
||||
QJsonObject jsonObject;
|
||||
jsonObject.insert(IContextSettings::PathNetworkSettings(), this->m_settingsNetwork.toJson());
|
||||
jsonObject.insert(IContextSettings::PathAudioSettings(), this->m_settingsAudio.toJson());
|
||||
jsonObject.insert(IContextSettings::PathHotkeys(), this->m_hotkeys.toJson());
|
||||
QJsonDocument doc(jsonObject);
|
||||
@@ -173,14 +158,6 @@ namespace BlackCore
|
||||
return this->m_hotkeys;
|
||||
}
|
||||
|
||||
/*
|
||||
* Network settings
|
||||
*/
|
||||
CSettingsNetwork CContextSettings::getNetworkSettings() const
|
||||
{
|
||||
return this->m_settingsNetwork;
|
||||
}
|
||||
|
||||
/*
|
||||
* Audio settings
|
||||
*/
|
||||
@@ -215,18 +192,9 @@ namespace BlackCore
|
||||
|
||||
// next level
|
||||
QString nextLevelPath = CSettingUtilities::removeLeadingPath(path);
|
||||
bool changed = false;
|
||||
if (path.startsWith(IContextSettings::PathNetworkSettings()))
|
||||
{
|
||||
msgs.push_back(this->m_settingsNetwork.value(nextLevelPath, command, value, changed));
|
||||
if (changed)
|
||||
{
|
||||
msgs.push_back(this->write());
|
||||
emit this->changedSettings(static_cast<uint>(SettingsNetwork));
|
||||
}
|
||||
}
|
||||
else if (path.startsWith(IContextSettings::PathAudioSettings()))
|
||||
if (path.startsWith(IContextSettings::PathAudioSettings()))
|
||||
{
|
||||
bool changed = false;
|
||||
msgs.push_back(this->m_settingsAudio.value(nextLevelPath, command, value, changed));
|
||||
if (changed)
|
||||
{
|
||||
|
||||
@@ -54,9 +54,6 @@ namespace BlackCore
|
||||
virtual BlackMisc::CStatusMessageList value(const QString &path, const QString &command, const BlackMisc::CVariant &value) override;
|
||||
|
||||
public slots:
|
||||
//! \copydoc IContextSettings::getNetworkSettings()
|
||||
virtual BlackMisc::Settings::CSettingsNetwork getNetworkSettings() const override;
|
||||
|
||||
//! \copydoc IContextSettings::getAudioSettings()
|
||||
virtual BlackMisc::Settings::CSettingsAudio getAudioSettings() const override;
|
||||
|
||||
@@ -82,7 +79,6 @@ namespace BlackCore
|
||||
//! settings directory
|
||||
const QString &getSettingsDirectory() const { return BlackMisc::Settings::CSettingUtilities::getSettingsDirectory(); }
|
||||
|
||||
BlackMisc::Settings::CSettingsNetwork m_settingsNetwork;
|
||||
BlackMisc::Settings::CSettingsAudio m_settingsAudio;
|
||||
BlackMisc::Settings::CSettingKeyboardHotkeyList m_hotkeys;
|
||||
QJsonDocument toJsonDocument() const;
|
||||
|
||||
@@ -41,14 +41,6 @@ namespace BlackCore
|
||||
Q_UNUSED(s);
|
||||
}
|
||||
|
||||
/*
|
||||
* Relay to DBus
|
||||
*/
|
||||
CSettingsNetwork CContextSettingsProxy::getNetworkSettings() const
|
||||
{
|
||||
return this->m_dBusInterface->callDBusRet<CSettingsNetwork>(QLatin1Literal("getNetworkSettings"));
|
||||
}
|
||||
|
||||
/*
|
||||
* Relay to DBus
|
||||
*/
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include "blackmisc/statusmessagelist.h"
|
||||
#include "blackmisc/genericdbusinterface.h"
|
||||
#include "blackmisc/settingutilities.h"
|
||||
#include "blackmisc/setnetwork.h"
|
||||
#include "blackmisc/hardware/keyboardkeylist.h"
|
||||
|
||||
namespace BlackCore
|
||||
@@ -44,9 +43,6 @@ namespace BlackCore
|
||||
CContextSettingsProxy(CRuntimeConfig::ContextMode mode, CRuntime *runtime) : IContextSettings(mode, runtime), m_dBusInterface(nullptr) {}
|
||||
|
||||
public slots:
|
||||
//! \copydoc IContextSettings::getNetworkSettings()
|
||||
virtual BlackMisc::Settings::CSettingsNetwork getNetworkSettings() const override;
|
||||
|
||||
//! \copydoc IContextSettings::getAudioSettings()
|
||||
virtual BlackMisc::Settings::CSettingsAudio getAudioSettings() const override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user