MCPcopy Create free account
hub / github.com/TypesettingTools/Aegisub / TryToClose

Method TryToClose

src/subs_controller.cpp:239–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237}
238
239int SubsController::TryToClose(bool allow_cancel) const {
240 if (!IsModified())
241 return wxYES;
242
243 int flags = wxYES_NO;
244 if (allow_cancel)
245 flags |= wxCANCEL;
246 int result = wxMessageBox(fmt_tl("Do you want to save changes to %s?", Filename()), _("Unsaved changes"), flags, context->parent);
247 if (result == wxYES) {
248 cmd::call("subtitle/save", context);
249 // If it fails saving, return cancel anyway
250 return IsModified() ? wxCANCEL : wxYES;
251 }
252 return result;
253}
254
255void SubsController::AutoSave() {
256 if (commit_id == autosaved_commit_id)

Callers 4

OnCloseWindowMethod · 0.80
operator()Function · 0.80

Calls 1

callFunction · 0.85

Tested by

no test coverage detected