diff options
| author | Jaquee <jaquee.monero@gmail.com> | 2017-02-23 19:47:58 +0100 |
|---|---|---|
| committer | Jaquee <jaquee.monero@gmail.com> | 2017-02-23 19:52:06 +0100 |
| commit | faacd3d6a11efcb6dcf9a54ce55ed20e573b40f5 (patch) | |
| tree | ed5d7ba5a02dcdc5d705b71075e2d0f8bc03c9f6 /components/DaemonManagerDialog.qml | |
| parent | c6688dc876d4ab8e0cea6f34f4607bf3be9a3648 (diff) | |
| download | monzero-gui-faacd3d6a11efcb6dcf9a54ce55ed20e573b40f5.tar.gz monzero-gui-faacd3d6a11efcb6dcf9a54ce55ed20e573b40f5.tar.xz monzero-gui-faacd3d6a11efcb6dcf9a54ce55ed20e573b40f5.zip | |
start daemon automatically and detached
Diffstat (limited to 'components/DaemonManagerDialog.qml')
| -rw-r--r-- | components/DaemonManagerDialog.qml | 60 |
1 files changed, 29 insertions, 31 deletions
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)") - } - - } } - } |
