mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
refs #478, setup class used in GUI components
This commit is contained in:
committed by
Mathew Sutcliffe
parent
53ba50dd3a
commit
166963af5b
@@ -16,9 +16,9 @@
|
||||
#include "blackcore/context_simulator.h"
|
||||
#include "blackcore/network.h"
|
||||
#include "blackcore/simulator.h"
|
||||
#include "blackcore/settings/global_network_settings.h"
|
||||
#include "blackcore/setupreader.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "../uppercasevalidator.h"
|
||||
#include "blackgui/uppercasevalidator.h"
|
||||
#include <QIntValidator>
|
||||
|
||||
using namespace BlackMisc;
|
||||
@@ -26,7 +26,7 @@ using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::Network;
|
||||
using namespace BlackMisc::Simulation;
|
||||
using namespace BlackCore;
|
||||
using namespace BlackCore::Settings;
|
||||
using namespace BlackCore::Data;
|
||||
using namespace BlackGui;
|
||||
|
||||
namespace BlackGui
|
||||
@@ -145,9 +145,9 @@ namespace BlackGui
|
||||
CServerList otherServers = this->m_trafficNetworkServers.get();
|
||||
|
||||
// add a testserver when no servers can be loaded
|
||||
if (otherServers.isEmpty() && CProject::isDebugBuild())
|
||||
if (otherServers.isEmpty() && CProject::isRunningInBetaOrDeveloperEnvironment())
|
||||
{
|
||||
otherServers.push_back(CGlobalNetworkSettings::instance().swiftFsdTestServer());
|
||||
otherServers.push_back(m_setup.get().fsdTestServers());
|
||||
}
|
||||
this->ui->cbp_OtherServers->setServers(otherServers);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include "blackgui/components/enableforruntime.h"
|
||||
#include "blackcore/data/globalsetup.h"
|
||||
#include "blackcore/settings/network.h"
|
||||
#include "blackmisc/network/server.h"
|
||||
#include "blackmisc/network/entityflags.h"
|
||||
@@ -148,6 +149,7 @@ namespace BlackGui
|
||||
const int LogoffIntervalSeconds = 10;
|
||||
QTimer *m_logoffCountdownTimer { nullptr };
|
||||
BlackCore::CSetting<BlackCore::Settings::Network::TrafficServers> m_trafficNetworkServers { this };
|
||||
BlackCore::CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< setup cache
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -11,14 +11,14 @@
|
||||
#include "ui_settingsnetworkserverscomponent.h"
|
||||
#include "blackcore/context_network.h"
|
||||
#include "blackcore/context_settings.h"
|
||||
#include "blackcore/settings/global_network_settings.h"
|
||||
#include "blackcore/setupreader.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/project.h"
|
||||
#include "blackmisc/settingsblackmiscclasses.h"
|
||||
#include <QModelIndex>
|
||||
|
||||
using namespace BlackCore;
|
||||
using namespace BlackCore::Settings;
|
||||
using namespace BlackCore::Data;
|
||||
using namespace BlackGui;
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Network;
|
||||
@@ -50,11 +50,11 @@ namespace BlackGui
|
||||
{
|
||||
CServerList serverList(m_trafficNetworkServers.get());
|
||||
|
||||
// add swift test server in case we have no servers
|
||||
// add swift test server in case we have no servers:
|
||||
// this is debug/bootstrap feature we can continue to test when something goes wrong
|
||||
if (serverList.isEmpty() && CProject::isDebugBuild())
|
||||
if (serverList.isEmpty() && CProject::isRunningInBetaOrDeveloperEnvironment())
|
||||
{
|
||||
serverList.push_back(CGlobalNetworkSettings::instance().swiftFsdTestServer());
|
||||
serverList.push_back(m_setup.get().fsdTestServers());
|
||||
}
|
||||
this->ui->tvp_SettingsTnServers->updateContainer(serverList);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include "blackgui/components/enableforruntime.h"
|
||||
#include "blackcore/data/globalsetup.h"
|
||||
#include "blackcore/settings/network.h"
|
||||
#include <QFrame>
|
||||
#include <QScopedPointer>
|
||||
@@ -52,6 +53,7 @@ namespace BlackGui
|
||||
private:
|
||||
QScopedPointer<Ui::CSettingsNetworkServersComponent> ui;
|
||||
BlackCore::CSetting<BlackCore::Settings::Network::TrafficServers> m_trafficNetworkServers { this };
|
||||
BlackCore::CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< setup cache
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
Reference in New Issue
Block a user