forked from Public/monero-gui
mining: optimize update function, improve performance
This commit is contained in:
3
main.qml
3
main.qml
@@ -394,6 +394,9 @@ ApplicationWindow {
|
|||||||
if (!walletInitialized) {
|
if (!walletInitialized) {
|
||||||
currentWallet.history.refresh(currentWallet.currentSubaddressAccount)
|
currentWallet.history.refresh(currentWallet.currentSubaddressAccount)
|
||||||
walletInitialized = true
|
walletInitialized = true
|
||||||
|
|
||||||
|
// check if daemon was already mining and add mining logo if true
|
||||||
|
middlePanel.miningView.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateStatusText() {
|
function updateStatusText() {
|
||||||
if (walletManager.isMining()) {
|
if (appWindow.isMining) {
|
||||||
statusText.text = qsTr("Mining at %1 H/s").arg(walletManager.miningHashRate()) + translationManager.emptyString;
|
statusText.text = qsTr("Mining at %1 H/s").arg(walletManager.miningHashRate()) + translationManager.emptyString;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -238,10 +238,10 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function update() {
|
function update() {
|
||||||
updateStatusText()
|
|
||||||
startSoloMinerButton.enabled = !walletManager.isMining()
|
|
||||||
stopSoloMinerButton.enabled = !startSoloMinerButton.enabled
|
|
||||||
appWindow.isMining = walletManager.isMining()
|
appWindow.isMining = walletManager.isMining()
|
||||||
|
updateStatusText()
|
||||||
|
startSoloMinerButton.enabled = !appWindow.isMining
|
||||||
|
stopSoloMinerButton.enabled = !startSoloMinerButton.enabled
|
||||||
}
|
}
|
||||||
|
|
||||||
MoneroComponents.StandardDialog {
|
MoneroComponents.StandardDialog {
|
||||||
|
|||||||
@@ -694,8 +694,6 @@ 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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user