forked from mia/Aegisub
Update the selection and scroll position after opening subtitles from video
This commit is contained in:
parent
1a4634003f
commit
a9208a592b
3 changed files with 4 additions and 4 deletions
|
@ -286,7 +286,7 @@ struct subtitle_open_video final : public Command {
|
||||||
|
|
||||||
void operator()(agi::Context *c) override {
|
void operator()(agi::Context *c) override {
|
||||||
if (c->subsController->TryToClose() == wxCANCEL) return;
|
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 {
|
bool Validate(const agi::Context *c) override {
|
||||||
|
|
|
@ -158,9 +158,9 @@ bool Project::DoLoadSubtitles(agi::fs::path const& path, std::string encoding, P
|
||||||
return true;
|
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;
|
ProjectProperties properties;
|
||||||
if (DoLoadSubtitles(path, encoding, properties))
|
if (DoLoadSubtitles(path, encoding, properties) && load_linked)
|
||||||
LoadUnloadFiles(properties);
|
LoadUnloadFiles(properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ public:
|
||||||
Project(agi::Context *context);
|
Project(agi::Context *context);
|
||||||
~Project();
|
~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();
|
void CloseSubtitles();
|
||||||
bool CanLoadSubtitlesFromVideo() const { return video_has_subtitles; }
|
bool CanLoadSubtitlesFromVideo() const { return video_has_subtitles; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue