From 8480c70571ed815bfbdf2c6120a9a6fe1e7e1149 Mon Sep 17 00:00:00 2001 From: Jaquee Date: Thu, 24 Aug 2017 11:27:00 +0200 Subject: [PATCH 1/4] add textBlock component --- components/TextBlock.qml | 7 +++++++ qml.qrc | 1 + 2 files changed, 8 insertions(+) create mode 100644 components/TextBlock.qml diff --git a/components/TextBlock.qml b/components/TextBlock.qml new file mode 100644 index 00000000..7c36088a --- /dev/null +++ b/components/TextBlock.qml @@ -0,0 +1,7 @@ +import QtQuick 2.0 + +TextEdit { + wrapMode: Text.Wrap + readOnly: true + selectByMouse: true +} diff --git a/qml.qrc b/qml.qrc index 5c0bb707..6c511d34 100644 --- a/qml.qrc +++ b/qml.qrc @@ -140,5 +140,6 @@ components/QRCodeScanner.qml components/Notifier.qml components/MobileHeader.qml + components/TextBlock.qml From 94c92ba73c1ffc1d8efed78e30de2b65b4904a84 Mon Sep 17 00:00:00 2001 From: Jaquee Date: Thu, 24 Aug 2017 11:30:50 +0200 Subject: [PATCH 2/4] add daemon/wallet log path getters --- src/libwalletqt/Wallet.cpp | 10 ++++++++++ src/libwalletqt/Wallet.h | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/src/libwalletqt/Wallet.cpp b/src/libwalletqt/Wallet.cpp index b79d77e5..5a71debf 100644 --- a/src/libwalletqt/Wallet.cpp +++ b/src/libwalletqt/Wallet.cpp @@ -599,6 +599,16 @@ bool Wallet::useForkRules(quint8 required_version, quint64 earlyBlocks) const } } +QString Wallet::getDaemonLogPath() const +{ + return QString::fromStdString(m_walletImpl->getDefaultDataDir()) + "/bitmonero.log"; +} + +QString Wallet::getWalletLogPath() const +{ + return QCoreApplication::applicationDirPath() + "/monero-wallet-gui.log"; +} + Wallet::Wallet(Monero::Wallet *w, QObject *parent) : QObject(parent) , m_walletImpl(w) diff --git a/src/libwalletqt/Wallet.h b/src/libwalletqt/Wallet.h index 1224b24d..01298cf1 100644 --- a/src/libwalletqt/Wallet.h +++ b/src/libwalletqt/Wallet.h @@ -45,6 +45,8 @@ class Wallet : public QObject Q_PROPERTY(QString publicViewKey READ getPublicViewKey) Q_PROPERTY(QString secretSpendKey READ getSecretSpendKey) Q_PROPERTY(QString publicSpendKey READ getPublicSpendKey) + Q_PROPERTY(QString daemonLogPath READ getDaemonLogPath CONSTANT) + Q_PROPERTY(QString walletLogPath READ getWalletLogPath CONSTANT) public: @@ -241,6 +243,9 @@ public: QString getSecretSpendKey() const {return QString::fromStdString(m_walletImpl->secretSpendKey());} QString getPublicSpendKey() const {return QString::fromStdString(m_walletImpl->publicSpendKey());} + QString getDaemonLogPath() const; + QString getWalletLogPath() const; + // TODO: setListenter() when it implemented in API signals: // emitted on every event happened with wallet From 31f318aaeaccefd36ba86b032b2a64f27510c89e Mon Sep 17 00:00:00 2001 From: Jaquee Date: Thu, 24 Aug 2017 11:31:06 +0200 Subject: [PATCH 3/4] add wallet creation height getter --- src/libwalletqt/Wallet.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libwalletqt/Wallet.h b/src/libwalletqt/Wallet.h index 01298cf1..3fcc057f 100644 --- a/src/libwalletqt/Wallet.h +++ b/src/libwalletqt/Wallet.h @@ -47,6 +47,7 @@ class Wallet : public QObject Q_PROPERTY(QString publicSpendKey READ getPublicSpendKey) Q_PROPERTY(QString daemonLogPath READ getDaemonLogPath CONSTANT) Q_PROPERTY(QString walletLogPath READ getWalletLogPath CONSTANT) + Q_PROPERTY(quint64 walletCreationHeight READ getWalletCreationHeight CONSTANT) public: @@ -243,6 +244,7 @@ public: QString getSecretSpendKey() const {return QString::fromStdString(m_walletImpl->secretSpendKey());} QString getPublicSpendKey() const {return QString::fromStdString(m_walletImpl->publicSpendKey());} + quint64 getWalletCreationHeight() const {return m_walletImpl->getRefreshFromBlockHeight();} QString getDaemonLogPath() const; QString getWalletLogPath() const; From f7c883a6c318583219dace5f88eaef0cf4bda81b Mon Sep 17 00:00:00 2001 From: Jaquee Date: Thu, 24 Aug 2017 11:31:56 +0200 Subject: [PATCH 4/4] Settings: add wallet creation height and log file paths --- pages/Settings.qml | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/pages/Settings.qml b/pages/Settings.qml index 5a908c0c..8173aba5 100644 --- a/pages/Settings.qml +++ b/pages/Settings.qml @@ -473,7 +473,7 @@ Rectangle { RowLayout { Label { color: "#4A4949" - text: qsTr("Version") + translationManager.emptyString + text: qsTr("Debug info") + translationManager.emptyString fontSize: 16 anchors.topMargin: 30 Layout.topMargin: 30 @@ -485,19 +485,28 @@ Rectangle { color: "#DEDEDE" } - Label { - id: guiVersion + TextBlock { Layout.topMargin: 8 - color: "#4A4949" + Layout.fillWidth: true text: qsTr("GUI version: ") + Version.GUI_VERSION + translationManager.emptyString - fontSize: 16 } - Label { + TextBlock { id: guiMoneroVersion - color: "#4A4949" + Layout.fillWidth: true text: qsTr("Embedded Monero version: ") + Version.GUI_MONERO_VERSION + translationManager.emptyString - fontSize: 16 + } + TextBlock { + Layout.fillWidth: true + text: (typeof currentWallet == "undefined") ? "" : qsTr("Wallet creation height: ") + currentWallet.walletCreationHeight + translationManager.emptyString + } + TextBlock { + Layout.fillWidth: true + text: (typeof currentWallet == "undefined") ? "" : qsTr("Wallet log path: ") + currentWallet.walletLogPath + translationManager.emptyString + } + TextBlock { + Layout.fillWidth: true + text: (typeof currentWallet == "undefined") ? "" : qsTr("Daemon log path: ") + currentWallet.daemonLogPath + translationManager.emptyString } }