mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-11 05:14:34 +00:00
Merge pull request #1815
d70f714
settings-node: use StandardButton instead of custom buttons (xiphon)
This commit is contained in:
commit
5b3adeeb73
1 changed files with 20 additions and 70 deletions
|
@ -300,9 +300,6 @@ Rectangle{
|
||||||
persistentSettings.remoteNodeAddress = remoteNodeEdit.getAddress();
|
persistentSettings.remoteNodeAddress = remoteNodeEdit.getAddress();
|
||||||
console.log("setting remote node to " + persistentSettings.remoteNodeAddress)
|
console.log("setting remote node to " + persistentSettings.remoteNodeAddress)
|
||||||
}
|
}
|
||||||
onTextChanged: {
|
|
||||||
rectConnectRemote.enabled = remoteNodeEdit.isValid();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GridLayout {
|
GridLayout {
|
||||||
|
@ -333,41 +330,21 @@ Rectangle{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
MoneroComponents.StandardButton {
|
||||||
id: rectConnectRemote
|
id: btnConnectRemote
|
||||||
Layout.topMargin: 12 * scaleRatio
|
|
||||||
enabled: remoteNodeEdit.isValid()
|
enabled: remoteNodeEdit.isValid()
|
||||||
color: enabled ? MoneroComponents.Style.buttonBackgroundColor : MoneroComponents.Style.buttonBackgroundColorDisabled
|
small: true
|
||||||
width: btnConnectRemote.width + 40
|
text: qsTr("Connect") + translationManager.emptyString
|
||||||
height: 26
|
onClicked: {
|
||||||
radius: 2
|
// Update daemon login
|
||||||
|
persistentSettings.remoteNodeAddress = remoteNodeEdit.getAddress();
|
||||||
|
persistentSettings.daemonUsername = daemonUsername.text;
|
||||||
|
persistentSettings.daemonPassword = daemonPassword.text;
|
||||||
|
persistentSettings.useRemoteNode = true
|
||||||
|
|
||||||
Text {
|
currentWallet.setDaemonLogin(persistentSettings.daemonUsername, persistentSettings.daemonPassword);
|
||||||
id: btnConnectRemote
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
color: MoneroComponents.Style.defaultFontColor
|
|
||||||
font.family: MoneroComponents.Style.fontRegular.name
|
|
||||||
font.pixelSize: 14 * scaleRatio
|
|
||||||
font.bold: true
|
|
||||||
text: qsTr("Connect") + translationManager.emptyString
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
appWindow.connectRemoteNode()
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
visible: rectConnectRemote.enabled
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: {
|
|
||||||
// Update daemon login
|
|
||||||
persistentSettings.remoteNodeAddress = remoteNodeEdit.getAddress();
|
|
||||||
persistentSettings.daemonUsername = daemonUsername.text;
|
|
||||||
persistentSettings.daemonPassword = daemonPassword.text;
|
|
||||||
persistentSettings.useRemoteNode = true
|
|
||||||
|
|
||||||
currentWallet.setDaemonLogin(persistentSettings.daemonUsername, persistentSettings.daemonPassword);
|
|
||||||
|
|
||||||
appWindow.connectRemoteNode()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -381,41 +358,14 @@ Rectangle{
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
visible: !isMobile && !persistentSettings.useRemoteNode
|
visible: !isMobile && !persistentSettings.useRemoteNode
|
||||||
|
|
||||||
Rectangle {
|
MoneroComponents.StandardButton {
|
||||||
color: "transparent"
|
small: true
|
||||||
Layout.topMargin: 0 * scaleRatio
|
text: (appWindow.daemonRunning ? qsTr("Stop local node") : qsTr("Start daemon")) + translationManager.emptyString
|
||||||
Layout.bottomMargin: 8 * scaleRatio
|
onClicked: {
|
||||||
Layout.preferredHeight: 24 * scaleRatio
|
if (appWindow.daemonRunning) {
|
||||||
Layout.preferredWidth: parent.width
|
appWindow.stopDaemon();
|
||||||
|
} else {
|
||||||
Rectangle {
|
appWindow.startDaemon(persistentSettings.daemonFlags);
|
||||||
id: rectStartStopNode
|
|
||||||
color: MoneroComponents.Style.buttonBackgroundColor
|
|
||||||
width: btnStartStopNode.width + 40
|
|
||||||
height: 24
|
|
||||||
radius: 2
|
|
||||||
|
|
||||||
Text {
|
|
||||||
id: btnStartStopNode
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
color: MoneroComponents.Style.defaultFontColor
|
|
||||||
font.family: MoneroComponents.Style.fontRegular.name
|
|
||||||
font.pixelSize: 14 * scaleRatio
|
|
||||||
font.bold: true
|
|
||||||
text: (appWindow.daemonRunning ? qsTr("Stop local node") : qsTr("Start daemon")) + translationManager.emptyString
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: {
|
|
||||||
if (appWindow.daemonRunning) {
|
|
||||||
appWindow.stopDaemon();
|
|
||||||
} else {
|
|
||||||
appWindow.startDaemon(persistentSettings.daemonFlags);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue