diff options
author | Benjamin Dobell <benjamin.dobell+git@glassechidna.com.au> | 2015-03-05 19:15:46 +0100 |
---|---|---|
committer | Benjamin Dobell <benjamin.dobell+git@glassechidna.com.au> | 2015-03-05 19:15:46 +0100 |
commit | 7253fb5794bd06f7227eacf9df9c3ca9f8108a07 (patch) | |
tree | 856d97cffebf5d09dc1a9995781e3a21efc32b9e /heimdall-frontend | |
parent | Actually fix #261 (CMake Linux detection) (diff) | |
download | Heimdall-7253fb5794bd06f7227eacf9df9c3ca9f8108a07.tar Heimdall-7253fb5794bd06f7227eacf9df9c3ca9f8108a07.tar.gz Heimdall-7253fb5794bd06f7227eacf9df9c3ca9f8108a07.tar.bz2 Heimdall-7253fb5794bd06f7227eacf9df9c3ca9f8108a07.tar.lz Heimdall-7253fb5794bd06f7227eacf9df9c3ca9f8108a07.tar.xz Heimdall-7253fb5794bd06f7227eacf9df9c3ca9f8108a07.tar.zst Heimdall-7253fb5794bd06f7227eacf9df9c3ca9f8108a07.zip |
Diffstat (limited to 'heimdall-frontend')
-rw-r--r-- | heimdall-frontend/CMakeLists.txt | 26 | ||||
-rw-r--r-- | heimdall-frontend/mainwindow.qrc | 4 | ||||
-rw-r--r-- | heimdall-frontend/source/main.cpp | 7 | ||||
-rw-r--r-- | heimdall-frontend/source/qml/DropFiles.qml | 7 | ||||
-rw-r--r-- | heimdall-frontend/source/qml/DropFilesForm.ui.qml | 60 | ||||
-rw-r--r-- | heimdall-frontend/source/qml/Root.qml | 7 | ||||
-rw-r--r-- | heimdall-frontend/source/qml/RootForm.ui.qml | 73 | ||||
-rw-r--r-- | heimdall-frontend/source/qml/drop_zone.svg | 101 | ||||
-rw-r--r-- | heimdall-frontend/source/qml/main.qml | 63 | ||||
-rw-r--r-- | heimdall-frontend/source/qml/qml.qrc | 9 | ||||
-rw-r--r-- | heimdall-frontend/source/qml/resources.qrc | 5 |
11 files changed, 349 insertions, 13 deletions
diff --git a/heimdall-frontend/CMakeLists.txt b/heimdall-frontend/CMakeLists.txt index 95889b3..7cf87fe 100644 --- a/heimdall-frontend/CMakeLists.txt +++ b/heimdall-frontend/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.11) project(heimdall-frontend) @@ -8,6 +8,8 @@ set(LIBPIT_INCLUDE_DIRS set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) # moc files are generated in build (current) directory +find_package(Qt5Qml REQUIRED) +find_package(Qt5Quick REQUIRED) find_package(Qt5Widgets REQUIRED) find_package(ZLIB REQUIRED) @@ -28,17 +30,26 @@ set(HEIMDALL_FRONTEND_SOURCE_FILES source/PackageData.cpp source/Packaging.cpp) +set(HEIMDALL_FRONTEND_QML_FILES + source/qml/main.qml + source/qml/Root.qml + source/qml/RootForm.ui.qml + source/qml/DropFiles.qml + source/qml/DropFilesForm.ui.qml) + qt5_wrap_ui(HEIMDALL_FRONTEND_FORMS mainwindow.ui aboutform.ui) qt5_add_resources(HEIMDALL_FRONTEND_RESOURCES - mainwindow.qrc) + source/qml/qml.qrc + source/qml/resources.qrc) add_executable(heimdall-frontend WIN32 MACOSX_BUNDLE ${HEIMDALL_FRONTEND_SOURCE_FILES} - ${HEIMDALL_FRONTEND_FORMS} + ${HEIMDALL_FRONTEND_FORMS} # So IDEs know about forms + ${HEIMDALL_FRONTEND_QML_FILES} # So IDEs know about QML ${HEIMDALL_FRONTEND_RESOURCES}) include(LargeFiles) @@ -47,6 +58,9 @@ use_large_files(heimdall-frontend YES) set_property(TARGET heimdall-frontend APPEND PROPERTY COMPILE_DEFINITIONS "QT_LARGEFILE_SUPPORT") -target_link_libraries(heimdall-frontend pit) -target_link_libraries(heimdall-frontend Qt5::Widgets) -target_link_libraries(heimdall-frontend z) +target_link_libraries(heimdall-frontend + pit + Qt5::Qml + Qt5::Quick + Qt5::Widgets + z) diff --git a/heimdall-frontend/mainwindow.qrc b/heimdall-frontend/mainwindow.qrc deleted file mode 100644 index 4479bd9..0000000 --- a/heimdall-frontend/mainwindow.qrc +++ /dev/null @@ -1,4 +0,0 @@ -<RCC>
- <qresource prefix="MainWindow">
- </qresource>
-</RCC>
diff --git a/heimdall-frontend/source/main.cpp b/heimdall-frontend/source/main.cpp index 5d70e28..6373006 100644 --- a/heimdall-frontend/source/main.cpp +++ b/heimdall-frontend/source/main.cpp @@ -20,12 +20,13 @@ // Qt
#include <QApplication>
-#include <QtPlugin>
+#include <QQmlApplicationEngine>
// Heimdall Frontend
#include "mainwindow.h"
#if defined(QT_STATIC)
+#include <QtPlugin>
Q_IMPORT_PLUGIN (QWindowsIntegrationPlugin);
#endif
@@ -35,8 +36,8 @@ int main(int argc, char *argv[]) {
QApplication application(argc, argv);
- MainWindow window;
- window.show();
+ QQmlApplicationEngine engine;
+ engine.load(QUrl(QString("qrc:/main.qml")));
return (application.exec());
}
diff --git a/heimdall-frontend/source/qml/DropFiles.qml b/heimdall-frontend/source/qml/DropFiles.qml new file mode 100644 index 0000000..ac5c7a7 --- /dev/null +++ b/heimdall-frontend/source/qml/DropFiles.qml @@ -0,0 +1,7 @@ +import QtQuick 2.4 +import QtQuick.Controls 1.3 +import QtQuick.Layouts 1.1 + +DropFilesForm { + signal nextPressed(var files) +} diff --git a/heimdall-frontend/source/qml/DropFilesForm.ui.qml b/heimdall-frontend/source/qml/DropFilesForm.ui.qml new file mode 100644 index 0000000..3c9dd00 --- /dev/null +++ b/heimdall-frontend/source/qml/DropFilesForm.ui.qml @@ -0,0 +1,60 @@ +import QtQuick 2.4 +import QtQuick.Controls 1.3 +import QtQuick.Layouts 1.1 + +Rectangle { + Layout.preferredWidth: 420 + Layout.preferredHeight: 440 + color: "#eeeeee" + + DropArea { + id: dropFilesArea + } + + Column { + id: dropFilesColumn + spacing: 12 + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + + Text { + id: dragFilesText + text: qsTr("Drop firmware files here") + opacity: 1 + anchors.horizontalCenter: parent.horizontalCenter + wrapMode: Text.WordWrap + horizontalAlignment: Text.AlignLeft + font.pixelSize: 18 + } + + Image { + id: image1 + width: 100 + height: 100 + opacity: 1 + anchors.horizontalCenter: parent.horizontalCenter + source: "drop_zone.svg" + } + + Button { + id: browseButton + text: qsTr("Browse") + isDefault: true + anchors.horizontalCenter: parent.horizontalCenter + } + } + + Button { + id: flashButton + x: 556 + y: 606 + text: qsTr("Next") + visible: false + enabled: true + isDefault: true + anchors.bottom: parent.bottom + anchors.bottomMargin: 8 + anchors.right: parent.right + anchors.rightMargin: 8 + } +} diff --git a/heimdall-frontend/source/qml/Root.qml b/heimdall-frontend/source/qml/Root.qml new file mode 100644 index 0000000..9dae2f6 --- /dev/null +++ b/heimdall-frontend/source/qml/Root.qml @@ -0,0 +1,7 @@ +import QtQuick 2.4 +import QtQuick.Controls 1.3 +import QtQuick.Layouts 1.1 + +RootForm { + signal commenceFlash (var files) +} diff --git a/heimdall-frontend/source/qml/RootForm.ui.qml b/heimdall-frontend/source/qml/RootForm.ui.qml new file mode 100644 index 0000000..bc97a58 --- /dev/null +++ b/heimdall-frontend/source/qml/RootForm.ui.qml @@ -0,0 +1,73 @@ +import QtQuick 2.4 +import QtQuick.Controls 1.3 +import QtQuick.Layouts 1.1 + +Rectangle { + id: rectangle1 + width: 620 + height: 460 + color: "#eeeeee" + + RowLayout { + id: rowLayout1 + anchors.fill: parent + + Rectangle { + id: rectangle6 + color: "#222222" + width: 180 + anchors.top: parent.top + anchors.topMargin: 0 + anchors.bottom: parent.bottom + anchors.bottomMargin: 0 + + ListView { + id: listView1 + anchors.fill: parent + delegate: Item { + anchors.right: parent.right + anchors.rightMargin: 0 + anchors.left: parent.left + anchors.leftMargin: 0 + height: 40 + Row { + spacing: 8 + + Rectangle { + width: 40 + height: 40 + color: colorCode + } + + Text { + text: name + color: '#eeeeee' + anchors.verticalCenter: parent.verticalCenter + } + } + } + model: ListModel { + ListElement { + name: "Load Firmware" + colorCode: "red" + } + + ListElement { + name: "Utilities" + colorCode: "blue" + } + + ListElement { + name: "Configuration" + colorCode: "green" + } + } + } + } + DropFiles { + id: dropFiles1 + Layout.fillWidth: true + } + } + +} diff --git a/heimdall-frontend/source/qml/drop_zone.svg b/heimdall-frontend/source/qml/drop_zone.svg new file mode 100644 index 0000000..6e92752 --- /dev/null +++ b/heimdall-frontend/source/qml/drop_zone.svg @@ -0,0 +1,101 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + version="1.1" + id="svg2" + viewBox="0 0 283.99999 284.00001" + height="80.151115mm" + width="80.151108mm"> + <defs + id="defs4" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + transform="translate(-100,-368.3622)" + id="layer1"> + <path + style="fill:none;stroke:#000000;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 50.484269,332.85614 358.591241,0 c 1.18653,0 2.14176,0.95523 2.14176,2.14176 l 0,21.71648 c 0,1.18654 -0.95523,2.14176 -2.14176,2.14176 l -358.591241,0 c -1.186535,0 -2.14176,-0.95522 -2.14176,-2.14176 l 0,-21.71648 c 0,-1.18653 0.955225,-2.14176 2.14176,-2.14176 z" + id="use4346" /> + <g + id="g4725"> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:24;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 229.00018,640.36219 -45.57161,2e-5 c -1.83329,0 -3.65003,-0.0684 -5.4478,-0.20273" + id="path4335" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:24;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 306.01924,640.15948 c -1.79778,0.13435 -3.61452,0.20273 -5.44781,0.20273 l -45.57162,0" + id="path4344" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:24;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 254.99981,380.3622 45.57162,1e-5 c 1.8333,0 3.65005,0.0684 5.44783,0.20273" + id="path4331" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:24;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 177.98074,380.56494 c 1.79779,-0.13435 3.61453,-0.20273 5.44783,-0.20273 l 0,0 45.57162,0" + id="path4324" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:24;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 119.24921,420.30314 c 6.9574,-14.21373 18.49245,-25.74597 32.70826,-32.69981" + id="path4495" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:24;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 112,497.36121 0,-45.57042 c 0,-1.84511 0.0693,-3.67344 0.20533,-5.48256" + id="path4516" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:24;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 112.20519,574.41425 C 112.06921,572.60577 112,570.77809 112,568.93364 l 0,-45.57239" + id="path4509" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:24;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 151.95747,633.1211 c -14.21633,-6.9541 -25.7517,-18.48692 -32.70901,-32.70137" + id="path4320" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:24;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 364.75154,600.41974 c -6.95731,14.21443 -18.49269,25.74726 -32.70901,32.70135" + id="path4502" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:24;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 371.99999,523.36125 372,568.93364 c 0,1.84445 -0.0692,3.67213 -0.20519,5.48061" + id="path4529" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:24;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 371.79467,446.30823 c 0.13607,1.80912 0.20533,3.63745 0.20533,5.48256 l 0,45.57042" + id="path4488" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:24;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 332.04253,387.60333 c 14.21581,6.95384 25.75086,18.48608 32.70826,32.69982" + id="path4340" /> + </g> + <g + transform="translate(0.4559,-29.35596)" + id="g4540"> + <path + style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:24;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 296.5441,540.71816 -55,54 -55,-54" + id="rect4535" /> + <rect + style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:24;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4538" + width="52" + height="55" + x="216.48572" + y="489.70319" /> + </g> + </g> +</svg> diff --git a/heimdall-frontend/source/qml/main.qml b/heimdall-frontend/source/qml/main.qml new file mode 100644 index 0000000..a6bb483 --- /dev/null +++ b/heimdall-frontend/source/qml/main.qml @@ -0,0 +1,63 @@ +import QtQuick 2.4 +import QtQuick.Controls 1.3 +import QtQuick.Window 2.2 +import QtQuick.Dialogs 1.2 +import QtQuick.Layouts 1.1 + +ApplicationWindow { + title: qsTr("Heimdall Frontend") + minimumWidth: 620 + minimumHeight: 460 + width: 640 + height: 480 + visible: true + + menuBar: MenuBar { + Menu { + title: qsTr("&File") + MenuItem { + text: qsTr("&Open") + onTriggered: messageDialog.show(qsTr("Open action triggered")); + } + MenuItem { + text: qsTr("E&xit") + onTriggered: Qt.quit(); + } + } + } + + StackView { + id: stack + initialItem: root + anchors.fill: parent + + Root { + id: root + anchors.fill: parent + } + + function transitionFinished(properties) + { + properties.exitItem.x = 0 + } + + delegate: StackViewDelegate { + pushTransition: StackViewTransition { + PropertyAnimation { + target: enterItem + property: "x" + from: target.width + to: 0 + duration: 300 + } + PropertyAnimation { + target: exitItem + property: "x" + from: 0 + to: target.width + duration: 300 + } + } + } + } +} diff --git a/heimdall-frontend/source/qml/qml.qrc b/heimdall-frontend/source/qml/qml.qrc new file mode 100644 index 0000000..5dbe3d0 --- /dev/null +++ b/heimdall-frontend/source/qml/qml.qrc @@ -0,0 +1,9 @@ +<RCC> + <qresource prefix="/"> + <file>main.qml</file> + <file>Root.qml</file> + <file>RootForm.ui.qml</file> + <file>DropFiles.qml</file> + <file>DropFilesForm.ui.qml</file> + </qresource> +</RCC>
\ No newline at end of file diff --git a/heimdall-frontend/source/qml/resources.qrc b/heimdall-frontend/source/qml/resources.qrc new file mode 100644 index 0000000..4d9d39e --- /dev/null +++ b/heimdall-frontend/source/qml/resources.qrc @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="/"> + <file>drop_zone.svg</file> + </qresource> +</RCC>
\ No newline at end of file |