From 43d59e7127a25f298b10041bc8c98ebb104e77f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Fri, 28 Jun 2024 14:14:20 +0800 Subject: [PATCH] fix --- .../LunaTranslator/gui/dialog_savedgame.py | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py index e6152d35..ff7df198 100644 --- a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py +++ b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py @@ -2600,24 +2600,27 @@ def getalistname(parent, callback, skipid=False, skipidid=None): uid = __uid[__d["k"]] callback(uid) - autoinitdialog( - parent, - _TR("目标"), - 600, - [ - { - "type": "combo", - "name": _TR("目标"), - "d": __d, - "k": "k", - "list": __vis, - }, - { - "type": "okcancel", - "callback": functools.partial(__wrap, callback, __d, __uid), - }, - ], - ) + if len(__uid) > 1: + autoinitdialog( + parent, + _TR("目标"), + 600, + [ + { + "type": "combo", + "name": _TR("目标"), + "d": __d, + "k": "k", + "list": __vis, + }, + { + "type": "okcancel", + "callback": functools.partial(__wrap, callback, __d, __uid), + }, + ], + ) + else: + callback(__uid[0]) class dialog_savedgame_v3(QWidget): @@ -2910,7 +2913,7 @@ class dialog_savedgame_v3(QWidget): "opened": True, } savegametaged.insert(i, tag) - group0 = self.createtaglist(title, tag["uid"], True) + group0 = self.createtaglist(self.stack, title, tag["uid"], True) self.stack.insertw(i, group0) elif action == editname: self.stack.w(i).settitle(title)