mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
fix
This commit is contained in:
parent
d43673f3c8
commit
cb3cdf1ce3
@ -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(
|
editpath.textChanged.connect(
|
||||||
lambda _: globalconfig.__setitem__("backupsavedatato", _)
|
lambda _: globalconfig.__setitem__("backupsavedatato", _)
|
||||||
)
|
)
|
||||||
|
editpath = QLineEdit(
|
||||||
|
globalconfig["backupsavedatato"]
|
||||||
|
if os.path.exists(globalconfig["backupsavedatato"])
|
||||||
|
else os.path.abspath("./cache/backup")
|
||||||
|
)
|
||||||
editpath.setReadOnly(True)
|
editpath.setReadOnly(True)
|
||||||
formLayout.addRow(
|
formLayout.addRow(
|
||||||
_TR("备份到"),
|
_TR("备份到"),
|
||||||
@ -1494,7 +1495,7 @@ class dialog_savedgame_new(saveposwindow):
|
|||||||
self.flow = ScrollFlow()
|
self.flow = ScrollFlow()
|
||||||
self.flow.bgclicked.connect(ItemWidget.clearfocus)
|
self.flow.bgclicked.connect(ItemWidget.clearfocus)
|
||||||
self.formLayout.insertWidget(self.formLayout.count() - 1, self.flow)
|
self.formLayout.insertWidget(self.formLayout.count() - 1, self.flow)
|
||||||
|
|
||||||
for k in savehook_new_list:
|
for k in savehook_new_list:
|
||||||
if newtags != self.currtags:
|
if newtags != self.currtags:
|
||||||
break
|
break
|
||||||
@ -1529,6 +1530,7 @@ class dialog_savedgame_new(saveposwindow):
|
|||||||
continue
|
continue
|
||||||
self.newline(k)
|
self.newline(k)
|
||||||
self.flow.refreshscroll()
|
self.flow.refreshscroll()
|
||||||
|
|
||||||
def showmenu(self, p):
|
def showmenu(self, p):
|
||||||
menu = QMenu(self)
|
menu = QMenu(self)
|
||||||
startgame = QAction(_TR("开始游戏"))
|
startgame = QAction(_TR("开始游戏"))
|
||||||
@ -1647,13 +1649,14 @@ class dialog_savedgame_new(saveposwindow):
|
|||||||
)
|
)
|
||||||
_btn.setEnabled(_able1)
|
_btn.setEnabled(_able1)
|
||||||
|
|
||||||
def _getpixfunction(self,kk):
|
def _getpixfunction(self, kk):
|
||||||
_pix = QPixmap(savehook_new_data[kk]["imagepath"])
|
_pix = QPixmap(savehook_new_data[kk]["imagepath"])
|
||||||
if _pix.isNull():
|
if _pix.isNull():
|
||||||
_pix = getExeIcon(kk, False, cache=True)
|
_pix = getExeIcon(kk, False, cache=True)
|
||||||
return _pix
|
return _pix
|
||||||
def getagameitem(self,k):
|
|
||||||
|
def getagameitem(self, k):
|
||||||
|
|
||||||
gameitem = ItemWidget(
|
gameitem = ItemWidget(
|
||||||
functools.partial(self._getpixfunction, k), savehook_new_data[k]["title"]
|
functools.partial(self._getpixfunction, k), savehook_new_data[k]["title"]
|
||||||
)
|
)
|
||||||
@ -1661,19 +1664,20 @@ class dialog_savedgame_new(saveposwindow):
|
|||||||
gameitem.doubleclicked.connect(self.startgame)
|
gameitem.doubleclicked.connect(self.startgame)
|
||||||
gameitem.focuschanged.connect(self.itemfocuschanged)
|
gameitem.focuschanged.connect(self.itemfocuschanged)
|
||||||
return gameitem
|
return gameitem
|
||||||
|
|
||||||
def newline(self, k, first=False):
|
def newline(self, k, first=False):
|
||||||
checkifnewgame(k)
|
checkifnewgame(k)
|
||||||
|
|
||||||
|
|
||||||
if first:
|
if first:
|
||||||
|
|
||||||
self.flow.insertwidget(0, self.getagameitem(k))
|
self.flow.insertwidget(0, self.getagameitem(k))
|
||||||
self.idxsave.insert(0, k)
|
self.idxsave.insert(0, k)
|
||||||
else:
|
else:
|
||||||
itemw = globalconfig["dialog_savegame_layout"]["itemw"]
|
itemw = globalconfig["dialog_savegame_layout"]["itemw"]
|
||||||
itemh = globalconfig["dialog_savegame_layout"]["itemh"]
|
itemh = globalconfig["dialog_savegame_layout"]["itemh"]
|
||||||
|
|
||||||
|
self.flow.addwidgetlazy(
|
||||||
self.flow.addwidgetlazy( functools.partial(self.getagameitem, k),QSize(itemw,itemh))
|
functools.partial(self.getagameitem, k), QSize(itemw, itemh)
|
||||||
#self.flow.addwidget( self.getagameitem(k))
|
)
|
||||||
|
# self.flow.addwidget( self.getagameitem(k))
|
||||||
self.idxsave.append(k)
|
self.idxsave.append(k)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user