From 8eac7382796f6e976ba52c339ebd7e1fa3466489 Mon Sep 17 00:00:00 2001 From: jarolrod Date: Sat, 3 Jun 2023 00:41:37 -0400 Subject: [PATCH] qml: setup AppMode in initerrormessage --- src/qml/bitcoin.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/qml/bitcoin.cpp b/src/qml/bitcoin.cpp index 065e9b9bdd..34fe815128 100644 --- a/src/qml/bitcoin.cpp +++ b/src/qml/bitcoin.cpp @@ -77,6 +77,13 @@ bool InitErrorMessageBox( [[maybe_unused]] unsigned int style) { QQmlApplicationEngine engine; +#ifdef __ANDROID__ + AppMode app_mode(AppMode::MOBILE); +#else + AppMode app_mode(AppMode::DESKTOP); +#endif // __ANDROID__ + + qmlRegisterSingletonInstance("org.bitcoincore.qt", 1, 0, "AppMode", &app_mode); engine.rootContext()->setContextProperty("message", QString::fromStdString(message.translated)); engine.load(QUrl(QStringLiteral("qrc:///qml/pages/initerrormessage.qml"))); if (engine.rootObjects().isEmpty()) {