Skip to content

Commit 3a98d9f

Browse files
committed
copy qt/main.cpp and remove legacy GUI logic
1 parent a1e1ef8 commit 3a98d9f

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

main.cpp

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Copyright (c) 2018-2022 The Bitcoin Core developers
2+
// Distributed under the MIT software license, see the accompanying
3+
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4+
5+
#include <bitcoin-build-config.h> // IWYU pragma: keep
6+
7+
#include <qml/bitcoin.h>
8+
9+
#include <compat/compat.h>
10+
#include <interfaces/node.h>
11+
#include <logging.h>
12+
#include <noui.h>
13+
#include <util/translation.h>
14+
15+
#include <QCoreApplication>
16+
17+
#include <functional>
18+
#include <string>
19+
20+
#if defined(QT_STATICPLUGIN)
21+
#include <QtPlugin>
22+
#if defined(QT_QPA_PLATFORM_XCB)
23+
Q_IMPORT_PLUGIN(QXcbIntegrationPlugin);
24+
#elif defined(QT_QPA_PLATFORM_WINDOWS)
25+
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin);
26+
#elif defined(QT_QPA_PLATFORM_COCOA)
27+
Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin);
28+
#elif defined(QT_QPA_PLATFORM_ANDROID)
29+
Q_IMPORT_PLUGIN(QAndroidPlatformIntegrationPlugin)
30+
#endif
31+
#endif
32+
33+
/** Translate string to current locale using Qt. */
34+
extern const TranslateFn G_TRANSLATION_FUN = [](const char* psz) {
35+
return QCoreApplication::translate("bitcoin-core", psz).toStdString();
36+
};
37+
38+
const std::function<std::string()> G_TEST_GET_FULL_NAME{};
39+
40+
MAIN_FUNCTION
41+
{
42+
// Subscribe to global signals from core.
43+
noui_connect();
44+
45+
return QmlGuiMain(argc, argv);
46+
}

0 commit comments

Comments
 (0)