feat: show only the translated subtitle once translation finishes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
triandClaude Opus 5.5 committed 2026-10-28 00:17:34 +07:00
1 parent 6b5742b2ca
commit 169cb1360b
5 files changed
+22 -15

No files matched your search

+6 -5
View File
@@ -66,9 +66,9 @@ public:
Q_INVOKABLE void seek(double seconds);
// Adds an external subtitle file and makes it the primary subtitle.
Q_INVOKABLE void addSubtitleFile(const QUrl &url);
// Shows \a url as the secondary subtitle, adding it first (named \a title) unless it
// is already loaded.
Q_INVOKABLE void showSecondarySubtitleFile(const QUrl &url, const QString &title);
// Makes \a url the only subtitle shown, adding it first (named \a title) unless it is
// already loaded.
Q_INVOKABLE void showTranslatedSubtitleFile(const QUrl &url, const QString &title);
// Shows a short message on mpv's on-screen display.
Q_INVOKABLE void showText(const QString &text);
@@ -90,6 +90,7 @@ private:
void setFileLoaded(bool loaded);
void updateTracks(const QVariantList &trackList);
void applyUserConfig();
void showOnlySubtitle(int id);
bool m_ready = false;
QUrl m_pendingUrl;
@@ -103,8 +104,8 @@ private:
int m_subtitleId = 0;
int m_secondarySubtitleId = 0;
double m_subtitleDelay = 0.0;
// File added by showSecondarySubtitleFile() that should become secondary once mpv lists it.
QString m_pendingSecondaryPath;
// File added by showTranslatedSubtitleFile() that should be shown once mpv lists it.
QString m_pendingTranslatedPath;
bool m_loadUserConfig = false;
QStringList m_loadedUserConfigFiles;
QStringList m_skippedUserOptions;