From faacd3d6a11efcb6dcf9a54ce55ed20e573b40f5 Mon Sep 17 00:00:00 2001 From: Jaquee Date: Thu, 23 Feb 2017 19:47:58 +0100 Subject: start daemon automatically and detached --- components/DaemonManagerDialog.qml | 60 ++++++++++++++++++-------------------- components/ProcessingSplash.qml | 4 +-- 2 files changed, 31 insertions(+), 33 deletions(-) (limited to 'components') diff --git a/components/DaemonManagerDialog.qml b/components/DaemonManagerDialog.qml index f07e982d..0780b513 100644 --- a/components/DaemonManagerDialog.qml +++ b/components/DaemonManagerDialog.qml @@ -39,12 +39,14 @@ Window { id: root modality: Qt.ApplicationModal flags: Qt.Window | Qt.FramelessWindowHint - + property int countDown: 5; signal rejected() signal started(); function open() { show() + countDown = 5; + timer.start(); } // TODO: implement without hardcoding sizes @@ -61,15 +63,29 @@ Window { //anchors {fill: parent; margins: 16 } Layout.alignment: Qt.AlignHCenter - Label { - text: qsTr("Daemon doesn't appear to be running") + Timer { + id: timer + interval: 1000; + running: false; + repeat: true + onTriggered: { + countDown--; + if(countDown < 0){ + running = false; + // Start daemon + root.close() + appWindow.startDaemon(persistentSettings.daemonFlags); + root.started(); + } + } + } + + Text { + text: qsTr("Starting Monero daemon in %1 seconds").arg(countDown); + font.pixelSize: 18 Layout.alignment: Qt.AlignHCenter - Layout.columnSpan: 2 Layout.fillWidth: true horizontalAlignment: Text.AlignHCenter - font.pixelSize: 24 - font.family: "Arial" - color: "#555555" } } @@ -81,57 +97,39 @@ Window { MoneroComponents.StandardButton { id: okButton - width: 120 + visible:false fontSize: 14 shadowReleasedColor: "#FF4304" shadowPressedColor: "#B32D00" releasedColor: "#FF6C3C" pressedColor: "#FF4304" - text: qsTr("Start daemon") + text: qsTr("Start daemon (%1)").arg(countDown) KeyNavigation.tab: cancelButton onClicked: { + timer.stop(); root.close() - appWindow.startDaemon(daemonFlags.text); + appWindow.startDaemon(persistentSettings.daemonFlags); root.started() } } MoneroComponents.StandardButton { id: cancelButton - width: 120 fontSize: 14 shadowReleasedColor: "#FF4304" shadowPressedColor: "#B32D00" releasedColor: "#FF6C3C" pressedColor: "#FF4304" - text: qsTr("Cancel") + text: qsTr("Use custom settings") onClicked: { + timer.stop(); root.close() root.rejected() } } } - RowLayout { - id: advancedRow - MoneroComponents.Label { - id: daemonFlagsLabel - color: "#4A4949" - text: qsTr("Daemon startup flags") + translationManager.emptyString - fontSize: 16 - } - - MoneroComponents.LineEdit { - id: daemonFlags - Layout.preferredWidth: 200 - Layout.fillWidth: true - text: appWindow.persistentSettings.daemonFlags; - placeholderText: qsTr("(optional)") - } - - } } - } diff --git a/components/ProcessingSplash.qml b/components/ProcessingSplash.qml index d8dc0e84..2f6725db 100644 --- a/components/ProcessingSplash.qml +++ b/components/ProcessingSplash.qml @@ -61,7 +61,7 @@ Window { id: messageTitle text: "Please wait..." font { - pointSize: 22 + pixelSize: 22 } horizontalAlignment: Text.AlignHCenter Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter @@ -72,7 +72,7 @@ Window { Text { id: heightProgress font { - pointSize: 18 + pixelSize: 18 } horizontalAlignment: Text.AlignHCenter Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter -- cgit v1.2.3