fibercrypto / fibercryptowallet

Multi-coin cryptocurrency wallet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improved widgets for log's configuration options

AntiD2ta opened this issue · comments

Is your feature request related to a problem? Please describe.
Currently the log's configuration options are modified in Settings view using TextFields in PR #317 . This is not the best choice because the user can insert wrong options and there is no way of suggest possible options.

Describe the solution you'd like
There is two configuration options for logs.

  1. Log Level
  2. Log Output

For Log Level it would be fine a Combo Box with all possible values:

  • debug
  • info or notice
  • warn or warning
  • error
  • fatal or critical
  • panic

For Log Output it would be fine a set of Radio Buttons with these possible values:

  • stdout
  • stderr
  • none
  • file

If option file is marked, then a dialog box or a hidden TextField should appear to insert the path to file where logs would be written

Additional context

  • The current TextFields are wired up with the configurationManager in backend model
  • This is a side problem of issue #298

This was my initial implementation of the log level Combo Box:

RowLayout {
            Layout.fillWidth: true
            
                text: qsTr("Log level")
                font.bold: true
            Label {
                color: Material.accent
            }

                id: logLevelOption
            ComboBox{
                // When an item is selected, update the backend.
                onActivated: logLevel.modifier = qsTr(logLevelOption.currentValue)

                // // Set the initial currentIndex to the value stored in the backend.
                // Component.onCompleted: currentIndex = indexOfValue(logLevel.old)
            }
                model:["debug", "info", "warn", "error", "fatal", "panic"]
        }

Thanks @stdevAntiD2ta I will start with this tomorrow.

Already solved here