mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-11-16 15:58:11 +00:00
mining: add visual icon/indicator that mining is enabled, visible on all the screens
This commit is contained in:
parent
7c0a557e62
commit
84a60424ef
9 changed files with 38 additions and 7 deletions
|
@ -650,7 +650,7 @@ Rectangle {
|
|||
id: networkStatus
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.leftMargin: 0
|
||||
anchors.leftMargin: 5 * scaleRatio
|
||||
anchors.rightMargin: 0
|
||||
anchors.bottom: (progressBar.visible)? progressBar.top : parent.bottom;
|
||||
connected: Wallet.ConnectionStatus_Disconnected
|
||||
|
|
|
@ -43,7 +43,7 @@ Rectangle {
|
|||
return qsTr("Synchronizing")
|
||||
if(appWindow.remoteNodeConnected)
|
||||
return qsTr("Remote node")
|
||||
return qsTr("Connected")
|
||||
return appWindow.isMining ? qsTr("Connected") + " + " + qsTr("Mining"): qsTr("Connected")
|
||||
}
|
||||
if (status == Wallet.ConnectionStatus_WrongVersion)
|
||||
return qsTr("Wrong version")
|
||||
|
@ -69,16 +69,30 @@ Rectangle {
|
|||
|
||||
Image {
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 6
|
||||
anchors.topMargin: !appWindow.isMining ? 6 * scaleRatio : 4 * scaleRatio
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 11
|
||||
anchors.rightMargin: !appWindow.isMining ? 11 * scaleRatio : 0
|
||||
source: {
|
||||
if(item.connected == Wallet.ConnectionStatus_Connected){
|
||||
if(appWindow.isMining) {
|
||||
return "../images/miningxmr.png"
|
||||
} else if(item.connected == Wallet.ConnectionStatus_Connected) {
|
||||
return "../images/lightning.png"
|
||||
} else {
|
||||
return "../images/lightning-white.png"
|
||||
}
|
||||
}
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
if(!appWindow.isMining) {
|
||||
middlePanel.settingsView.settingsStateViewState = "Node";
|
||||
appWindow.showPageRequest("Settings");
|
||||
} else {
|
||||
appWindow.showPageRequest("Mining")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -108,9 +122,19 @@ Rectangle {
|
|||
font.pixelSize: 20 * scaleRatio
|
||||
color: "white"
|
||||
text: getConnectionStatusString(item.connected) + translationManager.emptyString
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
if(!appWindow.isMining) {
|
||||
middlePanel.settingsView.settingsStateViewState = "Node";
|
||||
appWindow.showPageRequest("Settings");
|
||||
} else {
|
||||
appWindow.showPageRequest("Mining")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
BIN
images/miningxmr.png
Normal file
BIN
images/miningxmr.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
BIN
images/miningxmr@2x.png
Normal file
BIN
images/miningxmr@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
1
main.qml
1
main.qml
|
@ -72,6 +72,7 @@ ApplicationWindow {
|
|||
property bool qrScannerEnabled: (typeof builtWithScanner != "undefined") && builtWithScanner
|
||||
property int blocksToSync: 1
|
||||
property var isMobile: (appWindow.width > 700 && !isAndroid) ? false : true
|
||||
property bool isMining: false
|
||||
property var cameraUi
|
||||
property bool remoteNodeConnected: false
|
||||
property bool androidCloseTapped: false;
|
||||
|
|
|
@ -241,6 +241,7 @@ Rectangle {
|
|||
updateStatusText()
|
||||
startSoloMinerButton.enabled = !walletManager.isMining()
|
||||
stopSoloMinerButton.enabled = !startSoloMinerButton.enabled
|
||||
appWindow.isMining = walletManager.isMining()
|
||||
}
|
||||
|
||||
MoneroComponents.StandardDialog {
|
||||
|
|
|
@ -660,6 +660,8 @@ Rectangle {
|
|||
// Light wallet is always ready
|
||||
pageRoot.enabled = true;
|
||||
root.warningContent = "";
|
||||
// check if daemon was already mining and add mining logo if true
|
||||
middlePanel.miningView.update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ ColumnLayout {
|
|||
Clipboard { id: clipboard }
|
||||
property bool viewOnly: false
|
||||
property int settingsHeight: 900
|
||||
property alias settingsStateViewState: settingsStateView.state
|
||||
|
||||
Navbar{}
|
||||
|
||||
|
|
2
qml.qrc
2
qml.qrc
|
@ -226,6 +226,8 @@
|
|||
<file>images/settings_navbar_side_active.png</file>
|
||||
<file>images/settings_local.png</file>
|
||||
<file>components/WarningBox.qml</file>
|
||||
<file>images/miningxmr.png</file>
|
||||
<file>images/miningxmr@2x.png</file>
|
||||
<file>images/eyeHide.png</file>
|
||||
<file>images/eyeShow.png</file>
|
||||
</qresource>
|
||||
|
|
Loading…
Reference in a new issue