Prompt to save changes before creating new subtitles

Originally committed to SVN as r6218.
This commit is contained in:
Thomas Goyne 2012-01-08 01:05:57 +00:00
parent dc58b3db40
commit c379e1e8e0
2 changed files with 6 additions and 5 deletions

View file

@ -245,7 +245,8 @@ struct subtitle_new : public Command {
STR_HELP("New subtitles.")
void operator()(agi::Context *c) {
c->ass->LoadDefault();
if (wxGetApp().frame->TryToCloseSubs() != wxCANCEL)
c->ass->LoadDefault();
}
};

View file

@ -104,10 +104,6 @@ class FrameMain: public wxFrame {
void OnStatusClear(wxTimerEvent &event);
void OnCloseWindow (wxCloseEvent &event);
/// Close the currently open subs, asking the user if they want to save if there are unsaved changes
/// @param enableCancel Should the user be able to cancel the close?
int TryToCloseSubs(bool enableCancel=true);
// AudioControllerAudioEventListener implementation
void OnAudioOpen(AudioProvider *provider);
void OnAudioClose();
@ -142,6 +138,10 @@ public:
bool IsVideoShown() const { return showVideo; }
bool IsAudioShown() const { return showAudio; }
/// Close the currently open subs, asking the user if they want to save if there are unsaved changes
/// @param enableCancel Should the user be able to cancel the close?
int TryToCloseSubs(bool enableCancel=true);
void LoadSubtitles(wxString filename,wxString charset="");
DECLARE_EVENT_TABLE()