From 808ecf57ac655152cbd2322c5d3459ab067a1f72 Mon Sep 17 00:00:00 2001 From: xiphon Date: Tue, 6 Nov 2018 02:50:57 +0000 Subject: [PATCH 1/2] settings-node: implement correct 'Start/Stop daemon' button logic --- pages/settings/SettingsNode.qml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pages/settings/SettingsNode.qml b/pages/settings/SettingsNode.qml index 0e9bccfb..f6ef7e08 100644 --- a/pages/settings/SettingsNode.qml +++ b/pages/settings/SettingsNode.qml @@ -383,7 +383,7 @@ Rectangle{ Rectangle { id: rectStopNode - color: MoneroComponents.Style.buttonBackgroundColorDisabled + color: MoneroComponents.Style.buttonBackgroundColor width: btnStopNode.width + 40 height: 24 radius: 2 @@ -396,14 +396,18 @@ Rectangle{ font.family: MoneroComponents.Style.fontRegular.name font.pixelSize: 14 * scaleRatio font.bold: true - text: qsTr("Stop local node") + translationManager.emptyString + text: (appWindow.daemonRunning ? qsTr("Stop local node") : qsTr("Start daemon")) + translationManager.emptyString } MouseArea { cursorShape: Qt.PointingHandCursor anchors.fill: parent onClicked: { - appWindow.stopDaemon(); + if (appWindow.daemonRunning) { + appWindow.stopDaemon(); + } else { + appWindow.startDaemon(persistentSettings.daemonFlags); + } } } } From 42a9e2fe35e1b22d3597df1281dfeeb130fe18fa Mon Sep 17 00:00:00 2001 From: xiphon Date: Tue, 6 Nov 2018 19:09:54 +0000 Subject: [PATCH 2/2] settings-node: change element id 'btnStopNode' to 'btnStartStopNode' --- pages/settings/SettingsNode.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/settings/SettingsNode.qml b/pages/settings/SettingsNode.qml index f6ef7e08..b690c70e 100644 --- a/pages/settings/SettingsNode.qml +++ b/pages/settings/SettingsNode.qml @@ -382,14 +382,14 @@ Rectangle{ Layout.preferredWidth: parent.width Rectangle { - id: rectStopNode + id: rectStartStopNode color: MoneroComponents.Style.buttonBackgroundColor - width: btnStopNode.width + 40 + width: btnStartStopNode.width + 40 height: 24 radius: 2 Text { - id: btnStopNode + id: btnStartStopNode anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter color: MoneroComponents.Style.defaultFontColor