mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-12-23 12:09:57 +00:00
Merge pull request #279
705bc83
move refresh progress to leftpanel (Jaquee)
This commit is contained in:
commit
c65b1f8c69
4 changed files with 10 additions and 20 deletions
|
@ -37,7 +37,7 @@ Rectangle {
|
||||||
property alias unlockedBalanceText: unlockedBalanceText.text
|
property alias unlockedBalanceText: unlockedBalanceText.text
|
||||||
property alias balanceText: balanceText.text
|
property alias balanceText: balanceText.text
|
||||||
property alias networkStatus : networkStatus
|
property alias networkStatus : networkStatus
|
||||||
property alias daemonProgress : daemonProgress
|
property alias progressBar : progressBar
|
||||||
|
|
||||||
signal dashboardClicked()
|
signal dashboardClicked()
|
||||||
signal historyClicked()
|
signal historyClicked()
|
||||||
|
@ -408,12 +408,12 @@ Rectangle {
|
||||||
id: networkStatus
|
id: networkStatus
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.bottom: (daemonProgress.visible)? daemonProgress.top : parent.bottom;
|
anchors.bottom: (progressBar.visible)? progressBar.top : parent.bottom;
|
||||||
connected: Wallet.ConnectionStatus_Disconnected
|
connected: Wallet.ConnectionStatus_Disconnected
|
||||||
}
|
}
|
||||||
|
|
||||||
DaemonProgress {
|
ProgressBar {
|
||||||
id: daemonProgress
|
id: progressBar
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
|
|
|
@ -41,13 +41,8 @@ Item {
|
||||||
if(targetBlock > 0) {
|
if(targetBlock > 0) {
|
||||||
var progressLevel = ((currentBlock/targetBlock) * 100).toFixed(0);
|
var progressLevel = ((currentBlock/targetBlock) * 100).toFixed(0);
|
||||||
fillLevel = progressLevel
|
fillLevel = progressLevel
|
||||||
console.log("target block: ",progressLevel)
|
|
||||||
progressText.text = qsTr("Synchronizing blocks %1/%2").arg(currentBlock.toFixed(0)).arg(targetBlock.toFixed(0));
|
progressText.text = qsTr("Synchronizing blocks %1/%2").arg(currentBlock.toFixed(0)).arg(targetBlock.toFixed(0));
|
||||||
|
|
||||||
// TODO: lower daemon block height cache, ttl and refresh interval?
|
|
||||||
|
|
||||||
item.visible = (currentWallet.connected !== Wallet.ConnectionStatus_Disconnected) && (currentBlock < targetBlock)
|
item.visible = (currentWallet.connected !== Wallet.ConnectionStatus_Disconnected) && (currentBlock < targetBlock)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
15
main.qml
15
main.qml
|
@ -276,7 +276,7 @@ ApplicationWindow {
|
||||||
// Daemon fully synced
|
// Daemon fully synced
|
||||||
// TODO: implement onDaemonSynced or similar in wallet API and don't start refresh thread before daemon is synced
|
// TODO: implement onDaemonSynced or similar in wallet API and don't start refresh thread before daemon is synced
|
||||||
daemonSynced = (currentWallet.connected != Wallet.ConnectionStatus_Disconnected && dCurrentBlock >= dTargetBlock)
|
daemonSynced = (currentWallet.connected != Wallet.ConnectionStatus_Disconnected && dCurrentBlock >= dTargetBlock)
|
||||||
leftPanel.daemonProgress.updateProgress(dCurrentBlock,dTargetBlock);
|
leftPanel.progressBar.updateProgress(dCurrentBlock,dTargetBlock);
|
||||||
middlePanel.updateStatus();
|
middlePanel.updateStatus();
|
||||||
|
|
||||||
// If wallet isnt connected and no daemon is running - Ask
|
// If wallet isnt connected and no daemon is running - Ask
|
||||||
|
@ -327,27 +327,22 @@ ApplicationWindow {
|
||||||
}
|
}
|
||||||
function onDaemonStopped(){
|
function onDaemonStopped(){
|
||||||
console.log("daemon stopped");
|
console.log("daemon stopped");
|
||||||
|
hideProcessingSplash();
|
||||||
daemonRunning = false;
|
daemonRunning = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function onWalletNewBlock(blockHeight) {
|
function onWalletNewBlock(blockHeight) {
|
||||||
if (splash.visible) {
|
|
||||||
var currHeight = blockHeight
|
|
||||||
|
|
||||||
|
// Update progress bar
|
||||||
|
var currHeight = blockHeight
|
||||||
//fast refresh until restoreHeight is reached
|
//fast refresh until restoreHeight is reached
|
||||||
var increment = ((restoreHeight == 0) || currHeight < restoreHeight)? 1000 : 10
|
var increment = ((restoreHeight == 0) || currHeight < restoreHeight)? 1000 : 10
|
||||||
|
|
||||||
if(currHeight > splashCounter + increment){
|
if(currHeight > splashCounter + increment){
|
||||||
splashCounter = currHeight
|
splashCounter = currHeight
|
||||||
var locale = Qt.locale()
|
leftPanel.progressBar.updateProgress(currHeight,currentWallet.daemonBlockChainTargetHeight());
|
||||||
var currHeightString = currHeight.toLocaleString(locale,"f",0)
|
|
||||||
var targetHeightString = currentWallet.daemonBlockChainTargetHeight().toLocaleString(locale,"f",0)
|
|
||||||
var progressText = qsTr("Synchronizing blocks %1 / %2").arg(currHeightString).arg(targetHeightString);
|
|
||||||
console.log("Progress text: " + progressText);
|
|
||||||
splash.heightProgressText = progressText
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onWalletMoneyReceived(txId, amount) {
|
function onWalletMoneyReceived(txId, amount) {
|
||||||
|
|
2
qml.qrc
2
qml.qrc
|
@ -117,7 +117,7 @@
|
||||||
<file>lang/flags/italy.png</file>
|
<file>lang/flags/italy.png</file>
|
||||||
<file>components/PasswordDialog.qml</file>
|
<file>components/PasswordDialog.qml</file>
|
||||||
<file>components/ProcessingSplash.qml</file>
|
<file>components/ProcessingSplash.qml</file>
|
||||||
<file>components/DaemonProgress.qml</file>
|
<file>components/ProgressBar.qml</file>
|
||||||
<file>components/StandardDialog.qml</file>
|
<file>components/StandardDialog.qml</file>
|
||||||
<file>pages/Sign.qml</file>
|
<file>pages/Sign.qml</file>
|
||||||
<file>components/DaemonManagerDialog.qml</file>
|
<file>components/DaemonManagerDialog.qml</file>
|
||||||
|
|
Loading…
Reference in a new issue