mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-31 00:36:19 +00:00
a710558c6b
Contains minimal account creation and login Considerations: - migrated status-go wrapper and login code from the fix/cpp-structure (241eec) - Minimal refactoring and changes at the moment. Expect further refactoring follow up to reach the desired state. - Fix missing keychain initialization - Fix accounts DB initialization call done by startup -> Controller.openedAccounts -> status-go.OpenAccounts calls - Small refactoring and todos for other steps - fix SignalsManager - fix async access to dereferenced status-go memory from SignalsManager - fix SignalsManager not starting when registering - finish dev end to end test for create account and login - small improvements and added TODOs for future work - add onboarding test helpers and start messaging test - Refactoring towards Login UI integration Closes: #5909 Closes: #6028
62 lines
1.8 KiB
C++
62 lines
1.8 KiB
C++
#include <QGuiApplication>
|
|
#include <QQmlApplicationEngine>
|
|
|
|
#include <QLocale>
|
|
#include <QTranslator>
|
|
|
|
#include <Helpers/helpers.h>
|
|
#include <Helpers/logs.h>
|
|
|
|
#include <QDir>
|
|
#include <QDebug>
|
|
|
|
using namespace Status;
|
|
|
|
void setApplicationInformation(QGuiApplication& app);
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
//qInstallMessageHandler(Helpers::logFormatter);
|
|
|
|
QGuiApplication app(argc, argv);
|
|
|
|
setApplicationInformation(app);
|
|
|
|
QTranslator translator;
|
|
const QStringList uiLanguages = QLocale::system().uiLanguages();
|
|
for (const QString &locale : uiLanguages) {
|
|
const QString baseName = BUILD_PROJECT_NAME + QLocale(locale).name();
|
|
if (translator.load(":/i18n/" + baseName)) {
|
|
app.installTranslator(&translator);
|
|
break;
|
|
}
|
|
}
|
|
|
|
QQmlApplicationEngine engine;
|
|
|
|
const QUrl url(u"qrc:/Status/Application/qml/main.qml"_qs);
|
|
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
|
|
&app, [url](QObject *obj, const QUrl &objUrl) {
|
|
if (!obj && url == objUrl)
|
|
QCoreApplication::exit(-1);
|
|
}, Qt::QueuedConnection);
|
|
engine.load(url);
|
|
|
|
return app.exec();
|
|
}
|
|
|
|
void setApplicationInformation(QGuiApplication& app) {
|
|
#if !defined BUILD_PROJECT_ORGANIZATION_NAME
|
|
static_assert(false, "Compile-time define missing: BUILD_PROJECT_ORGANIZATION_NAME")
|
|
#endif
|
|
app.setOrganizationName(BUILD_PROJECT_ORGANIZATION_NAME);
|
|
#if !defined BUILD_PROJECT_ORGANIZATION_DOMAIN
|
|
static_assert(false, "Compile-time define missing: BUILD_PROJECT_ORGANIZATION_DOMAIN")
|
|
#endif
|
|
app.setOrganizationDomain(BUILD_PROJECT_ORGANIZATION_DOMAIN);
|
|
#if !defined BUILD_PROJECT_APPLICATION_NAME
|
|
static_assert(false, "Compile-time define missing: BUILD_PROJECT_APPLICATION_NAME")
|
|
#endif
|
|
app.setApplicationName(BUILD_PROJECT_APPLICATION_NAME);
|
|
}
|