This commit is contained in:
恍兮惚兮 2024-04-12 18:40:09 +08:00
parent d43673f3c8
commit cb3cdf1ce3

View File

@ -634,13 +634,14 @@ class dialog_setting_game(QDialog):
),
)
if os.path.exists(globalconfig["backupsavedatato"]) == False:
globalconfig["backupsavedatato"] = os.path.abspath("./cache/backup")
editpath = QLineEdit(globalconfig["backupsavedatato"])
editpath.textChanged.connect(
lambda _: globalconfig.__setitem__("backupsavedatato", _)
)
editpath = QLineEdit(
globalconfig["backupsavedatato"]
if os.path.exists(globalconfig["backupsavedatato"])
else os.path.abspath("./cache/backup")
)
editpath.setReadOnly(True)
formLayout.addRow(
_TR("备份到"),
@ -1529,6 +1530,7 @@ class dialog_savedgame_new(saveposwindow):
continue
self.newline(k)
self.flow.refreshscroll()
def showmenu(self, p):
menu = QMenu(self)
startgame = QAction(_TR("开始游戏"))
@ -1652,6 +1654,7 @@ class dialog_savedgame_new(saveposwindow):
if _pix.isNull():
_pix = getExeIcon(kk, False, cache=True)
return _pix
def getagameitem(self, k):
gameitem = ItemWidget(
@ -1661,10 +1664,10 @@ class dialog_savedgame_new(saveposwindow):
gameitem.doubleclicked.connect(self.startgame)
gameitem.focuschanged.connect(self.itemfocuschanged)
return gameitem
def newline(self, k, first=False):
checkifnewgame(k)
if first:
self.flow.insertwidget(0, self.getagameitem(k))
@ -1673,7 +1676,8 @@ class dialog_savedgame_new(saveposwindow):
itemw = globalconfig["dialog_savegame_layout"]["itemw"]
itemh = globalconfig["dialog_savegame_layout"]["itemh"]
self.flow.addwidgetlazy( functools.partial(self.getagameitem, k),QSize(itemw,itemh))
self.flow.addwidgetlazy(
functools.partial(self.getagameitem, k), QSize(itemw, itemh)
)
# self.flow.addwidget( self.getagameitem(k))
self.idxsave.append(k)