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 id: networkStatus
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.leftMargin: 0 anchors.leftMargin: 5 * scaleRatio
anchors.rightMargin: 0 anchors.rightMargin: 0
anchors.bottom: (progressBar.visible)? progressBar.top : parent.bottom; anchors.bottom: (progressBar.visible)? progressBar.top : parent.bottom;
connected: Wallet.ConnectionStatus_Disconnected connected: Wallet.ConnectionStatus_Disconnected

View file

@ -43,7 +43,7 @@ Rectangle {
return qsTr("Synchronizing") return qsTr("Synchronizing")
if(appWindow.remoteNodeConnected) if(appWindow.remoteNodeConnected)
return qsTr("Remote node") return qsTr("Remote node")
return qsTr("Connected") return appWindow.isMining ? qsTr("Connected") + " + " + qsTr("Mining"): qsTr("Connected")
} }
if (status == Wallet.ConnectionStatus_WrongVersion) if (status == Wallet.ConnectionStatus_WrongVersion)
return qsTr("Wrong version") return qsTr("Wrong version")
@ -69,16 +69,30 @@ Rectangle {
Image { Image {
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 6 anchors.topMargin: !appWindow.isMining ? 6 * scaleRatio : 4 * scaleRatio
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 11 anchors.rightMargin: !appWindow.isMining ? 11 * scaleRatio : 0
source: { 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" return "../images/lightning.png"
} else { } else {
return "../images/lightning-white.png" 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 font.pixelSize: 20 * scaleRatio
color: "white" color: "white"
text: getConnectionStatusString(item.connected) + translationManager.emptyString 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 bool qrScannerEnabled: (typeof builtWithScanner != "undefined") && builtWithScanner
property int blocksToSync: 1 property int blocksToSync: 1
property var isMobile: (appWindow.width > 700 && !isAndroid) ? false : true property var isMobile: (appWindow.width > 700 && !isAndroid) ? false : true
property bool isMining: false
property var cameraUi property var cameraUi
property bool remoteNodeConnected: false property bool remoteNodeConnected: false
property bool androidCloseTapped: false; property bool androidCloseTapped: false;

View file

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

View file

@ -660,6 +660,8 @@ Rectangle {
// Light wallet is always ready // Light wallet is always ready
pageRoot.enabled = true; pageRoot.enabled = true;
root.warningContent = ""; 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 } Clipboard { id: clipboard }
property bool viewOnly: false property bool viewOnly: false
property int settingsHeight: 900 property int settingsHeight: 900
property alias settingsStateViewState: settingsStateView.state
Navbar{} Navbar{}

View file

@ -226,6 +226,8 @@
<file>images/settings_navbar_side_active.png</file> <file>images/settings_navbar_side_active.png</file>
<file>images/settings_local.png</file> <file>images/settings_local.png</file>
<file>components/WarningBox.qml</file> <file>components/WarningBox.qml</file>
<file>images/miningxmr.png</file>
<file>images/miningxmr@2x.png</file>
<file>images/eyeHide.png</file> <file>images/eyeHide.png</file>
<file>images/eyeShow.png</file> <file>images/eyeShow.png</file>
</qresource> </qresource>