This commit is contained in:
恍兮惚兮 2024-06-09 00:46:35 +08:00
parent 9305695ad0
commit 83b352da6d
17 changed files with 154 additions and 69 deletions

View File

@ -1223,6 +1223,14 @@ class dialog_syssetting(QDialog):
QLabel(_TR("显示标题")), QLabel(_TR("显示标题")),
getsimpleswitch(globalconfig, "showgametitle"), getsimpleswitch(globalconfig, "showgametitle"),
) )
formLayout.addRow(
_TR("显示的项目"),
getsimplecombobox(
_TRL(["GLOBAL", "首位的", "指定的"]),
globalconfig,
"vispolicy",
),
)
self.show() self.show()
@ -1461,12 +1469,34 @@ class dialog_savedgame_integrated(saveposwindow):
) )
def calculatetagidx(tagid):
i = 0
for save in savegametaged:
if save is None and tagid is None:
return i
elif save and tagid and save["uid"] == tagid:
return i
i += 1
return None
def getreflist(reftagid):
_idx = calculatetagidx(reftagid)
if _idx is None:
return None
tag = savegametaged[_idx]
if tag is None:
return savehook_new_list
return tag["games"]
class dialog_savedgame_new(QWidget): class dialog_savedgame_new(QWidget):
def clicked2(self): def clicked2(self):
try: try:
game = self.currentfocuspath game = self.currentfocuspath
idx2 = savehook_new_list.index(game) idx2 = self.reflist.index(game)
savehook_new_list.pop(idx2) self.reflist.pop(idx2)
idx2 = self.idxsave.index(game) idx2 = self.idxsave.index(game)
self.flow.removeidx(idx2) self.flow.removeidx(idx2)
@ -1484,10 +1514,10 @@ class dialog_savedgame_new(QWidget):
opendir(self.currentfocuspath) opendir(self.currentfocuspath)
def clicked3_batch(self): def clicked3_batch(self):
addgamebatch(lambda res: self.newline(res, True), savehook_new_list) addgamebatch(lambda res: self.newline(res, True), self.reflist)
def clicked3(self): def clicked3(self):
addgamesingle(lambda res: self.newline(res, True), savehook_new_list) addgamesingle(lambda res: self.newline(res, True), self.reflist)
def tagschanged(self, tags): def tagschanged(self, tags):
self.currtags = tags self.currtags = tags
@ -1501,7 +1531,7 @@ class dialog_savedgame_new(QWidget):
self.formLayout.insertWidget(self.formLayout.count() - 1, self.flow) self.formLayout.insertWidget(self.formLayout.count() - 1, self.flow)
idx = 0 idx = 0
for k in savehook_new_list: for k in self.reflist:
if newtags != self.currtags: if newtags != self.currtags:
break break
notshow = False notshow = False
@ -1583,6 +1613,17 @@ class dialog_savedgame_new(QWidget):
global _global_dialog_savedgame_new global _global_dialog_savedgame_new
_global_dialog_savedgame_new = self _global_dialog_savedgame_new = self
formLayout = QVBoxLayout() formLayout = QVBoxLayout()
if globalconfig["vispolicy"] == 0:
self.reflist = savehook_new_list
elif globalconfig["vispolicy"] == 1:
if savegametaged[0] is None:
self.reflist = savehook_new_list
else:
self.reflist = savegametaged[0]["games"]
elif globalconfig["vispolicy"] == 2:
self.reflist = getreflist(globalconfig["currvislistuid"])
if self.reflist is None:
self.reflist = savehook_new_list
layout = QHBoxLayout() layout = QHBoxLayout()
layout.setContentsMargins(0, 0, 0, 0) layout.setContentsMargins(0, 0, 0, 0)
@ -1684,9 +1725,9 @@ class dialog_savedgame_new(QWidget):
self.idxsave.insert(idx2, self.idxsave.pop(idx1)) self.idxsave.insert(idx2, self.idxsave.pop(idx1))
self.flow.switchidx(idx1, idx2) self.flow.switchidx(idx1, idx2)
idx1 = savehook_new_list.index(game) idx1 = self.reflist.index(game)
idx2 = savehook_new_list.index(game2) idx2 = self.reflist.index(game2)
savehook_new_list.insert(idx2, savehook_new_list.pop(idx1)) self.reflist.insert(idx2, self.reflist.pop(idx1))
def showsettingdialog(self): def showsettingdialog(self):
try: try:
@ -2141,7 +2182,7 @@ class dialog_savedgame_v3(QWidget):
def newline(self, res): def newline(self, res):
self.reallist[self.reftagid].insert(0, res) self.reallist[self.reftagid].insert(0, res)
self.stack.w(self.calculatetagidx(self.reftagid)).insertw( self.stack.w(calculatetagidx(self.reftagid)).insertw(
0, 0,
functools.partial( functools.partial(
self.delayitemcreater, self.delayitemcreater,
@ -2198,8 +2239,8 @@ class dialog_savedgame_v3(QWidget):
__save = self.reftagid __save = self.reftagid
self.reftagid = uid self.reftagid = uid
if path not in self.getreflist(): if path not in getreflist(self.reftagid):
self.getreflist().insert(0, path) getreflist(self.reftagid).insert(0, path)
self.newline(path) self.newline(path)
self.reftagid = __save self.reftagid = __save
@ -2326,23 +2367,12 @@ class dialog_savedgame_v3(QWidget):
rowreal += 1 rowreal += 1
def taglistrerank(self, tagid, dx): def taglistrerank(self, tagid, dx):
idx1 = self.calculatetagidx(tagid) idx1 = calculatetagidx(tagid)
idx2 = (idx1 + dx) % len(savegametaged) idx2 = (idx1 + dx) % len(savegametaged)
savegametaged.insert(idx2, savegametaged.pop(idx1)) savegametaged.insert(idx2, savegametaged.pop(idx1))
self.stack.switchidx(idx1, idx2) self.stack.switchidx(idx1, idx2)
def calculatetagidx(self, tagid):
i = 0
for save in savegametaged:
if save is None and tagid is None:
break
elif save and tagid and save["uid"] == tagid:
break
i += 1
return i
def tagbuttonmenu(self, tagid): def tagbuttonmenu(self, tagid):
self.currentfocuspath = None self.currentfocuspath = None
self.reftagid = tagid self.reftagid = tagid
@ -2354,7 +2384,7 @@ class dialog_savedgame_v3(QWidget):
Downaction = QAction(_TR("下移")) Downaction = QAction(_TR("下移"))
addgame = QAction(_TR("添加游戏")) addgame = QAction(_TR("添加游戏"))
batchadd = QAction(_TR("批量添加")) batchadd = QAction(_TR("批量添加"))
setasvis = QAction(_TR("设为显示的项目"))
menu.addAction(Upaction) menu.addAction(Upaction)
menu.addAction(Downaction) menu.addAction(Downaction)
if tagid: if tagid:
@ -2364,9 +2394,14 @@ class dialog_savedgame_v3(QWidget):
menu.addAction(dellist) menu.addAction(dellist)
menu.addAction(addgame) menu.addAction(addgame)
menu.addAction(batchadd) menu.addAction(batchadd)
if globalconfig["vispolicy"] == 2:
menu.addAction(setasvis)
action = menu.exec(QCursor.pos()) action = menu.exec(QCursor.pos())
if action == addgame: if action == addgame:
self.clicked3() self.clicked3()
elif action == setasvis:
globalconfig["currvislistuid"] = self.reftagid
elif action == batchadd: elif action == batchadd:
self.clicked3_batch() self.clicked3_batch()
elif action == Upaction: elif action == Upaction:
@ -2387,7 +2422,7 @@ class dialog_savedgame_v3(QWidget):
title = _dia.text[0].text() title = _dia.text[0].text()
if title != "": if title != "":
i = self.calculatetagidx(tagid) i = calculatetagidx(tagid)
if action == addlist: if action == addlist:
tag = { tag = {
"title": title, "title": title,
@ -2403,7 +2438,7 @@ class dialog_savedgame_v3(QWidget):
savegametaged[i]["title"] = title savegametaged[i]["title"] = title
elif action == dellist: elif action == dellist:
i = self.calculatetagidx(tagid) i = calculatetagidx(tagid)
savegametaged.pop(i) savegametaged.pop(i)
self.stack.popw(i) self.stack.popw(i)
self.reallist.pop(tagid) self.reallist.pop(tagid)
@ -2420,31 +2455,19 @@ class dialog_savedgame_v3(QWidget):
) )
return shrinkableitem(_btn, opened) return shrinkableitem(_btn, opened)
def getreflist(self):
tag = savegametaged[self.calculatetagidx(self.reftagid)]
if tag is None:
return savehook_new_list
return tag["games"]
def getrefid(self):
tag = savegametaged[self.calculatetagidx(self.reftagid)]
if tag is None:
return None
return tag["uid"]
def moverank(self, dx): def moverank(self, dx):
game = self.currentfocuspath game = self.currentfocuspath
idx1 = self.reallist[self.getrefid()].index(game) idx1 = self.reallist[self.reftagid].index(game)
idx2 = (idx1 + dx) % len(self.reallist[self.getrefid()]) idx2 = (idx1 + dx) % len(self.reallist[self.reftagid])
game2 = self.reallist[self.getrefid()][idx2] game2 = self.reallist[self.reftagid][idx2]
self.reallist[self.getrefid()].insert( self.reallist[self.reftagid].insert(
idx2, self.reallist[self.getrefid()].pop(idx1) idx2, self.reallist[self.reftagid].pop(idx1)
) )
self.stack.w(self.calculatetagidx(self.reftagid)).switchidx(idx1, idx2) self.stack.w(calculatetagidx(self.reftagid)).switchidx(idx1, idx2)
idx1 = self.getreflist().index(game) idx1 = getreflist(self.reftagid).index(game)
idx2 = self.getreflist().index(game2) idx2 = getreflist(self.reftagid).index(game2)
self.getreflist().insert(idx2, self.getreflist().pop(idx1)) getreflist(self.reftagid).insert(idx2, getreflist(self.reftagid).pop(idx1))
def clicked2(self): def clicked2(self):
if not self.currentfocuspath: if not self.currentfocuspath:
@ -2452,13 +2475,13 @@ class dialog_savedgame_v3(QWidget):
try: try:
game = self.currentfocuspath game = self.currentfocuspath
idx2 = self.getreflist().index(game) idx2 = getreflist(self.reftagid).index(game)
self.getreflist().pop(idx2) getreflist(self.reftagid).pop(idx2)
idx2 = self.reallist[self.getrefid()].index(game) idx2 = self.reallist[self.reftagid].index(game)
self.reallist[self.getrefid()].pop(idx2) self.reallist[self.reftagid].pop(idx2)
clickitem.clearfocus() clickitem.clearfocus()
group0 = self.stack.w(self.calculatetagidx(self.reftagid)) group0 = self.stack.w(calculatetagidx(self.reftagid))
group0.popw(idx2) group0.popw(idx2)
try: try:
group0.w(idx2).click() group0.w(idx2).click()
@ -2471,10 +2494,10 @@ class dialog_savedgame_v3(QWidget):
opendir(self.currentfocuspath) opendir(self.currentfocuspath)
def clicked3_batch(self): def clicked3_batch(self):
addgamebatch(lambda res: self.newline(res), self.getreflist()) addgamebatch(lambda res: self.newline(res), getreflist(self.reftagid))
def clicked3(self): def clicked3(self):
addgamesingle(lambda res: self.newline(res), self.getreflist()) addgamesingle(lambda res: self.newline(res), getreflist(self.reftagid))
def clicked(self): def clicked(self):
startgamecheck(self, self.currentfocuspath) startgamecheck(self, self.currentfocuspath)

View File

@ -171,6 +171,8 @@
500, 500,
500 500
], ],
"vispolicy": 0,
"currvislistuid" : null,
"multiregion": false, "multiregion": false,
"rememberocrregions": false, "rememberocrregions": false,
"ocrregions": [], "ocrregions": [],

View File

@ -827,5 +827,9 @@
"复制": "نسخ", "复制": "نسخ",
"画廊": "معرض", "画廊": "معرض",
"删除图片": "حذف الصور", "删除图片": "حذف الصور",
"备注中自动填入翻译": "التلقائي ملء الترجمة في الملاحظات" "备注中自动填入翻译": "التلقائي ملء الترجمة في الملاحظات",
"显示的项目": "عرض البنود",
"首位的": "أولا",
"指定的": "محدد",
"设为显示的项目": "عرض البند"
} }

View File

@ -827,5 +827,9 @@
"复制": "複製", "复制": "複製",
"画廊": "畫廊", "画廊": "畫廊",
"删除图片": "删除圖片", "删除图片": "删除圖片",
"备注中自动填入翻译": "備註中自動填入翻譯" "备注中自动填入翻译": "備註中自動填入翻譯",
"显示的项目": "顯示的項目",
"首位的": "首位的",
"指定的": "指定的",
"设为显示的项目": "設為顯示的項目"
} }

View File

@ -827,5 +827,9 @@
"复制": "copy", "复制": "copy",
"画廊": "gallery", "画廊": "gallery",
"删除图片": "Delete image", "删除图片": "Delete image",
"备注中自动填入翻译": "Automatically fill in translation in remarks" "备注中自动填入翻译": "Automatically fill in translation in remarks",
"显示的项目": "Displayed items",
"首位的": "First place",
"指定的": "Designated",
"设为显示的项目": "Set as Displayed Project"
} }

View File

@ -827,5 +827,9 @@
"复制": "Copiar", "复制": "Copiar",
"画廊": "Galería", "画廊": "Galería",
"删除图片": "Eliminar imagen", "删除图片": "Eliminar imagen",
"备注中自动填入翻译": "Rellene automáticamente la traducción en las Notas" "备注中自动填入翻译": "Rellene automáticamente la traducción en las Notas",
"显示的项目": "Los proyectos mostrados",
"首位的": "Primero",
"指定的": "Designado",
"设为显示的项目": "Artículos configurados para mostrar"
} }

View File

@ -827,5 +827,9 @@
"复制": "Copier", "复制": "Copier",
"画廊": "Galerie", "画廊": "Galerie",
"删除图片": "Supprimer une image", "删除图片": "Supprimer une image",
"备注中自动填入翻译": "Remplir automatiquement la traduction dans les notes" "备注中自动填入翻译": "Remplir automatiquement la traduction dans les notes",
"显示的项目": "Projets affichés",
"首位的": "La première",
"指定的": "Spécifié",
"设为显示的项目": "Les éléments à afficher"
} }

View File

@ -827,5 +827,9 @@
"复制": "copia", "复制": "copia",
"画廊": "gallery", "画廊": "gallery",
"删除图片": "Elimina immagine", "删除图片": "Elimina immagine",
"备注中自动填入翻译": "Compilare automaticamente la traduzione in commenti" "备注中自动填入翻译": "Compilare automaticamente la traduzione in commenti",
"显示的项目": "Articoli visualizzati",
"首位的": "Primo posto",
"指定的": "Designato",
"设为显示的项目": "Imposta come progetto visualizzato"
} }

View File

@ -827,5 +827,9 @@
"复制": "レプリケーション", "复制": "レプリケーション",
"画廊": "ギャラリー", "画廊": "ギャラリー",
"删除图片": "画像を削除", "删除图片": "画像を削除",
"备注中自动填入翻译": "注記に翻訳を自動的に記入する" "备注中自动填入翻译": "注記に翻訳を自動的に記入する",
"显示的项目": "表示されるアイテム",
"首位的": "トップ",
"指定的": "指定された",
"设为显示的项目": "表示する項目として設定"
} }

View File

@ -827,5 +827,9 @@
"复制": "복제", "复制": "복제",
"画廊": "갤러리", "画廊": "갤러리",
"删除图片": "그림 삭제", "删除图片": "그림 삭제",
"备注中自动填入翻译": "메모에 번역 자동 입력" "备注中自动填入翻译": "메모에 번역 자동 입력",
"显示的项目": "표시된 항목",
"首位的": "수위의",
"指定的": "지정된",
"设为显示的项目": "표시할 항목으로 설정"
} }

View File

@ -827,5 +827,9 @@
"复制": "kopia", "复制": "kopia",
"画廊": "galeria", "画廊": "galeria",
"删除图片": "Usuń obraz", "删除图片": "Usuń obraz",
"备注中自动填入翻译": "Automatycznie wypełniaj tłumaczenie w uwagach" "备注中自动填入翻译": "Automatycznie wypełniaj tłumaczenie w uwagach",
"显示的项目": "Wyświetlane elementy",
"首位的": "Pierwsze miejsce",
"指定的": "Wyznaczone",
"设为显示的项目": "Ustaw jako wyświetlany projekt"
} }

View File

@ -827,5 +827,9 @@
"复制": "Копирование", "复制": "Копирование",
"画廊": "Галерея", "画廊": "Галерея",
"删除图片": "Удалить изображение", "删除图片": "Удалить изображение",
"备注中自动填入翻译": "Автоматически заполнять переводы" "备注中自动填入翻译": "Автоматически заполнять переводы",
"显示的项目": "Показать проект",
"首位的": "Первый",
"指定的": "Назначено",
"设为显示的项目": "Показать проект"
} }

View File

@ -827,5 +827,9 @@
"复制": "คัดลอก", "复制": "คัดลอก",
"画廊": "แกลเลอรี่", "画廊": "แกลเลอรี่",
"删除图片": "ลบรูปภาพ", "删除图片": "ลบรูปภาพ",
"备注中自动填入翻译": "กรอกคำแปลโดยอัตโนมัติในหมายเหตุ" "备注中自动填入翻译": "กรอกคำแปลโดยอัตโนมัติในหมายเหตุ",
"显示的项目": "รายการที่แสดง",
"首位的": "อันดับแรก",
"指定的": "ระบุ",
"设为显示的项目": "รายการที่ตั้งเป็นจอแสดงผล"
} }

View File

@ -827,5 +827,9 @@
"复制": "kopyalama", "复制": "kopyalama",
"画廊": "Galeri", "画廊": "Galeri",
"删除图片": "Resimi sil", "删除图片": "Resimi sil",
"备注中自动填入翻译": "Özellikle tercüme doldur" "备注中自动填入翻译": "Özellikle tercüme doldur",
"显示的项目": "Gösterilen öğeler",
"首位的": "İlk yer",
"指定的": "Tasarlanmış",
"设为显示的项目": "Gösterilen Proje olarak ayarlayın"
} }

View File

@ -827,5 +827,9 @@
"复制": "копіювати", "复制": "копіювати",
"画廊": "галерія", "画廊": "галерія",
"删除图片": "Вилучити зображення", "删除图片": "Вилучити зображення",
"备注中自动填入翻译": "Автоматично заповнювати переклад у зауваження" "备注中自动填入翻译": "Автоматично заповнювати переклад у зауваження",
"显示的项目": "Показані елементи",
"首位的": "Перше місце",
"指定的": "Визначено",
"设为显示的项目": "Встановити як показаний проект"
} }

View File

@ -827,5 +827,9 @@
"复制": "Sao chép", "复制": "Sao chép",
"画廊": "Thư viện", "画廊": "Thư viện",
"删除图片": "Xóa ảnh", "删除图片": "Xóa ảnh",
"备注中自动填入翻译": "Tự động điền vào bản dịch trong ghi chú" "备注中自动填入翻译": "Tự động điền vào bản dịch trong ghi chú",
"显示的项目": "Mục hiển thị",
"首位的": "Đầu tiên",
"指定的": "Đã xác định",
"设为显示的项目": "Mục được đặt làm Hiển thị"
} }

View File

@ -827,5 +827,9 @@
"复制": "", "复制": "",
"画廊": "", "画廊": "",
"删除图片": "", "删除图片": "",
"备注中自动填入翻译": "" "备注中自动填入翻译": "",
"显示的项目": "",
"首位的": "",
"指定的": "",
"设为显示的项目": ""
} }