From b55a0c06a5d711954b50e8576a58802ef42dff62 Mon Sep 17 00:00:00 2001 From: KenanZhu <3471685733@qq.com> Date: Mon, 16 Feb 2026 14:17:58 +0800 Subject: [PATCH] =?UTF-8?q?refactor(ALConfigWidget,=20ALTimerTaskManageWid?= =?UTF-8?q?get):=20=E9=87=8D=E6=9E=84=E9=85=8D=E7=BD=AE=E5=92=8C=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E5=99=A8=E4=BB=BB=E5=8A=A1=E7=AE=A1=E7=90=86=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=E7=9A=84=E9=85=8D=E7=BD=AE=E6=98=BE=E5=BC=8F=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改后配置文件的初始化将不再通过 QMessageBox 提示用户,界面将只在初始化失败时显示错误信息。 --- src/gui/ALConfigWidget.py | 8 +------- src/gui/ALTimerTaskManageWidget.py | 13 +------------ 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/src/gui/ALConfigWidget.py b/src/gui/ALConfigWidget.py index e3ac87a..e378d5b 100644 --- a/src/gui/ALConfigWidget.py +++ b/src/gui/ALConfigWidget.py @@ -194,7 +194,7 @@ class ALConfigWidget(QWidget, Ui_ALConfigWidget): which: str ) -> bool: - msg = "" + msg = "" # no use for now is_success = True if which == "run": run_config_path = self.__config_paths[which] @@ -222,12 +222,6 @@ class ALConfigWidget(QWidget, Ui_ALConfigWidget): self.__config_data[which] = self.loadUserConfig(user_config_path) if self.__config_data[which] is None: is_success = False - if msg: - QMessageBox.information( - self, - "提示 - AutoLibrary", - f"配置文件初始化完成: \n{msg}" - ) return is_success diff --git a/src/gui/ALTimerTaskManageWidget.py b/src/gui/ALTimerTaskManageWidget.py index 7c9a8ac..b07e5ca 100644 --- a/src/gui/ALTimerTaskManageWidget.py +++ b/src/gui/ALTimerTaskManageWidget.py @@ -190,11 +190,6 @@ class ALTimerTaskManageWidget(QWidget, Ui_ALTimerTaskManageWidget): return True timer_tasks = [] if self.saveTimerTasks(self.__timer_tasks_config_path, copy.deepcopy(timer_tasks)): - QMessageBox.information( - self, - "信息 - AutoLibrary", - f"定时任务配置文件初始化完成: \n{self.__timer_tasks_config_path}" - ) self.__timer_tasks = timer_tasks self.updateTimerTaskList() return True @@ -217,13 +212,7 @@ class ALTimerTaskManageWidget(QWidget, Ui_ALTimerTaskManageWidget): task["status"] = ALTimerTaskStatus(task["status"]) return timer_tasks["timer_tasks"] raise Exception("定时任务配置文件格式错误") - except Exception as e: - QMessageBox.warning( - self, - "警告 - AutoLibrary", - f"加载定时任务配置发生错误 ! : {e}\n"\ - f"文件路径: {timer_tasks_config_path}" - ) + except Exception: return None