forked from Public/monero-gui
Merge pull request #217
3752ec7send page: check daemon status after every refresh (Jaquee)01549a3walletManager: coding conventions (Jaquee)0ae3d67daemon console -> log + adjusted height (Jaquee)0e8cd14Wallet: add m_initialized (Jaquee)c7232e1set wallet connection status before querying sync status (Jaquee)3f8e05dWallet: Cache connection status query (Jaquee)36a6b89connect onWalletConnectionStatusChanged() (Jaquee)93a8200Transfer: new connectionStatus handling + show status msg (Jaquee)76e6ae8remove reference to old pw-dialog (Jaquee)18b7a67Wallet: add connectionStatusChanged signal (Jaquee)d9f4ab4daemonManager: wait for daemon stop on app close (Jaquee)f62bb68daemonManagerDialog: use new ConnectionStatus enum (Jaquee)dd01f59hide daemon sync progress after disconnecting wallet (Jaquee)8d19a03DaemonManager: add stateChanged() (Jaquee)760e01bdaemonManagerDialog: show processdialog when starting (Jaquee)bb881d9show processingSplash when starting/stopping daemon (Jaquee)8361ddaresolve rebase conflict (Jaquee)8dfa79eShutdown daemon and close wallet properly on app exit (Jaquee)7876957DaemonManager::closing() (Jacob Brydolf)065b060main: debug messages (Jacob Brydolf)b4eb489DaemonManager: forward command line arguments to monerod (Jacob Brydolf)752ff26forward command line arguments to DaemonManager (Jaquee)7840dabDaemonManager: console debug output (Jacob Brydolf)14a5bd5settings: added daemon console (Jacob Brydolf)b53ef00history tx details: resized popup (Jacob Brydolf)b4f29b2StandardDialog: changed default sizes (Jacob Brydolf)5855700daemonManagerDialog: added starting signal (Jacob Brydolf)3a43154DaemonManager: added console updated signals (Jacob Brydolf)3df9e44DaemonManager: windows support (Jacob Brydolf)5da9f8fstandardDialog: close window before continue (Jacob Brydolf)5a110f4replace message dialog with custom dialog (Jacob Brydolf)d465780resized standard dialog (Jacob Brydolf)482bd30settings: enable/disable daemon start/stop buttons (Jacob Brydolf)4e7de8cproper daemon shutdown on app exit (Jaquee)48471f3onDaemonStarted/stopped signals/slots (Jaquee)de635cbpw dialog: close popup before continue (Jacob Brydolf)86772beadded standardDialog component (Jacob Brydolf)ae977afsettings: add daemon manager (Jacob Brydolf)2775124small error in daemon manager dialog (Jacob Brydolf)82c39e0WalletManager: include dependencies (Jaquee)1c6884eShow daemon manager dialog if daemon isnt started (Jacob Brydolf)9fbfbc4daemonManager: embed as context property (Jaquee)4cdc258WalletManager: basic functionality (Jacob Brydolf)
This commit is contained in:
70
main.qml
70
main.qml
@@ -59,6 +59,7 @@ ApplicationWindow {
|
||||
property int restoreHeight:0
|
||||
property bool daemonSynced: false
|
||||
property int maxWindowHeight: (Screen.height < 900)? 720 : 800;
|
||||
property bool daemonRunning: false
|
||||
|
||||
// true if wallet ever synchronized
|
||||
property bool walletInitialized : false
|
||||
@@ -212,6 +213,7 @@ ApplicationWindow {
|
||||
currentWallet.moneySpent.disconnect(onWalletMoneySent)
|
||||
currentWallet.moneyReceived.disconnect(onWalletMoneyReceived)
|
||||
currentWallet.transactionCreated.disconnect(onTransactionCreated)
|
||||
currentWallet.connectionStatusChanged.disconnect(onWalletConnectionStatusChanged)
|
||||
|
||||
currentWallet.refreshed.connect(onWalletRefresh)
|
||||
currentWallet.updated.connect(onWalletUpdate)
|
||||
@@ -219,6 +221,7 @@ ApplicationWindow {
|
||||
currentWallet.moneySpent.connect(onWalletMoneySent)
|
||||
currentWallet.moneyReceived.connect(onWalletMoneyReceived)
|
||||
currentWallet.transactionCreated.connect(onTransactionCreated)
|
||||
currentWallet.connectionStatusChanged.connect(onWalletConnectionStatusChanged)
|
||||
|
||||
|
||||
console.log("initializing with daemon address: ", persistentSettings.daemon_address)
|
||||
@@ -232,6 +235,11 @@ ApplicationWindow {
|
||||
return wallet_path;
|
||||
}
|
||||
|
||||
function onWalletConnectionStatusChanged(){
|
||||
console.log("Wallet connection status changed")
|
||||
middlePanel.updateStatus();
|
||||
}
|
||||
|
||||
function onWalletOpened(wallet) {
|
||||
console.log(">>> wallet opened: " + wallet)
|
||||
if (wallet.status !== Wallet.Status_Ok) {
|
||||
@@ -280,18 +288,23 @@ ApplicationWindow {
|
||||
hideProcessingSplash()
|
||||
}
|
||||
|
||||
// Daemon connected
|
||||
leftPanel.networkStatus.connected = currentWallet.connected
|
||||
|
||||
// Check daemon status
|
||||
var dCurrentBlock = currentWallet.daemonBlockChainHeight();
|
||||
var dTargetBlock = currentWallet.daemonBlockChainTargetHeight();
|
||||
leftPanel.daemonProgress.updateProgress(dCurrentBlock,dTargetBlock);
|
||||
|
||||
// Daemon connected
|
||||
leftPanel.networkStatus.connected = currentWallet.connected
|
||||
|
||||
// Daemon fully 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)
|
||||
leftPanel.daemonProgress.updateProgress(dCurrentBlock,dTargetBlock);
|
||||
middlePanel.updateStatus();
|
||||
|
||||
// If wallet isnt connected and no daemon is running - Ask
|
||||
if(currentWallet.connected === Wallet.ConnectionStatus_Disconnected && !daemonManager.running() && !walletInitialized){
|
||||
daemonManagerDialog.open();
|
||||
}
|
||||
|
||||
// Refresh is succesfull if blockchain height > 1
|
||||
if (currentWallet.blockChainHeight() > 1){
|
||||
@@ -317,10 +330,29 @@ ApplicationWindow {
|
||||
walletInitialized = true
|
||||
}
|
||||
|
||||
|
||||
onWalletUpdate();
|
||||
}
|
||||
|
||||
function startDaemon(){
|
||||
appWindow.showProcessingSplash(qsTr("Waiting for daemon to start..."))
|
||||
daemonManager.start();
|
||||
}
|
||||
|
||||
function stopDaemon(){
|
||||
appWindow.showProcessingSplash(qsTr("Waiting for daemon to stop..."))
|
||||
daemonManager.stop();
|
||||
}
|
||||
|
||||
function onDaemonStarted(){
|
||||
console.log("daemon started");
|
||||
daemonRunning = true;
|
||||
}
|
||||
function onDaemonStopped(){
|
||||
console.log("daemon stopped");
|
||||
daemonRunning = false;
|
||||
}
|
||||
|
||||
|
||||
function onWalletNewBlock(blockHeight) {
|
||||
if (splash.visible) {
|
||||
var currHeight = blockHeight
|
||||
@@ -633,6 +665,9 @@ ApplicationWindow {
|
||||
walletManager.walletOpened.connect(onWalletOpened);
|
||||
walletManager.walletClosed.connect(onWalletClosed);
|
||||
|
||||
daemonManager.daemonStarted.connect(onDaemonStarted);
|
||||
daemonManager.daemonStopped.connect(onDaemonStopped);
|
||||
|
||||
if(!walletsFound()) {
|
||||
rootItem.state = "wizard"
|
||||
} else {
|
||||
@@ -668,11 +703,11 @@ ApplicationWindow {
|
||||
// TODO: replace with customized popups
|
||||
|
||||
// Information dialog
|
||||
MessageDialog {
|
||||
StandardDialog {
|
||||
// dynamically change onclose handler
|
||||
property var onCloseCallback
|
||||
id: informationPopup
|
||||
standardButtons: StandardButton.Ok
|
||||
cancelVisible: false
|
||||
onAccepted: {
|
||||
if (onCloseCallback) {
|
||||
onCloseCallback()
|
||||
@@ -681,10 +716,10 @@ ApplicationWindow {
|
||||
}
|
||||
|
||||
// Confrirmation aka question dialog
|
||||
MessageDialog {
|
||||
StandardDialog {
|
||||
id: transactionConfirmationPopup
|
||||
standardButtons: StandardButton.Ok + StandardButton.Cancel
|
||||
onAccepted: {
|
||||
close();
|
||||
handleTransactionConfirmed()
|
||||
}
|
||||
}
|
||||
@@ -721,6 +756,10 @@ ApplicationWindow {
|
||||
|
||||
}
|
||||
|
||||
DaemonManagerDialog {
|
||||
id: daemonManagerDialog
|
||||
|
||||
}
|
||||
|
||||
ProcessingSplash {
|
||||
id: splash
|
||||
@@ -1032,10 +1071,13 @@ ApplicationWindow {
|
||||
}
|
||||
}
|
||||
onClosing: {
|
||||
// Close and save to disk on app close
|
||||
if (currentWallet != undefined) {
|
||||
walletManager.closeWallet(currentWallet);
|
||||
currentWallet = undefined
|
||||
}
|
||||
// Make sure wallet is closed before app exit (~Wallet() isn't always invoked)
|
||||
// Daemon shutdown is handled with signal/slot in main.cpp
|
||||
if (currentWallet != undefined) {
|
||||
walletManager.closeWallet(currentWallet);
|
||||
currentWallet = undefined
|
||||
}
|
||||
// Stop daemon
|
||||
daemonManager.stop();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user