aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormoneromooo.monero <moneromooo.monero@users.noreply.github.com>2016-11-07 12:02:27 +0000
committermoneromooo.monero <moneromooo.monero@users.noreply.github.com>2016-11-07 12:02:27 +0000
commit689f0415e7e0d47b765b18d370fc6c2cf1edb990 (patch)
tree64f2c184da402463f7a09cea965ae39c79f4ea25 /src
parentc9bb2f571895edb6a01ca5528c944d09bc222823 (diff)
downloadmonzero-gui-689f0415e7e0d47b765b18d370fc6c2cf1edb990.tar.gz
monzero-gui-689f0415e7e0d47b765b18d370fc6c2cf1edb990.tar.xz
monzero-gui-689f0415e7e0d47b765b18d370fc6c2cf1edb990.zip
Report when the GUI is connected to a daemon with mismatched version
This will cause various errors confusing to the user, as they stem for the daemon returning replies with missing information, etc.
Diffstat (limited to 'src')
-rw-r--r--src/libwalletqt/Wallet.cpp4
-rw-r--r--src/libwalletqt/Wallet.h14
2 files changed, 13 insertions, 5 deletions
diff --git a/src/libwalletqt/Wallet.cpp b/src/libwalletqt/Wallet.cpp
index ef98828c..2def00e7 100644
--- a/src/libwalletqt/Wallet.cpp
+++ b/src/libwalletqt/Wallet.cpp
@@ -86,9 +86,9 @@ Wallet::Status Wallet::status() const
return static_cast<Status>(m_walletImpl->status());
}
-bool Wallet::connected() const
+Wallet::ConnectionStatus Wallet::connected() const
{
- return m_walletImpl->connected();
+ return static_cast<ConnectionStatus>(m_walletImpl->connected());
}
bool Wallet::synchronized() const
diff --git a/src/libwalletqt/Wallet.h b/src/libwalletqt/Wallet.h
index 303dfd24..e74745bf 100644
--- a/src/libwalletqt/Wallet.h
+++ b/src/libwalletqt/Wallet.h
@@ -22,7 +22,7 @@ class Wallet : public QObject
Q_PROPERTY(QString seed READ getSeed)
Q_PROPERTY(QString seedLanguage READ getSeedLanguage)
Q_PROPERTY(Status status READ status)
- Q_PROPERTY(bool connected READ connected)
+ Q_PROPERTY(ConnectionStatus connected READ connected)
Q_PROPERTY(bool synchronized READ synchronized)
Q_PROPERTY(QString errorString READ errorString)
Q_PROPERTY(QString address READ address)
@@ -42,6 +42,14 @@ public:
Q_ENUM(Status)
+ enum ConnectionStatus {
+ ConnectionStatus_Connected = Bitmonero::Wallet::ConnectionStatus_Connected,
+ ConnectionStatus_Disconnected = Bitmonero::Wallet::ConnectionStatus_Disconnected,
+ ConnectionStatus_WrongVersion = Bitmonero::Wallet::ConnectionStatus_WrongVersion
+ };
+
+ Q_ENUM(ConnectionStatus)
+
//! returns mnemonic seed
QString getSeed() const;
@@ -54,8 +62,8 @@ public:
//! returns last operation's status
Status status() const;
- //! returns true if wallet connected
- bool connected() const;
+ //! returns whether the wallet is connected, and version status
+ ConnectionStatus connected() const;
//! returns true if wallet was ever synchronized
bool synchronized() const;