From 26ecdd010332ea070ebd4f67dab0a8736ede2c59 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: Thu, 6 Jun 2024 12:53:37 +0800 Subject: [PATCH] .. --- .../LunaTranslator/gui/dialog_savedgame.py | 13 +++++---- LunaTranslator/LunaTranslator/myutils/vndb.py | 28 ------------------- LunaTranslator/files/lang/ar.json | 1 - LunaTranslator/files/lang/cht.json | 1 - LunaTranslator/files/lang/en.json | 1 - LunaTranslator/files/lang/es.json | 1 - LunaTranslator/files/lang/fr.json | 1 - LunaTranslator/files/lang/it.json | 1 - LunaTranslator/files/lang/ja.json | 1 - LunaTranslator/files/lang/ko.json | 1 - LunaTranslator/files/lang/pl.json | 1 - LunaTranslator/files/lang/ru.json | 1 - LunaTranslator/files/lang/th.json | 1 - LunaTranslator/files/lang/tr.json | 1 - LunaTranslator/files/lang/uk.json | 1 - LunaTranslator/files/lang/vi.json | 1 - LunaTranslator/files/lang/zh.json | 1 - 17 files changed, 8 insertions(+), 48 deletions(-) diff --git a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py index 808a18ee..22ad5580 100644 --- a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py +++ b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py @@ -1530,6 +1530,7 @@ class dialog_savedgame_new(QWidget): self.flow = lazyscrollflow() self.flow.bgclicked.connect(ItemWidget.clearfocus) self.formLayout.insertWidget(self.formLayout.count() - 1, self.flow) + idx = 0 for k in savehook_new_list: if newtags != self.currtags: break @@ -1562,7 +1563,8 @@ class dialog_savedgame_new(QWidget): break if notshow: continue - self.newline(k) + self.newline(k, idx == 0) + idx += 1 def showmenu(self, p): menu = QMenu(self) @@ -1613,7 +1615,6 @@ class dialog_savedgame_new(QWidget): layout = QHBoxLayout() layout.setContentsMargins(0, 0, 0, 0) - layout.addWidget(QLabel(_TR("过滤"))) def refreshcombo(): _ = self.tagswidget.lineEdit.currentText() @@ -1747,12 +1748,14 @@ class dialog_savedgame_new(QWidget): ) _btn.setEnabled(_able1) - def getagameitem(self, k): + def getagameitem(self, k, focus): gameitem = ItemWidget( k, functools.partial(_getpixfunction, k), savehook_new_data[k]["title"] ) gameitem.doubleclicked.connect(functools.partial(startgamecheck, self)) gameitem.focuschanged.connect(self.itemfocuschanged) + if focus: + gameitem.click() return gameitem def newline(self, k, first=False): @@ -1763,12 +1766,12 @@ class dialog_savedgame_new(QWidget): if first: self.idxsave.insert(0, k) self.flow.insertwidget( - 0, (functools.partial(self.getagameitem, k), QSize(itemw, itemh)) + 0, (functools.partial(self.getagameitem, k, True), QSize(itemw, itemh)) ) else: self.idxsave.append(k) self.flow.addwidget( - (functools.partial(self.getagameitem, k), QSize(itemw, itemh)) + (functools.partial(self.getagameitem, k, False), QSize(itemw, itemh)) ) diff --git a/LunaTranslator/LunaTranslator/myutils/vndb.py b/LunaTranslator/LunaTranslator/myutils/vndb.py index 46468ca6..237ff42b 100644 --- a/LunaTranslator/LunaTranslator/myutils/vndb.py +++ b/LunaTranslator/LunaTranslator/myutils/vndb.py @@ -324,34 +324,6 @@ def parsehtmlmethod(infopath): text, ) - hrefs = re.findall('src="(.*?)" width="(.*?)" height="(.*?)"', text) - # print(hrefs) - for href in hrefs: - if href[0].startswith("https://t.vndb.org/st/"): - href1 = href[0].replace("https://t.vndb.org/st/", "https://t.vndb.org/sf/") - localimg = vndbdownloadimg(href1, False) - if localimg: - text = text.replace( - 'src="{}" width="{}" height="{}"'.format(href[0], href[1], href[2]), - 'src="file://{}" width="512"'.format( - os.path.abspath(localimg).replace("\\", "/") - ), - ) - text = text.replace( - 'href="{}"'.format(href1), - 'href="file://{}"'.format( - os.path.abspath(localimg).replace("\\", "/") - ), - ) - elif href[0].startswith("https://t.vndb.org/cv/"): - localimg = vndbdownloadimg(href[0], False) - if localimg: - text = text.replace( - 'src="{}"'.format(href[0]), - 'src="file://{}"'.format( - os.path.abspath(localimg).replace("\\", "/") - ), - ) with open(resavepath, "w", encoding="utf8") as ff: ff.write(text) diff --git a/LunaTranslator/files/lang/ar.json b/LunaTranslator/files/lang/ar.json index aad90731..58a6ab36 100644 --- a/LunaTranslator/files/lang/ar.json +++ b/LunaTranslator/files/lang/ar.json @@ -741,7 +741,6 @@ "禁止自动朗读的人名": "أسماء الأشخاص المحظورين من القراءة التلقائية", "启动": "بدء", "批量添加": "إضافة دفعة", - "过滤": "تصفية", "备份路径": "مسار النسخ الاحتياطي", "存档备份": "أرشيف النسخ الاحتياطي", "备份到": "النسخ الاحتياطي", diff --git a/LunaTranslator/files/lang/cht.json b/LunaTranslator/files/lang/cht.json index b4f4e25f..faa3d15f 100644 --- a/LunaTranslator/files/lang/cht.json +++ b/LunaTranslator/files/lang/cht.json @@ -741,7 +741,6 @@ "禁止自动朗读的人名": "禁止自動朗讀的人名", "启动": "啟動", "批量添加": "批量添加", - "过滤": "過濾", "备份路径": "備份路徑", "存档备份": "存檔備份", "备份到": "備份到", diff --git a/LunaTranslator/files/lang/en.json b/LunaTranslator/files/lang/en.json index ad86e22e..ebb01bfe 100644 --- a/LunaTranslator/files/lang/en.json +++ b/LunaTranslator/files/lang/en.json @@ -741,7 +741,6 @@ "禁止自动朗读的人名": "Names that are prohibited from automatic reading", "启动": "start-up", "批量添加": "Batch Add", - "过滤": "filter", "备份路径": "Backup path", "存档备份": "Archive backup", "备份到": "Back up to", diff --git a/LunaTranslator/files/lang/es.json b/LunaTranslator/files/lang/es.json index 377123d5..684a4d06 100644 --- a/LunaTranslator/files/lang/es.json +++ b/LunaTranslator/files/lang/es.json @@ -741,7 +741,6 @@ "禁止自动朗读的人名": "Nombres de personas cuya lectura automática está prohibida", "启动": "Inicio", "批量添加": "Añadir por lotes", - "过滤": "Filtrar", "备份路径": "Ruta de respaldo", "存档备份": "Archivo de copias de Seguridad", "备份到": "Copia de Seguridad a", diff --git a/LunaTranslator/files/lang/fr.json b/LunaTranslator/files/lang/fr.json index 84598cd9..8d868779 100644 --- a/LunaTranslator/files/lang/fr.json +++ b/LunaTranslator/files/lang/fr.json @@ -741,7 +741,6 @@ "禁止自动朗读的人名": "Noms de personnes interdits de Lecture automatique", "启动": "Démarrage", "批量添加": "Ajouter par lot", - "过滤": "Filtration", "备份路径": "Chemin de sauvegarde", "存档备份": "Sauvegarde archivée", "备份到": "Sauvegarder à", diff --git a/LunaTranslator/files/lang/it.json b/LunaTranslator/files/lang/it.json index 7a297b17..9a0ca7b5 100644 --- a/LunaTranslator/files/lang/it.json +++ b/LunaTranslator/files/lang/it.json @@ -741,7 +741,6 @@ "禁止自动朗读的人名": "Nomi vietati dalla lettura automatica", "启动": "avviamento", "批量添加": "Aggiungi batch", - "过滤": "filtro", "备份路径": "Percorso di backup", "存档备份": "Archivia backup", "备份到": "Torna a", diff --git a/LunaTranslator/files/lang/ja.json b/LunaTranslator/files/lang/ja.json index 1aaabe7d..3870648a 100644 --- a/LunaTranslator/files/lang/ja.json +++ b/LunaTranslator/files/lang/ja.json @@ -741,7 +741,6 @@ "禁止自动朗读的人名": "自動朗読禁止の人名", "启动": "スタートアップ", "批量添加": "一括追加", - "过滤": "フィルタリング", "备份路径": "バックアップパス", "存档备份": "アーカイブバックアップ", "备份到": "バックアップ先", diff --git a/LunaTranslator/files/lang/ko.json b/LunaTranslator/files/lang/ko.json index 26ad0b5c..785c1287 100644 --- a/LunaTranslator/files/lang/ko.json +++ b/LunaTranslator/files/lang/ko.json @@ -741,7 +741,6 @@ "禁止自动朗读的人名": "자동 발음이 금지된 사람 이름", "启动": "시작", "批量添加": "대량 추가", - "过滤": "필터링", "备份路径": "백업 경로", "存档备份": "아카이브 백업", "备份到": "백업 대상", diff --git a/LunaTranslator/files/lang/pl.json b/LunaTranslator/files/lang/pl.json index 244e131e..0fd79e0b 100644 --- a/LunaTranslator/files/lang/pl.json +++ b/LunaTranslator/files/lang/pl.json @@ -741,7 +741,6 @@ "禁止自动朗读的人名": "Nazwy, które są zabronione automatycznego odczytu", "启动": "uruchomienie", "批量添加": "Dodaj partię", - "过滤": "filtr", "备份路径": "Ścieżka kopii zapasowej", "存档备份": "Kopia zapasowa archiwum", "备份到": "Powrót do", diff --git a/LunaTranslator/files/lang/ru.json b/LunaTranslator/files/lang/ru.json index b105f494..52bdcc55 100644 --- a/LunaTranslator/files/lang/ru.json +++ b/LunaTranslator/files/lang/ru.json @@ -741,7 +741,6 @@ "禁止自动朗读的人名": "Имя человека, которое запрещено читать автоматически", "启动": "Запуск", "批量添加": "Добавление пакетов", - "过滤": "Фильтр", "备份路径": "Путь к резервному копированию", "存档备份": "Архивное резервное копирование", "备份到": "Резервное копирование", diff --git a/LunaTranslator/files/lang/th.json b/LunaTranslator/files/lang/th.json index 3bd2994d..c8cea7a9 100644 --- a/LunaTranslator/files/lang/th.json +++ b/LunaTranslator/files/lang/th.json @@ -741,7 +741,6 @@ "禁止自动朗读的人名": "ชื่อของบุคคลที่ห้ามอ่านออกเสียงโดยอัตโนมัติ", "启动": "เริ่ม", "批量添加": "เพิ่มจำนวนมาก", - "过滤": "การกรอง", "备份路径": "เส้นทางการสำรองข้อมูล", "存档备份": "การสำรองข้อมูลที่เก็บถาวร", "备份到": "สำรองข้อมูลไปยัง", diff --git a/LunaTranslator/files/lang/tr.json b/LunaTranslator/files/lang/tr.json index d9c48389..7e61bfce 100644 --- a/LunaTranslator/files/lang/tr.json +++ b/LunaTranslator/files/lang/tr.json @@ -741,7 +741,6 @@ "禁止自动朗读的人名": "Otomatik okuma yasaklanmış isimler", "启动": "start-up", "批量添加": "Toplu Ekle", - "过滤": "filter", "备份路径": "Yedekleme yolu", "存档备份": "Arşiv yedekleme", "备份到": "Geri dön.", diff --git a/LunaTranslator/files/lang/uk.json b/LunaTranslator/files/lang/uk.json index 08e2a16d..b2cb02c3 100644 --- a/LunaTranslator/files/lang/uk.json +++ b/LunaTranslator/files/lang/uk.json @@ -741,7 +741,6 @@ "禁止自动朗读的人名": "Назви, які заборонені автоматичне читання", "启动": "запуск", "批量添加": "Додати партію", - "过滤": "фільтр", "备份路径": "Шлях до резервної копії", "存档备份": "Резервна копія архіву", "备份到": "Назад до", diff --git a/LunaTranslator/files/lang/vi.json b/LunaTranslator/files/lang/vi.json index 3e3fd05d..9dc860ff 100644 --- a/LunaTranslator/files/lang/vi.json +++ b/LunaTranslator/files/lang/vi.json @@ -741,7 +741,6 @@ "禁止自动朗读的人名": "Tên người bị cấm đọc tự động", "启动": "Bắt đầu", "批量添加": "Thêm hàng loạt", - "过滤": "Bộ lọc", "备份路径": "Đường dẫn sao lưu", "存档备份": "Lưu trữ sao lưu", "备份到": "Sao lưu vào", diff --git a/LunaTranslator/files/lang/zh.json b/LunaTranslator/files/lang/zh.json index 7031859b..404e3c0b 100644 --- a/LunaTranslator/files/lang/zh.json +++ b/LunaTranslator/files/lang/zh.json @@ -741,7 +741,6 @@ "禁止自动朗读的人名": "", "启动": "", "批量添加": "", - "过滤": "", "备份路径": "", "存档备份": "", "备份到": "",