aboutsummaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2019-10-14 17:53:08 -0500
committerluigi1111 <luigi1111w@gmail.com>2019-10-14 17:53:08 -0500
commit44280d1e52070619c30c18d051da816b99391384 (patch)
tree877c2247fc2f0f6e1d1227f84c7b6759070c1ffe /components
parent897d879dad7443550be832f62e199291487453de (diff)
parentd3b20d2c04e89b918ec93aa0d2baf92eb13a49cc (diff)
downloadmonzero-gui-44280d1e52070619c30c18d051da816b99391384.tar.gz
monzero-gui-44280d1e52070619c30c18d051da816b99391384.tar.xz
monzero-gui-44280d1e52070619c30c18d051da816b99391384.zip
Merge pull request #2399
d3b20d2 SimpleMode: implement 'switch to another public node' button (xiphon)
Diffstat (limited to 'components')
-rw-r--r--components/NetworkStatusItem.qml45
1 files changed, 45 insertions, 0 deletions
diff --git a/components/NetworkStatusItem.qml b/components/NetworkStatusItem.qml
index 30a7a867..3e8496bf 100644
--- a/components/NetworkStatusItem.qml
+++ b/components/NetworkStatusItem.qml
@@ -29,6 +29,7 @@
import QtQuick 2.9
import QtQuick.Layouts 1.1
+import FontAwesome 1.0
import moneroComponents.Wallet 1.0
import "../components" as MoneroComponents
@@ -146,6 +147,50 @@ Rectangle {
}
}
}
+
+ Text {
+ anchors.left: statusTextVal.right
+ anchors.leftMargin: 16
+ anchors.verticalCenter: parent.verticalCenter
+ color: refreshMouseArea.containsMouse ? MoneroComponents.Style.dimmedFontColor : MoneroComponents.Style.defaultFontColor
+ font.family: FontAwesome.fontFamilySolid
+ font.pixelSize: 24
+ font.styleName: "Solid"
+ opacity: iconItem.opacity * (refreshMouseArea.visible ? 1 : 0.5)
+ text: FontAwesome.random
+ visible: (
+ item.connected != Wallet.ConnectionStatus_Disconnected &&
+ !persistentSettings.useRemoteNode &&
+ persistentSettings.bootstrapNodeAddress == "auto"
+ )
+
+ MouseArea {
+ id: refreshMouseArea
+ anchors.fill: parent
+ hoverEnabled: true
+ cursorShape: Qt.PointingHandCursor
+ visible: true
+ onClicked: {
+ const callback = function(result) {
+ refreshMouseArea.visible = true;
+ if (result) {
+ appWindow.showStatusMessage(qsTr("Successfully switched to another public node"), 3);
+ appWindow.currentWallet.refreshHeightAsync();
+ } else {
+ appWindow.showStatusMessage(qsTr("Failed to switch public node"), 3);
+ }
+ };
+
+ daemonManager.sendCommandAsync(
+ ["set_bootstrap_daemon", "auto"],
+ appWindow.currentWallet.nettype,
+ callback);
+
+ refreshMouseArea.visible = false;
+ appWindow.showStatusMessage(qsTr("Switching to another public node"), 3);
+ }
+ }
+ }
}
}
}