mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-25 20:15:54 +00:00
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:
commit
160e5c480a
5 changed files with 34 additions and 4 deletions
|
@ -29,6 +29,7 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
id: item
|
||||||
property alias placeholderText: input.placeholderText
|
property alias placeholderText: input.placeholderText
|
||||||
property alias text: input.text
|
property alias text: input.text
|
||||||
property alias validator: input.validator
|
property alias validator: input.validator
|
||||||
|
@ -36,7 +37,7 @@ Item {
|
||||||
property alias cursorPosition: input.cursorPosition
|
property alias cursorPosition: input.cursorPosition
|
||||||
property int fontSize: 18
|
property int fontSize: 18
|
||||||
property bool error: false
|
property bool error: false
|
||||||
|
signal editingFinished()
|
||||||
|
|
||||||
height: 37
|
height: 37
|
||||||
|
|
||||||
|
@ -67,5 +68,6 @@ Item {
|
||||||
anchors.leftMargin: 4
|
anchors.leftMargin: 4
|
||||||
anchors.rightMargin: 30
|
anchors.rightMargin: 30
|
||||||
font.pixelSize: parent.fontSize
|
font.pixelSize: parent.fontSize
|
||||||
|
onEditingFinished: item.editingFinished()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,6 +73,7 @@ SOURCES = *.qml \
|
||||||
|
|
||||||
LIBS += -L$$WALLET_ROOT/lib \
|
LIBS += -L$$WALLET_ROOT/lib \
|
||||||
-lwallet_merged \
|
-lwallet_merged \
|
||||||
|
monero/build/release/contrib/epee/src/libepee.a \
|
||||||
-lunbound
|
-lunbound
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -352,14 +352,35 @@ Rectangle {
|
||||||
|
|
||||||
ComboBox {
|
ComboBox {
|
||||||
id: logLevel
|
id: logLevel
|
||||||
model: [0,1,2,3,4]
|
model: [0,1,2,3,4,"custom"]
|
||||||
currentIndex : appWindow.persistentSettings.logLevel;
|
currentIndex : appWindow.persistentSettings.logLevel;
|
||||||
onCurrentIndexChanged: {
|
onCurrentIndexChanged: {
|
||||||
|
if (currentIndex == 5) {
|
||||||
|
console.log("log categories changed: ", logCategories.text);
|
||||||
|
walletManager.setLogCategories(logCategories.text);
|
||||||
|
}
|
||||||
|
else {
|
||||||
console.log("log level changed: ",currentIndex);
|
console.log("log level changed: ",currentIndex);
|
||||||
walletManager.setLogLevel(currentIndex);
|
walletManager.setLogLevel(currentIndex);
|
||||||
|
}
|
||||||
appWindow.persistentSettings.logLevel = 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
|
// Version
|
||||||
|
|
|
@ -261,6 +261,11 @@ void WalletManager::setLogLevel(int logLevel)
|
||||||
Monero::WalletManagerFactory::setLogLevel(logLevel);
|
Monero::WalletManagerFactory::setLogLevel(logLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WalletManager::setLogCategories(const QString &categories)
|
||||||
|
{
|
||||||
|
Monero::WalletManagerFactory::setLogCategories(categories.toStdString());
|
||||||
|
}
|
||||||
|
|
||||||
QString WalletManager::urlToLocalPath(const QUrl &url) const
|
QString WalletManager::urlToLocalPath(const QUrl &url) const
|
||||||
{
|
{
|
||||||
return QDir::toNativeSeparators(url.toLocalFile());
|
return QDir::toNativeSeparators(url.toLocalFile());
|
||||||
|
|
|
@ -112,6 +112,7 @@ public:
|
||||||
Q_INVOKABLE QUrl localPathToUrl(const QString &path) const;
|
Q_INVOKABLE QUrl localPathToUrl(const QString &path) const;
|
||||||
|
|
||||||
Q_INVOKABLE void setLogLevel(int logLevel);
|
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 add(quint64 x, quint64 y) const { return x + y; }
|
||||||
Q_INVOKABLE quint64 sub(quint64 x, quint64 y) const { return x - y; }
|
Q_INVOKABLE quint64 sub(quint64 x, quint64 y) const { return x - y; }
|
||||||
|
|
Loading…
Reference in a new issue