mining: add visual icon/indicator that mining is enabled, visible on all the screens

This commit is contained in:
mmbyday 2018-12-15 20:10:12 -08:00
parent 7c0a557e62
commit 84a60424ef
9 changed files with 38 additions and 7 deletions

View File

@ -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

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
images/miningxmr@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -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;

View File

@ -241,6 +241,7 @@ Rectangle {
updateStatusText()
startSoloMinerButton.enabled = !walletManager.isMining()
stopSoloMinerButton.enabled = !startSoloMinerButton.enabled
appWindow.isMining = walletManager.isMining()
}
MoneroComponents.StandardDialog {

View File

@ -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();
}
}
}

View File

@ -46,6 +46,7 @@ ColumnLayout {
Clipboard { id: clipboard }
property bool viewOnly: false
property int settingsHeight: 900
property alias settingsStateViewState: settingsStateView.state
Navbar{}

View File

@ -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>