From 5a44d43219ded9220e49e43bd66664a883ccf416 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: Thu, 28 Nov 2024 00:29:35 +0800 Subject: [PATCH] . --- cpp/version.cmake | 2 +- py/LunaTranslator/gui/dialog_savedgame_v3.py | 2 +- py/LunaTranslator/gui/showword.py | 4 +++- py/LunaTranslator/gui/usefulwidget.py | 8 ++++---- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/cpp/version.cmake b/cpp/version.cmake index e0bee9c4..9c2188f4 100644 --- a/cpp/version.cmake +++ b/cpp/version.cmake @@ -1,7 +1,7 @@ set(VERSION_MAJOR 6) set(VERSION_MINOR 6) -set(VERSION_PATCH 8) +set(VERSION_PATCH 9) set(VERSION_REVISION 0) set(LUNA_VERSION "{${VERSION_MAJOR},${VERSION_MINOR},${VERSION_PATCH},${VERSION_REVISION}}") add_library(VERSION_DEF ${CMAKE_CURRENT_LIST_DIR}/version_def.cpp) diff --git a/py/LunaTranslator/gui/dialog_savedgame_v3.py b/py/LunaTranslator/gui/dialog_savedgame_v3.py index b6de9415..a46dfed4 100644 --- a/py/LunaTranslator/gui/dialog_savedgame_v3.py +++ b/py/LunaTranslator/gui/dialog_savedgame_v3.py @@ -612,7 +612,7 @@ class pixwrapper(QWidget): ("画廊"), ("画廊"), savehook_new_data[self.k]["imagepath_all"], - closecallback=lambda: self.setpix(self.k), + closecallback=lambda changed: self.setpix(self.k) if changed else None, ispathsedit=dict(filter1=getimagefilefilter()), ) elif action == setimage: diff --git a/py/LunaTranslator/gui/showword.py b/py/LunaTranslator/gui/showword.py index 2fac1be3..7cbf729f 100644 --- a/py/LunaTranslator/gui/showword.py +++ b/py/LunaTranslator/gui/showword.py @@ -485,7 +485,9 @@ class AnkiWindow(QWidget): "DeckName_i", ) - def refreshcombo(combo: QComboBox): + def refreshcombo(combo: QComboBox, changed): + if not changed: + return combo.clear() if len(globalconfig["ankiconnect"]["DeckNameS"]) == 0: globalconfig["ankiconnect"]["DeckNameS"].append("lunadeck") diff --git a/py/LunaTranslator/gui/usefulwidget.py b/py/LunaTranslator/gui/usefulwidget.py index d9565cd0..203e65e5 100644 --- a/py/LunaTranslator/gui/usefulwidget.py +++ b/py/LunaTranslator/gui/usefulwidget.py @@ -2091,8 +2091,7 @@ class listediter(LDialog): dedump.add(k) if self.closecallback: after = pickle.dumps(self.lst) - if before != after: - self.closecallback() + self.closecallback(before != after) def __cb(self, paths): if isinstance(paths, str): @@ -2192,8 +2191,9 @@ class listediterline(QWidget): self.edit.setReadOnly(True) self.edit.clicked.connect(callback) - def callback(self): - self.setText("|".join(self.reflist)) + def callback(self, changed): + if changed: + self.setText("|".join(self.reflist)) if self.directedit: self.edit.setReadOnly(False)