From 14cdd4d4f71623ff25501577d0329963290fe86e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <1173718158@qq.com> Date: Sun, 29 Dec 2024 01:43:17 +0800 Subject: [PATCH] . --- py/LunaTranslator/gui/dialog_savedgame.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/py/LunaTranslator/gui/dialog_savedgame.py b/py/LunaTranslator/gui/dialog_savedgame.py index 264fb8aa..2bdfe1bf 100644 --- a/py/LunaTranslator/gui/dialog_savedgame.py +++ b/py/LunaTranslator/gui/dialog_savedgame.py @@ -225,15 +225,17 @@ class TagWidget(QWidget): self.__addTag((tag, _type, refdata)) self.__calltagschanged(signal) - @tryprint def __removeTag(self, key): _w = self.tag2widget[key] self.layout().removeWidget(_w) self.tag2widget.pop(key) def removeTag(self, key, signal=True): - self.__removeTag(key) - self.__calltagschanged(signal) + try: + self.__removeTag(key) + self.__calltagschanged(signal) + except: + pass def __calltagschanged(self, signal): if signal: @@ -241,7 +243,10 @@ class TagWidget(QWidget): def clearTag(self, signal=True): for key in self.tag2widget.copy(): - self.__removeTag(key) + try: + self.__removeTag(key) + except: + pass self.__calltagschanged(signal)