Add validator to the subtitle save command to check if there are actually unsaved changes
Originally committed to SVN as r5868.
This commit is contained in:
parent
14c9d8ec87
commit
1590b2a65e
1 changed files with 5 additions and 0 deletions
|
@ -350,10 +350,15 @@ struct subtitle_save : public Command {
|
|||
STR_MENU("&Save Subtitles")
|
||||
STR_DISP("Save Subtitles")
|
||||
STR_HELP("Saves subtitles.")
|
||||
CMD_TYPE(COMMAND_VALIDATE)
|
||||
|
||||
void operator()(agi::Context *c) {
|
||||
save_subtitles(c, c->ass->CanSave() ? c->ass->filename : "");
|
||||
}
|
||||
|
||||
bool Validate(const agi::Context *c) {
|
||||
return c->ass->IsModified();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue