From 8441df260ca6b0db9a25b275a47f2fabbf1c7b88 Mon Sep 17 00:00:00 2001 From: Nathan Hourt Date: Fri, 10 Jul 2015 18:54:54 -0400 Subject: [PATCH] [GUI] Remove MainForm.qml, persist geometry --- programs/light_client/qml/MainForm.qml | 45 -------------------------- programs/light_client/qml/main.qml | 36 +++++++++++---------- programs/light_client/qml/qml.qrc | 1 - 3 files changed, 19 insertions(+), 63 deletions(-) delete mode 100644 programs/light_client/qml/MainForm.qml diff --git a/programs/light_client/qml/MainForm.qml b/programs/light_client/qml/MainForm.qml deleted file mode 100644 index 04c2d926..00000000 --- a/programs/light_client/qml/MainForm.qml +++ /dev/null @@ -1,45 +0,0 @@ -import QtQuick 2.5 -import QtQuick.Controls 1.4 -import QtQuick.Layouts 1.2 - -Item { - id: item1 - width: 640 - height: 480 - - property alias button1: button1 - property alias button2: button2 - - ColumnLayout { - id: columnLayout1 - width: parent.width / 2 - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizontalCenter - - RowLayout { - id: buttonRow - Layout.fillWidth: true - - Button { - id: button1 - text: qsTr("Press Me 1") - } - Item { Layout.fillWidth: true } - Button { - id: button2 - text: qsTr("Press Me 2") - } - } - - Slider { - id: slider - Layout.fillWidth: true - } - ProgressBar { - id: progressBar1 - value: Math.sin(Math.PI * slider.value) - Layout.fillWidth: true - } - } -} - diff --git a/programs/light_client/qml/main.qml b/programs/light_client/qml/main.qml index 49202020..7ea0739c 100644 --- a/programs/light_client/qml/main.qml +++ b/programs/light_client/qml/main.qml @@ -2,9 +2,12 @@ import QtQuick 2.5 import QtQuick.Controls 1.4 import QtQuick.Dialogs 1.2 +import Qt.labs.settings 1.0 + import Graphene.Client 0.1 ApplicationWindow { + id: window visible: true width: 640 height: 480 @@ -26,26 +29,25 @@ ApplicationWindow { DataModel { id: model - objectName: "model" + } + Settings { + id: appSettings + category: "appSettings" } - MainForm { - id: form - anchors.fill: parent - button1.onClicked: { - console.log(JSON.stringify(model.getAccount(3))) - messageDialog.show(qsTr("Account name is %1").arg(model.getAccount(3).name)) - } - button2.onClicked: messageDialog.show(qsTr("Account name is %1").arg(model.getAccount("steve").name)) + Label { + anchors.centerIn: parent + font.pointSize: 75 + text: "Dashboard goes here" + opacity: .5 } - MessageDialog { - id: messageDialog - title: qsTr("May I have your attention, please?") - - function show(caption) { - messageDialog.text = caption; - messageDialog.open(); - } + // This Settings is only for geometry -- it doesn't get an id. See appSettings for normal settings + Settings { + category: "windowGeometry" + property alias x: window.x + property alias y: window.y + property alias width: window.width + property alias height: window.height } } diff --git a/programs/light_client/qml/qml.qrc b/programs/light_client/qml/qml.qrc index a9442bbc..0ff3892d 100644 --- a/programs/light_client/qml/qml.qrc +++ b/programs/light_client/qml/qml.qrc @@ -1,7 +1,6 @@ main.qml - MainForm.qml