Select the first line when opening a file

Originally committed to SVN as r4611.
This commit is contained in:
Thomas Goyne 2010-06-27 04:54:46 +00:00
parent 5598b787c7
commit 934da32931

View file

@ -712,8 +712,11 @@ void FrameMain::LoadSubtitles (wxString filename,wxString charset) {
AssFile::StackReset(); AssFile::StackReset();
if (isFile) { if (isFile) {
AssFile::top->Load(filename,charset); AssFile::top->Load(filename,charset);
SubsGrid->SetSelectedSet(SubtitleSelectionController::Selection());
SubsGrid->UpdateMaps(); SubsGrid->UpdateMaps();
if (SubsGrid->GetRows()) {
SubsGrid->SetActiveLine(SubsGrid->GetDialogue(0));
SubsGrid->SelectRow(0);
}
wxFileName fn(filename); wxFileName fn(filename);
StandardPaths::SetPathValue(_T("?script"),fn.GetPath()); StandardPaths::SetPathValue(_T("?script"),fn.GetPath());
OPT_SET("Path/Last/Subtitles")->SetString(STD_STR(fn.GetPath())); OPT_SET("Path/Last/Subtitles")->SetString(STD_STR(fn.GetPath()));