From 667311f2563c4d3c4896d82fe6f4f0a78de2a2ef Mon Sep 17 00:00:00 2001 From: astro Date: Fri, 3 May 2024 16:11:13 +0800 Subject: [PATCH] remove log, update button text --- src/main/python/amk/animation.py | 16 +++++++++------- src/main/python/amk/misc.py | 2 +- src/main/python/amk/protocol.py | 21 +++++++++++---------- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/main/python/amk/animation.py b/src/main/python/amk/animation.py index f88efe39b1..56ff0af4bb 100644 --- a/src/main/python/amk/animation.py +++ b/src/main/python/amk/animation.py @@ -68,10 +68,10 @@ DOWNLOAD_BTN_CONVERTING = "Converting 正在转换" DOWNLOAD_BTN_UPLOAD = "Uploading 正在上传" -DOWNLOAD_BTN_NORMAL = "Upload to keyboard 上传到键盘" +DOWNLOAD_BTN_NORMAL = "Upload to keyboard (Standard Mode) 上传到键盘(标准模式)" -FASTDOWNLOAD_BTN_UPLOAD = "Quick uploading 正在上传" -FASTDOWNLOAD_BTN_NORMAL = "Quick upload to keyboard 上传到键盘" +FASTDOWNLOAD_BTN_UPLOAD = "Uploading 正在上传" +FASTDOWNLOAD_BTN_NORMAL = "Upload to keyboard (Advance Mode) 上传到键盘(高级模式)" COPY_BTN_DOWNLOAD = "Downloading 正在下载" COPY_BTN_NORMAL = "Download 下载" @@ -583,7 +583,8 @@ def rebuild(self, device): self.keyboard = device.keyboard self.rebuild_ui() if self.keyboard.animations["transfer"] == "fast": - self.keyboard.fast_init(device) + if not self.keyboard.fast_init(device): + self.fastdownload_btn.setEnabled(False) else: self.fastdownload_btn.hide() @@ -636,7 +637,8 @@ def on_task_done(self, refresh): self.download_btn.setText(DOWNLOAD_BTN_NORMAL) self.download_btn.setEnabled(True) self.fastdownload_btn.setText(FASTDOWNLOAD_BTN_NORMAL) - self.fastdownload_btn.setEnabled(True) + if self.keyboard.fast_available(): + self.fastdownload_btn.setEnabled(True) self.copy_btn.setText(COPY_BTN_NORMAL) self.copy_btn.setEnabled(True) self.convert_btn.setText(CONVERT_BTN_NORMAL) @@ -667,10 +669,10 @@ def is_space_available(self, frame_size): free_space = self.keyboard.animations["disk"].get("free_space") if free_space is None: - print("don't get free space") + #print("don't get free space") return False - print("Free sapce:{}, File size:{}".format(free_space, total)) + #print("Free sapce:{}, File size:{}".format(free_space, total)) return free_space > total def on_download_btn_clicked(self): diff --git a/src/main/python/amk/misc.py b/src/main/python/amk/misc.py index e482c8112e..1a435c8dec 100644 --- a/src/main/python/amk/misc.py +++ b/src/main/python/amk/misc.py @@ -405,7 +405,7 @@ def on_im_btn(self): pole = kbd.get("pole", None) if pole is not None: self.keyboard.apply_pole(pole) - print("set pole as {}".format(pole)) + #print("set pole as {}".format(pole)) nkro = kbd.get("nkro", None) if nkro is not None: self.keyboard.apply_nkro(nkro) diff --git a/src/main/python/amk/protocol.py b/src/main/python/amk/protocol.py index f803f2678d..6b8b961642 100644 --- a/src/main/python/amk/protocol.py +++ b/src/main/python/amk/protocol.py @@ -743,7 +743,7 @@ def reload_anim_file_list(self): total_file, free_space, total_space = struct.unpack("= len(self.amk_rgb_matrix["leds"]): return None