Skip to content

Commit

Permalink
qml: setup AppMode in initerrormessage
Browse files Browse the repository at this point in the history
  • Loading branch information
jarolrod committed Jun 3, 2023
1 parent cfcfebc commit 8eac738
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/qml/bitcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<AppMode>("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()) {
Expand Down

0 comments on commit 8eac738

Please sign in to comment.