Merge commit '8d259ceadd5026cecc1dc61224d91aef4f3877b4' into release

This commit is contained in:
张开科 2025-01-07 17:26:59 +08:00
commit cf7cafefbc
9 changed files with 31 additions and 27 deletions

View File

@ -38,6 +38,7 @@ panel: zcalibrate
name: {{ gettext('Nozzle Offset') }}
icon: nozzle_offset
panel: nozzle_offset
enable: {{ printer.extruders.count > 1 }}
[menu __main more limits]
name: {{ gettext('Limits') }}

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: KlipperScreen\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-12-31 14:57+0800\n"
"POT-Creation-Date: 2025-01-07 17:11+0800\n"
"PO-Revision-Date: 2024-06-03 19:09+0000\n"
"Last-Translator: wsj20050623 <2129426599@qq.com>\n"
"Language-Team: Chinese (Simplified) <https://hosted.weblate.org/projects/"
@ -853,11 +853,8 @@ msgstr "恢复出厂设置"
msgid "Restores your print job after a power outage"
msgstr "在断电后恢复您的打印作业"
msgid "Restoring Left extruder temperature, this may take some time"
msgstr "恢复左挤出机温度,这可能需要一些时间"
msgid "Restoring Right extruder temperature, this may take some time"
msgstr "恢复右挤出机温度,这可能需要一些时间"
msgid "Restoring activated extruder temperature, this may take some time."
msgstr "恢复激活喷头的温度,可能需要一些时间。"
msgid "Resume"
msgstr "继续"
@ -1168,6 +1165,9 @@ msgid "second"
msgid_plural "seconds"
msgstr[0] "秒"
#~ msgid "Restoring Left extruder temperature, this may take some time"
#~ msgstr "恢复左挤出机温度,这可能需要一些时间"
#~ msgid "Manual Calibration"
#~ msgstr "手动校准"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: KlipperScreen\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-12-31 14:57+0800\n"
"POT-Creation-Date: 2025-01-07 17:11+0800\n"
"PO-Revision-Date: 2024-06-01 12:09+0000\n"
"Last-Translator: 峻瑜哥 <a728728728@gmail.com>\n"
"Language-Team: Chinese (Traditional) <https://hosted.weblate.org/projects/"
@ -853,11 +853,8 @@ msgstr "恢復出廠設置"
msgid "Restores your print job after a power outage"
msgstr "在斷電後恢復您的打印作業"
msgid "Restoring Left extruder temperature, this may take some time"
msgstr "恢復左擠出機溫度,這可能需要一些時間"
msgid "Restoring Right extruder temperature, this may take some time"
msgstr "恢復右擠出機溫度,這可能需要一些時間"
msgid "Restoring activated extruder temperature, this may take some time."
msgstr "恢複激活噴頭的溫度,可能需要一些時間。"
msgid "Resume"
msgstr "繼續"
@ -1168,6 +1165,9 @@ msgid "second"
msgid_plural "seconds"
msgstr[0] "秒"
#~ msgid "Restoring Left extruder temperature, this may take some time"
#~ msgstr "恢復左擠出機溫度,這可能需要一些時間"
#~ msgid "Channel"
#~ msgstr "群組"

View File

@ -4,14 +4,13 @@ prompts_text = [
_("Cancel"),
_("Recovery in progress, please wait"),
_("RESUME ABORTED !"),
_("Noting! Left extruder filament has been run out.")
_("Noting! Right extruder filament has been run out.")
_("Noting! All extruders filament has been run out.")
_("Restoring Left extruder temperature, this may take some time")
_("Restoring Right extruder temperature, this may take some time")
_("Left extruder not hot enough, will reheat and continue.")
_("Right extruder not hot enough, will reheat and continue.")
_("Left extruder detects no filament, please load filament and continue.")
_("Right extruder detects no filament, please load filament and continue.")
_("Ok")
_("Noting! Left extruder filament has been run out."),
_("Noting! Right extruder filament has been run out."),
_("Noting! All extruders filament has been run out."),
_("Restoring activated extruder temperature, this may take some time."),
_("Left extruder not hot enough, will reheat and continue."),
_("Right extruder not hot enough, will reheat and continue."),
_("Left extruder detects no filament, please load filament and continue."),
_("Right extruder detects no filament, please load filament and continue."),
_("Ok"),
]

View File

@ -23,14 +23,14 @@ class Prompt:
def decode(self, data):
logging.info(f'{data}')
if data.startswith('prompt_begin'):
self.header = _(data.replace('prompt_begin', '').lstrip())
self.header = _(cleaned_data) if (cleaned_data := data.replace("prompt_begin", "").strip()) else ""
if self.header:
self.window_title = self.header
self.text = ""
self.buttons = []
return
elif data.startswith('prompt_text'):
self.text = _(data.replace('prompt_text ', '').lstrip())
self.text = _(cleaned_data) if (cleaned_data := data.replace("prompt_text", "").strip()) else ""
return
elif data.startswith('prompt_button ') or data.startswith('prompt_footer_button'):
data = data.replace('prompt_button ', '')

View File

@ -138,6 +138,10 @@ class Panel(ScreenPanel):
speedbox.add(speedgrid)
filament_sensors = self._printer.get_filament_sensors()
res = self._screen.apiclient.send_request("printer/objects/query?" + "&".join(filament_sensors))
if res.get('status'):
self._printer.data.update(res['status'])
sensors = Gtk.Grid(valign=Gtk.Align.CENTER, row_spacing=5, column_spacing=5)
if len(filament_sensors) > 0:
for s, x in enumerate(filament_sensors):

View File

@ -876,7 +876,7 @@ class KlipperScreen(Gtk.Window):
elif action == "notify_update_response":
if 'message' in data and 'Error' in data['message']:
logging.error(f"{action}:{data['message']}")
self.show_popup_message(_(data['message'].lstrip()), 3, from_ws=True)
self.show_popup_message(_(cleaned_data) if (cleaned_data := data['message'].strip()) else "", 3, from_ws=True)
if "KlipperScreen" in data['message']:
self.restart_ks()
elif action == "notify_power_changed":
@ -895,9 +895,9 @@ class KlipperScreen(Gtk.Window):
return
self.prompt.decode(action)
elif data.startswith("echo: "):
self.show_popup_message(_(data[6:].lstrip()), 1, from_ws=True)
self.show_popup_message(_(cleaned_data) if (cleaned_data := data[6:].strip()) else "", 1, from_ws=True)
elif data.startswith("!! "):
self.show_popup_message(_(data[3:].lstrip()), 3, from_ws=True)
self.show_popup_message(_(cleaned_data) if (cleaned_data := data[3:].strip()) else "", 3, from_ws=True)
elif "unknown" in data.lower() and \
not ("TESTZ" in data or "MEASURE_AXES_NOISE" in data or "ACCELEROMETER_QUERY" in data):
self.show_popup_message(data, from_ws=True)