Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

settings-node: use StandardButton instead of custom buttons #1815

Merged
merged 1 commit into from
Dec 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 20 additions & 70 deletions pages/settings/SettingsNode.qml
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,6 @@ Rectangle{
persistentSettings.remoteNodeAddress = remoteNodeEdit.getAddress();
console.log("setting remote node to " + persistentSettings.remoteNodeAddress)
}
onTextChanged: {
rectConnectRemote.enabled = remoteNodeEdit.isValid();
}
}

GridLayout {
Expand Down Expand Up @@ -333,41 +330,21 @@ Rectangle{
}
}

Rectangle {
id: rectConnectRemote
Layout.topMargin: 12 * scaleRatio
MoneroComponents.StandardButton {
id: btnConnectRemote
enabled: remoteNodeEdit.isValid()
color: enabled ? MoneroComponents.Style.buttonBackgroundColor : MoneroComponents.Style.buttonBackgroundColorDisabled
width: btnConnectRemote.width + 40
height: 26
radius: 2
small: true
text: qsTr("Connect") + translationManager.emptyString
onClicked: {
// Update daemon login
persistentSettings.remoteNodeAddress = remoteNodeEdit.getAddress();
persistentSettings.daemonUsername = daemonUsername.text;
persistentSettings.daemonPassword = daemonPassword.text;
persistentSettings.useRemoteNode = true

Text {
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
}
currentWallet.setDaemonLogin(persistentSettings.daemonUsername, persistentSettings.daemonPassword);

MouseArea {
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()
}
appWindow.connectRemoteNode()
}
}
}
Expand All @@ -381,41 +358,14 @@ Rectangle{
anchors.right: parent.right
visible: !isMobile && !persistentSettings.useRemoteNode

Rectangle {
color: "transparent"
Layout.topMargin: 0 * scaleRatio
Layout.bottomMargin: 8 * scaleRatio
Layout.preferredHeight: 24 * scaleRatio
Layout.preferredWidth: parent.width

Rectangle {
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);
}
}
MoneroComponents.StandardButton {
small: true
text: (appWindow.daemonRunning ? qsTr("Stop local node") : qsTr("Start daemon")) + translationManager.emptyString
onClicked: {
if (appWindow.daemonRunning) {
appWindow.stopDaemon();
} else {
appWindow.startDaemon(persistentSettings.daemonFlags);
}
}
}
Expand Down