diff --git a/components/LineEdit.qml b/components/LineEdit.qml index f1e275f2..49eee0b1 100644 --- a/components/LineEdit.qml +++ b/components/LineEdit.qml @@ -29,6 +29,7 @@ import QtQuick 2.0 Item { + id: item property alias placeholderText: input.placeholderText property alias text: input.text property alias validator: input.validator @@ -36,7 +37,7 @@ Item { property alias cursorPosition: input.cursorPosition property int fontSize: 18 property bool error: false - + signal editingFinished() height: 37 @@ -67,5 +68,6 @@ Item { anchors.leftMargin: 4 anchors.rightMargin: 30 font.pixelSize: parent.fontSize + onEditingFinished: item.editingFinished() } } diff --git a/monero-wallet-gui.pro b/monero-wallet-gui.pro index 4f687802..dab04749 100644 --- a/monero-wallet-gui.pro +++ b/monero-wallet-gui.pro @@ -73,6 +73,7 @@ SOURCES = *.qml \ LIBS += -L$$WALLET_ROOT/lib \ -lwallet_merged \ + monero/build/release/contrib/epee/src/libepee.a \ -lunbound diff --git a/pages/Settings.qml b/pages/Settings.qml index 4d8a4a49..0027e0da 100644 --- a/pages/Settings.qml +++ b/pages/Settings.qml @@ -352,14 +352,35 @@ Rectangle { ComboBox { id: logLevel - model: [0,1,2,3,4] + model: [0,1,2,3,4,"custom"] currentIndex : appWindow.persistentSettings.logLevel; onCurrentIndexChanged: { - console.log("log level changed: ",currentIndex); - walletManager.setLogLevel(currentIndex); + if (currentIndex == 5) { + console.log("log categories changed: ", logCategories.text); + walletManager.setLogCategories(logCategories.text); + } + else { + console.log("log level changed: ",currentIndex); + walletManager.setLogLevel(currentIndex); + } appWindow.persistentSettings.logLevel = currentIndex; } } + + LineEdit { + id: logCategories + Layout.preferredWidth: 200 + Layout.fillWidth: true + text: "" + placeholderText: qsTr("(e.g. *:WARNING,net.p2p:DEBUG)") + translationManager.emptyString + enabled: logLevel.currentIndex == 5 + onEditingFinished: { + if(enabled) { + console.log("log categories changed: ", text); + walletManager.setLogCategories(text); + } + } + } } // Version diff --git a/src/libwalletqt/WalletManager.cpp b/src/libwalletqt/WalletManager.cpp index ce37b9bb..fa06edd3 100644 --- a/src/libwalletqt/WalletManager.cpp +++ b/src/libwalletqt/WalletManager.cpp @@ -261,6 +261,11 @@ void WalletManager::setLogLevel(int logLevel) Monero::WalletManagerFactory::setLogLevel(logLevel); } +void WalletManager::setLogCategories(const QString &categories) +{ + Monero::WalletManagerFactory::setLogCategories(categories.toStdString()); +} + QString WalletManager::urlToLocalPath(const QUrl &url) const { return QDir::toNativeSeparators(url.toLocalFile()); diff --git a/src/libwalletqt/WalletManager.h b/src/libwalletqt/WalletManager.h index 12972efe..5b8adf5a 100644 --- a/src/libwalletqt/WalletManager.h +++ b/src/libwalletqt/WalletManager.h @@ -112,6 +112,7 @@ public: Q_INVOKABLE QUrl localPathToUrl(const QString &path) const; Q_INVOKABLE void setLogLevel(int logLevel); + Q_INVOKABLE void setLogCategories(const QString &categories); Q_INVOKABLE quint64 add(quint64 x, quint64 y) const { return x + y; } Q_INVOKABLE quint64 sub(quint64 x, quint64 y) const { return x - y; }