screen: popups can be configured to not close #456

This commit is contained in:
alfrix 2022-07-14 23:58:30 -03:00 committed by Alfredo Monclus
parent 5234a5dc15
commit 752e53ff56
3 changed files with 8 additions and 1 deletions

View File

@ -27,6 +27,9 @@ job_complete_timeout: 0
# Time in seconds before the Job Status closes itself if an error is encountered
job_error_timeout: 0
# Autoclose popups, this includes various notifications and M118
autoclose_popups: True
# Specify the language
# The language can be specified here instead of using the system default language.
language: en
@ -44,6 +47,7 @@ default_printer: Ender 3 Pro
# set this to False. See Menu section below.
use_default_menu: True
```
## Printer Options

View File

@ -141,6 +141,8 @@ class KlipperScreenConfig:
{"print_estimate_compensation": {
"section": "main", "name": _("Slicer Time correction (%)"), "type": "scale", "value": "100",
"range": [50, 150], "step": 1}},
{"autoclose_popups": {"section": "main", "name": _("Auto-close notifications"), "type": "binary",
"value": "True"}},
# {"": {"section": "main", "name": _(""), "type": ""}}
]

View File

@ -382,7 +382,8 @@ class KlipperScreen(Gtk.Window):
self.show_all()
self.popup_message = box
GLib.timeout_add_seconds(10, self.close_popup_message)
if self._config.get_main_config().getboolean('autoclose_popups'):
GLib.timeout_add_seconds(10, self.close_popup_message)
return False