implemented log settings
This commit is contained in:
10
settings.py
10
settings.py
@@ -67,12 +67,20 @@ class SettingsScreen(ModalScreen):
|
||||
elif event.switch.id == "plugins-enabled":
|
||||
self.app.config_handler.set("plugins", "enabled", str(int(event.value)))
|
||||
self.notify("Restart for changes to apply.", title="Restart Required", severity="warning")
|
||||
elif event.switch.id == "plugins-log":
|
||||
self.app.config_handler.set("plugins", "log", str(int(event.value)))
|
||||
|
||||
def on_select_changed(self, event: Select.Changed):
|
||||
if event.select.id == "colour-theme":
|
||||
self.app.theme = event.value
|
||||
self.app.config_handler.set("appearance", "colour_theme", str(event.value))
|
||||
|
||||
def on_input_changed(self, event: Input.Changed):
|
||||
if not event.input.is_valid: return
|
||||
|
||||
if event.input.id == "log-timeout":
|
||||
self.app.config_handler.set("plugins", "log_timeout", str(event.input.value))
|
||||
|
||||
def compose(self):
|
||||
with Vertical(id="window") as window:
|
||||
window.border_title = "Settings"
|
||||
@@ -114,5 +122,5 @@ class SettingsScreen(ModalScreen):
|
||||
with HorizontalGroup(classes="setting"):
|
||||
with VerticalGroup():
|
||||
yield Label("Log Timeout", classes="setting-name")
|
||||
yield Label("How many seconds before the log automatically closes. This gets overriden by the [b]Plugins Log[/] option. The window doesn't automatically close if there was an error.", classes="setting-desc")
|
||||
yield Label("How many seconds before the log automatically closes. This gets overriden by the [b]Plugins Log[/] option. The window doesn't automatically close if there was an error. If this is set to -1, the log will not close automatically.", classes="setting-desc")
|
||||
yield Input(value=self.app.config_handler.get("plugins", "log_timeout"), id="log-timeout", type="integer")
|
||||
Reference in New Issue
Block a user