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

View File

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

View File

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

View File

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

View File

@ -827,5 +827,9 @@
"复制": "copy",
"画廊": "gallery",
"删除图片": "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",
"画廊": "Galería",
"删除图片": "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",
"画廊": "Galerie",
"删除图片": "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",
"画廊": "gallery",
"删除图片": "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",
"画廊": "galeria",
"删除图片": "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",
"画廊": "Galeri",
"删除图片": "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",
"画廊": "Thư viện",
"删除图片": "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 @@
"复制": "",
"画廊": "",
"删除图片": "",
"备注中自动填入翻译": ""
"备注中自动填入翻译": "",
"显示的项目": "",
"首位的": "",
"指定的": "",
"设为显示的项目": ""
}