Fixed shift times not affecting video/audio, and default save as path

Originally committed to SVN as r226.
This commit is contained in:
Rodrigo Braz Monteiro 2006-03-14 04:23:00 +00:00
parent 81e86727ff
commit 1723915e3e
3 changed files with 21 additions and 10 deletions

View file

@ -36,6 +36,10 @@
///////////
// Headers
#include <fstream>
#include <algorithm>
#include <string>
#include <wx/filename.h>
#include "dialog_shift_times.h"
#include "video_display.h"
#include "vfr.h"
@ -45,10 +49,7 @@
#include "ass_file.h"
#include "ass_time.h"
#include "ass_dialogue.h"
#include <fstream>
#include <algorithm>
#include <string>
#include <wx/filename.h>
#include "subs_edit_box.h"
///////////////
@ -262,6 +263,7 @@ void DialogShiftTimes::OnOK(wxCommandEvent &event) {
grid->ass->FlagAsModified();
grid->CommitChanges();
grid->UpdateMaps();
grid->editBox->Update();
EndModal(0);
}

View file

@ -563,15 +563,23 @@ bool FrameMain::SaveSubtitles(bool saveas,bool withCharset) {
// Failed, ask user
if (filename.IsEmpty()) {
videoBox->videoDisplay->Stop();
filename = wxFileSelector(_("Save subtitles file"),_T(""),_T(""),_T(""),_T("Advanced Substation Alpha (*.ass)|*.ass"),wxSAVE | wxOVERWRITE_PROMPT,this);
AssFile::top->filename = filename; //fix me, ghetto hack for correct relative path generation in SynchronizeProject()
wxString path = Options.AsText(_T("Last open subtitles path"));
wxFileName origPath(AssFile::top->filename);
filename = wxFileSelector(_("Save subtitles file"),path,origPath.GetName() + _T(".ass"),_T("ass"),_T("Advanced Substation Alpha (*.ass)|*.ass"),wxSAVE | wxOVERWRITE_PROMPT,this);
}
// Synchronize
SynchronizeProject();
// Actually save
if (!filename.empty()) {
// Store path
wxFileName filepath(filename);
Options.SetText(_T("Last open subtitles path"), filepath.GetPath());
// Fix me, ghetto hack for correct relative path generation in SynchronizeProject()
AssFile::top->filename = filename;
// Synchronize
SynchronizeProject();
// Get charset
wxString charset = _T("");
if (withCharset) {

View file

@ -512,7 +512,8 @@ void FrameMain::OnOpenSubtitles(wxCommandEvent& WXUNUSED(event)) {
wxString filename = wxFileSelector(_("Open subtitles file"),path,_T(""),_T(""),_T("All Supported Types (*.ass,*.ssa,*.srt,*.txt)|*.ass;*.ssa;*.srt;*.txt|Advanced Substation Alpha (*.ass)|*.ass|Substation Alpha (*.ssa)|*.ssa|SubRip (*.srt)|*.srt|Plain-text (*.txt)|*.txt"),wxOPEN | wxFILE_MUST_EXIST);
if (!filename.empty()) {
LoadSubtitles(filename);
Options.SetText(_T("Last open subtitles path"), filename);
wxFileName filepath(filename);
Options.SetText(_T("Last open subtitles path"), filepath.GetPath());
}
}