@@ -32,6 +32,18 @@ void SetupUIArgs(ArgsManager& argsman)
32
32
argsman.AddArg (" -resetguisettings" , " Reset all settings changed in the GUI" , ArgsManager::ALLOW_ANY, OptionsCategory::GUI);
33
33
argsman.AddArg (" -splash" , strprintf (" Show splash screen on startup (default: %u)" , DEFAULT_SPLASHSCREEN), ArgsManager::ALLOW_ANY, OptionsCategory::GUI);
34
34
}
35
+
36
+ bool InitErrorMessageBox (
37
+ const bilingual_str& message,
38
+ [[maybe_unused]] const std::string& caption,
39
+ [[maybe_unused]] unsigned int style)
40
+ {
41
+ QQmlApplicationEngine engine;
42
+ engine.rootContext ()->setContextProperty (" message" , QString::fromStdString (message.translated ));
43
+ engine.load (QUrl (QStringLiteral (" qrc:///qml/pages/initerrormessage.qml" )));
44
+ qGuiApp->exec ();
45
+ return false ;
46
+ }
35
47
} // namespace
36
48
37
49
@@ -42,6 +54,8 @@ int QmlGuiMain(int argc, char* argv[])
42
54
QGuiApplication::setAttribute (Qt::AA_EnableHighDpiScaling);
43
55
QGuiApplication app (argc, argv);
44
56
57
+ auto handler_message_box = ::uiInterface.ThreadSafeMessageBox_connect (InitErrorMessageBox);
58
+
45
59
// Parse command-line options. We do this after qt in order to show an error if there are problems parsing these.
46
60
SetupServerArgs (gArgs );
47
61
SetupUIArgs (gArgs );
@@ -68,6 +82,8 @@ int QmlGuiMain(int argc, char* argv[])
68
82
std::unique_ptr<interfaces::Node> node = interfaces::MakeNode (&node_context);
69
83
node->baseInitialize ();
70
84
85
+ handler_message_box.disconnect ();
86
+
71
87
NodeModel node_model;
72
88
InitExecutor init_executor{*node};
73
89
QObject::connect (&node_model, &NodeModel::requestedInitialize, &init_executor, &InitExecutor::initialize);
0 commit comments