Merge pull request #413

fb8d9bd Settings: allow setting log categories (moneromooo.monero)
ea8bc5b LineEdit: forward editingFinished signal (moneromooo.monero)
d4b3834 Build against monero with new logging system (moneromooo.monero)
This commit is contained in:
Riccardo Spagni 2017-01-22 12:15:55 -05:00
commit 160e5c480a
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD
5 changed files with 34 additions and 4 deletions

View file

@ -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()
}
}

View file

@ -73,6 +73,7 @@ SOURCES = *.qml \
LIBS += -L$$WALLET_ROOT/lib \
-lwallet_merged \
monero/build/release/contrib/epee/src/libepee.a \
-lunbound

View file

@ -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

View file

@ -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());

View file

@ -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; }