diff --git a/src/command/subtitle.cpp b/src/command/subtitle.cpp index 02bc640cf48bdb1a5af2216c777f6e273c7d571e..1edacb00032c8ad0b3f9ce0d14174bd7a80c1bb3 100644 --- a/src/command/subtitle.cpp +++ b/src/command/subtitle.cpp @@ -286,7 +286,7 @@ struct subtitle_open_video final : public Command { void operator()(agi::Context *c) override { if (c->subsController->TryToClose() == wxCANCEL) return; - c->subsController->Load(c->project->VideoName(), "binary"); + c->project->LoadSubtitles(c->project->VideoName(), "binary", false); } bool Validate(const agi::Context *c) override { diff --git a/src/project.cpp b/src/project.cpp index 21bfe23ce27806eae9116499809e39964398ef1c..2d1a404a78c7a8d5661af16cf3891ca791b9114b 100644 --- a/src/project.cpp +++ b/src/project.cpp @@ -158,9 +158,9 @@ bool Project::DoLoadSubtitles(agi::fs::path const& path, std::string encoding, P return true; } -void Project::LoadSubtitles(agi::fs::path path, std::string encoding) { +void Project::LoadSubtitles(agi::fs::path path, std::string encoding, bool load_linked) { ProjectProperties properties; - if (DoLoadSubtitles(path, encoding, properties)) + if (DoLoadSubtitles(path, encoding, properties) && load_linked) LoadUnloadFiles(properties); } diff --git a/src/project.h b/src/project.h index 1fd034d083d00ecfb0cb3a17fe32df81230247c1..385a41b4b3ca9b36bcda5ccbba2f81adc4ee2734 100644 --- a/src/project.h +++ b/src/project.h @@ -69,7 +69,7 @@ public: Project(agi::Context *context); ~Project(); - void LoadSubtitles(agi::fs::path path, std::string encoding=""); + void LoadSubtitles(agi::fs::path path, std::string encoding="", bool load_linked=true); void CloseSubtitles(); bool CanLoadSubtitlesFromVideo() const { return video_has_subtitles; }