Game line names across languages; RSubtitle; editor in three columns

This commit is contained in:
2026-10-10 02:14:06 +02:00
parent f29af40b37
commit ea3e44000a
40 changed files with 54018 additions and 53559 deletions

View File

@@ -143,18 +143,25 @@ class SubtitleBox(QWidget):
self.lbl = QLabel()
self.lbl.setObjectName("Muted")
row = QHBoxLayout()
self.b_apply = QPushButton(icons.icon("apply"), "Apply subtitle")
self.b_revert = QPushButton(icons.icon("revert"), "Revert subtitle")
self.b_open = QPushButton(icons.icon("search"), "Show in Subtitles")
self.b_apply = QPushButton(icons.icon("apply"), "Apply")
self.b_revert = QPushButton(icons.icon("revert"), "Revert")
self.b_open = QPushButton(icons.icon("search"), "Show in list")
self.b_apply.setToolTip("Write this subtitle into the game (every copy)")
self.b_revert.setToolTip("Put the original subtitle back")
self.b_open.setToolTip("Open this subtitle in the Subtitles tab")
self.b_apply.clicked.connect(self.apply)
self.b_revert.clicked.connect(self.revert)
self.b_open.clicked.connect(lambda: self.keys and self.open_in_list.emit(self.keys[0]))
for b in (self.b_apply, self.b_revert, self.b_open):
for b in (self.b_apply, self.b_revert):
row.addWidget(b)
row.addStretch(1)
self.row = row
row2 = QHBoxLayout()
row2.addWidget(self.b_open)
row2.addStretch(1)
self.lbl.setWordWrap(True)
self.lay.addRow(self.lbl)
self.lay.addRow(row)
self.lay.addRow(row2)
def set_sound(self, s):
for e in self.edits:
@@ -171,6 +178,8 @@ class SubtitleBox(QWidget):
for i, ln in enumerate(lines):
k = subtitles.key(ln.lang, ln.speech, ln.line)
e = QLineEdit(tx.records().get(k, {}).get("applied") or ln.text)
e.setMinimumWidth(80)
e.setCursorPosition(0) # long subtitles: show their beginning
e.setToolTip("Original: %s\nRoom: %d characters" % (ln.text, ln.room))
e.textChanged.connect(self._check)
self.lay.insertRow(i, "Line %d" % (i + 1) if len(lines) > 1 else "Subtitle", e)