diff --git a/programs/CMakeLists.txt b/programs/CMakeLists.txt index 32a80b91..19267c02 100644 --- a/programs/CMakeLists.txt +++ b/programs/CMakeLists.txt @@ -7,3 +7,7 @@ set(BUILD_QT_GUI FALSE CACHE BOOL "Build the Qt-based light client GUI") if(BUILD_QT_GUI) add_subdirectory(light_client) endif() +set(BUILD_WEB_NODE FALSE CACHE BOOL "Build the Qt-based full node with web GUI") +if(BUILD_WEB_NODE) + add_subdirectory(full_web_node) +endif() diff --git a/programs/full_web_node/CMakeLists.txt b/programs/full_web_node/CMakeLists.txt new file mode 100644 index 00000000..c758eaaf --- /dev/null +++ b/programs/full_web_node/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 2.8.11) + +project(full_web_node) + +# Find includes in corresponding build directories +set(CMAKE_INCLUDE_CURRENT_DIR ON) +# Instruct CMake to run moc automatically when needed. +#set(CMAKE_AUTOMOC ON) + +find_package(Qt5Core) +find_package(Qt5Quick) +find_package(Qt5WebEngine) + +file(GLOB QML qml/*) +qt5_add_resources(QML_QRC qml/qml.qrc) + +add_executable(full_web_node main.cpp ${QML_QRC} ${QML}) + +target_link_libraries(full_web_node PRIVATE Qt5::Core Qt5::Quick Qt5::WebEngine graphene_chain graphene_egenesis_brief graphene_utilities fc graphene_app ) + +install( TARGETS + full_web_node + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) diff --git a/programs/full_web_node/main.cpp b/programs/full_web_node/main.cpp new file mode 100644 index 00000000..949270da --- /dev/null +++ b/programs/full_web_node/main.cpp @@ -0,0 +1,24 @@ +#include + +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + fc::thread::current().set_name("main"); + QGuiApplication app(argc, argv); + app.setApplicationName("Graphene Client"); + app.setApplicationDisplayName(app.applicationName()); + app.setOrganizationDomain("cryptonomex.org"); + app.setOrganizationName("Cryptonomex, Inc."); + + QtWebEngine::initialize(); + QQmlApplicationEngine engine; + engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); + + return app.exec(); +} + +#include "main.moc" diff --git a/programs/full_web_node/qml/main.qml b/programs/full_web_node/qml/main.qml new file mode 100644 index 00000000..1368fbda --- /dev/null +++ b/programs/full_web_node/qml/main.qml @@ -0,0 +1,13 @@ +import QtQuick 2.5 +import QtQuick.Window 2.2 +import QtWebEngine 1.0 + +Window { + width: 800 + height: 600 + visible: true + + WebEngineView { + anchors.fill: parent + } +} diff --git a/programs/full_web_node/qml/qml.qrc b/programs/full_web_node/qml/qml.qrc new file mode 100644 index 00000000..0ff3892d --- /dev/null +++ b/programs/full_web_node/qml/qml.qrc @@ -0,0 +1,6 @@ + + + main.qml + + +