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:
@@ -822,9 +822,23 @@ StyledEditWindow::Save(BMessage *message)
|
|||||||
if(err!= B_OK)
|
if(err!= B_OK)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
err= fTextView->WriteStyledEditFile(&file);
|
err = fTextView->WriteStyledEditFile(&file);
|
||||||
if(err != B_OK)
|
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;
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
SetTitle(name);
|
SetTitle(name);
|
||||||
if(fSaveMessage!= message)
|
if(fSaveMessage!= message)
|
||||||
|
|||||||
Reference in New Issue
Block a user