MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / OnFileSave

Method OnFileSave

legacy/hogedit/HogEditView.cpp:487–519  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

485}
486
487void CHogEditView::OnFileSave() {
488 // TODO: Add your command handler code here
489 CHogEditDoc *doc = GetDocument();
490 CListCtrl &list = GetListCtrl();
491
492 // If the current document is a hog file, then call the hog
493 // creation routine to save it
494 if (doc->m_StaticHog) {
495 UseCurrentHogFilename = TRUE;
496 OnActionCreate();
497 UseCurrentHogFilename = FALSE;
498 return;
499 }
500
501 // If a filename has not yet been specified by the user,
502 // Make them do a "Save As" instead
503 if (doc->m_NoNameChosen) {
504 OnFileSaveAs();
505 return;
506 }
507
508 // Display Wait Cursor
509 CWaitCursor wc;
510
511 if (!doc->SaveDocument(doc->m_DocumentName)) {
512 MessageBox("The file was not written successfully.", "File Write Error");
513 return;
514 }
515
516 DocModified = false;
517 UpdateTitle(doc->m_DocumentName, DocModified);
518 UpdateTotalFiles(list.GetItemCount());
519}
520
521void CHogEditView::OnFileSaveAs() {
522

Callers

nothing calls this directly

Calls 2

UpdateTotalFilesFunction · 0.85
SaveDocumentMethod · 0.80

Tested by

no test coverage detected