Update the selection and scroll position after opening subtitles from video

This commit is contained in:
Thomas Goyne 2014-11-16 13:25:17 -08:00
parent 1a4634003f
commit a9208a592b
3 changed files with 4 additions and 4 deletions

View file

@ -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 {

View file

@ -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);
}

View file

@ -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; }