Prompt to save changes before creating new subtitles
Originally committed to SVN as r6218.
This commit is contained in:
parent
dc58b3db40
commit
c379e1e8e0
2 changed files with 6 additions and 5 deletions
|
@ -245,6 +245,7 @@ struct subtitle_new : public Command {
|
|||
STR_HELP("New subtitles.")
|
||||
|
||||
void operator()(agi::Context *c) {
|
||||
if (wxGetApp().frame->TryToCloseSubs() != wxCANCEL)
|
||||
c->ass->LoadDefault();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue