diff options
| author | mmbyday <mmbyday@protonmail.com> | 2018-12-15 20:10:12 -0800 |
|---|---|---|
| committer | mmbyday <mmbyday@protonmail.com> | 2018-12-18 19:07:26 -0800 |
| commit | 84a60424efb90c680137294cb7338f41f8c9fe9d (patch) | |
| tree | 171d79de94f31620402e69038de9294d09481061 | |
| parent | 7c0a557e627c1c6dee0564d1301034498172885d (diff) | |
| download | monzero-gui-84a60424efb90c680137294cb7338f41f8c9fe9d.tar.gz monzero-gui-84a60424efb90c680137294cb7338f41f8c9fe9d.tar.xz monzero-gui-84a60424efb90c680137294cb7338f41f8c9fe9d.zip | |
mining: add visual icon/indicator that mining is enabled, visible on all the screens
| -rw-r--r-- | LeftPanel.qml | 2 | ||||
| -rw-r--r-- | components/NetworkStatusItem.qml | 36 | ||||
| -rw-r--r-- | images/miningxmr.png | bin | 0 -> 1405 bytes | |||
| -rw-r--r-- | images/miningxmr@2x.png | bin | 0 -> 2713 bytes | |||
| -rw-r--r-- | main.qml | 1 | ||||
| -rw-r--r-- | pages/Mining.qml | 1 | ||||
| -rw-r--r-- | pages/Transfer.qml | 2 | ||||
| -rw-r--r-- | pages/settings/Settings.qml | 1 | ||||
| -rw-r--r-- | qml.qrc | 2 |
9 files changed, 38 insertions, 7 deletions
diff --git a/LeftPanel.qml b/LeftPanel.qml index 53da5f22..e05e62ac 100644 --- a/LeftPanel.qml +++ b/LeftPanel.qml @@ -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 diff --git a/components/NetworkStatusItem.qml b/components/NetworkStatusItem.qml index edc22595..965948bd 100644 --- a/components/NetworkStatusItem.qml +++ b/components/NetworkStatusItem.qml @@ -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") + } + } + } } } } - - } diff --git a/images/miningxmr.png b/images/miningxmr.png Binary files differnew file mode 100644 index 00000000..81fb7689 --- /dev/null +++ b/images/miningxmr.png diff --git a/images/miningxmr@2x.png b/images/miningxmr@2x.png Binary files differnew file mode 100644 index 00000000..aff06b4d --- /dev/null +++ b/images/miningxmr@2x.png @@ -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; diff --git a/pages/Mining.qml b/pages/Mining.qml index d6ce5e61..7d9896fb 100644 --- a/pages/Mining.qml +++ b/pages/Mining.qml @@ -241,6 +241,7 @@ Rectangle { updateStatusText() startSoloMinerButton.enabled = !walletManager.isMining() stopSoloMinerButton.enabled = !startSoloMinerButton.enabled + appWindow.isMining = walletManager.isMining() } MoneroComponents.StandardDialog { diff --git a/pages/Transfer.qml b/pages/Transfer.qml index bcb23d07..1dfbfcfd 100644 --- a/pages/Transfer.qml +++ b/pages/Transfer.qml @@ -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(); } } } diff --git a/pages/settings/Settings.qml b/pages/settings/Settings.qml index 5aabcccd..9c96c7de 100644 --- a/pages/settings/Settings.qml +++ b/pages/settings/Settings.qml @@ -46,6 +46,7 @@ ColumnLayout { Clipboard { id: clipboard } property bool viewOnly: false property int settingsHeight: 900 + property alias settingsStateViewState: settingsStateView.state Navbar{} @@ -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> |
