forked from Public/monero-gui
Settings - dropdown for log level
This commit is contained in:
committed by
moneromooo-monero
parent
0b9e89691d
commit
0477af1b0d
@@ -43,12 +43,19 @@ Rectangle {
|
|||||||
|
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
Clipboard { id: clipboard }
|
// fires on every page load
|
||||||
|
function onPageCompleted() {
|
||||||
|
console.log("Settings page loaded");
|
||||||
|
|
||||||
function initSettings() {
|
if(typeof daemonManager != "undefined"){
|
||||||
//runs on every page load
|
appWindow.daemonRunning = daemonManager.running(persistentSettings.testnet);
|
||||||
|
}
|
||||||
|
|
||||||
|
logLevelDropdown.update()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Clipboard { id: clipboard }
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: mainLayout
|
id: mainLayout
|
||||||
anchors.margins: (isMobile)? 17 : 40
|
anchors.margins: (isMobile)? 17 : 40
|
||||||
@@ -483,28 +490,66 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
GridLayout {
|
||||||
ComboBox {
|
columns: (isMobile)? 1 : 3
|
||||||
id: logLevel
|
Layout.fillWidth: true
|
||||||
model: [0,1,2,3,4,"custom"]
|
columnSpacing: 32
|
||||||
currentIndex : appWindow.persistentSettings.logLevel;
|
|
||||||
onCurrentIndexChanged: {
|
ColumnLayout {
|
||||||
if (currentIndex == 5) {
|
spacing: 0
|
||||||
console.log("log categories changed: ", logCategories.text);
|
Layout.fillWidth: true
|
||||||
walletManager.setLogCategories(logCategories.text);
|
|
||||||
|
ListModel {
|
||||||
|
id: logLevel
|
||||||
|
ListElement { name: "wow"; column1: "0"; }
|
||||||
|
ListElement { column1: "1"; }
|
||||||
|
ListElement { column1: "2"; }
|
||||||
|
ListElement { column1: "3"; }
|
||||||
|
ListElement { column1: "4"; }
|
||||||
|
ListElement { column1: "custom"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
StandardDropdown {
|
||||||
|
id: logLevelDropdown
|
||||||
|
dataModel: logLevel
|
||||||
|
currentIndex: appWindow.persistentSettings.logLevel;
|
||||||
|
onChanged: {
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
else {
|
Layout.fillWidth: true
|
||||||
console.log("log level changed: ",currentIndex);
|
shadowReleasedColor: "#FF4304"
|
||||||
walletManager.setLogLevel(currentIndex);
|
shadowPressedColor: "#B32D00"
|
||||||
}
|
releasedColor: "#363636"
|
||||||
appWindow.persistentSettings.logLevel = currentIndex;
|
pressedColor: "#202020"
|
||||||
}
|
}
|
||||||
|
// Make sure dropdown is on top
|
||||||
|
z: parent.z + 30
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
LineEdit {
|
LineEdit {
|
||||||
id: logCategories
|
id: logCategories
|
||||||
|
Layout.topMargin: 16 * scaleRatio
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
text: appWindow.persistentSettings.logCategories
|
text: appWindow.persistentSettings.logCategories
|
||||||
|
labelText: "Log Categories"
|
||||||
placeholderText: qsTr("(e.g. *:WARNING,net.p2p:DEBUG)") + translationManager.emptyString
|
placeholderText: qsTr("(e.g. *:WARNING,net.p2p:DEBUG)") + translationManager.emptyString
|
||||||
enabled: logLevel.currentIndex == 5
|
enabled: logLevel.currentIndex == 5
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
|
|||||||
Reference in New Issue
Block a user