mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
Ref T731, AFV sample default value for user name
This commit is contained in:
committed by
Mat Sutcliffe
parent
89725c3bb4
commit
37a5da4e04
@@ -3,16 +3,22 @@
|
||||
#include "blackcore/afv/model/atcstationmodel.h"
|
||||
#include "blackcore/afv/model/afvmapreader.h"
|
||||
#include "blackcore/afv/clients/afvclient.h"
|
||||
|
||||
#include "blackcore/application.h"
|
||||
#include "blackmisc/network/user.h"
|
||||
#include "blackmisc/obfuscation.h"
|
||||
#include "blackconfig/buildconfig.h"
|
||||
|
||||
#include <QGuiApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QQmlContext>
|
||||
#include <QPointer>
|
||||
#include <QThread>
|
||||
#include <QTimer>
|
||||
|
||||
using namespace BlackConfig;
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Network;
|
||||
using namespace BlackCore;
|
||||
using namespace BlackCore::Afv::Clients;
|
||||
using namespace BlackCore::Afv::Model;
|
||||
|
||||
@@ -21,18 +27,27 @@ int main(int argc, char *argv[])
|
||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||
QGuiApplication qa(argc, argv);
|
||||
|
||||
BlackCore::CApplication a("sampleafvclient", CApplicationInfo::Sample);
|
||||
CApplication a("sampleafvclient", CApplicationInfo::Sample);
|
||||
|
||||
CAfvMapReader *afvMapReader = new CAfvMapReader(&a);
|
||||
afvMapReader->updateFromMap();
|
||||
|
||||
CAfvClient voiceClient("https://voice1.vatsim.uk");
|
||||
|
||||
// default user name
|
||||
QString defaultUserName("1234567");
|
||||
if (CBuildConfig::isLocalDeveloperDebugBuild())
|
||||
{
|
||||
CUser user("OBF:AwLZ7f9hUmpSZhm4=", "Joe Doe");
|
||||
defaultUserName = user.getId();
|
||||
}
|
||||
|
||||
QQmlApplicationEngine engine;
|
||||
QQmlContext *ctxt = engine.rootContext();
|
||||
ctxt->setContextProperty("afvMapReader", afvMapReader);
|
||||
ctxt->setContextProperty("voiceClient", &voiceClient);
|
||||
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
|
||||
ctxt->setContextProperty("userName", defaultUserName);
|
||||
|
||||
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
|
||||
return a.exec();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user