at least tell the user that saving failed, if writing the file did, all the other returns should notify as well but I am tired and it is time to sleep :-P

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4167 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
shatty
2003-07-31 09:41:29 +00:00
parent 31cd62fb1e
commit cf629a4037
+16 -2
View File
@@ -822,9 +822,23 @@ StyledEditWindow::Save(BMessage *message)
if(err!= B_OK)
return err;
err= fTextView->WriteStyledEditFile(&file);
if(err != B_OK)
err = fTextView->WriteStyledEditFile(&file);
if(err != B_OK) {
BAlert *saveFailedAlert;
BString alertText;
if (err == B_TRANSLATION_ERROR_BASE) {
alertText.SetTo("Translation error saving \"");
} else {
alertText.SetTo("Unknown error saving \"");
}
alertText<< name;
alertText<<"\".";
saveFailedAlert= new BAlert("saveFailedAlert",alertText.String(), "Bummer", 0, 0,
B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_STOP_ALERT);
saveFailedAlert->SetShortcut(0, B_ESCAPE);
saveFailedAlert->Go();
return err;
}
SetTitle(name);
if(fSaveMessage!= message)