845 | | if (file.InitCheck() == B_OK) |
| 845 | if (file.InitCheck() == B_OK) { |
| 846 | // Ver: 2010-03-02 / Added check for read-only mode bit. |
| 847 | if( file.IsWritable() == false ) { |
| 848 | BString alertText; |
| 849 | bs_printf(&alertText, TR("This file is marked Read-Only. Save changes to the document \"%s\"? "), name); |
| 850 | |
| 851 | int32 index = _ShowAlert(alertText, TR("Cancel"), TR("Don't save"), TR("Save"), |
| 852 | B_WARNING_ALERT); |
| 853 | |
| 854 | if (index == 0) |
| 855 | return B_ERROR; // "cancel": dont save, dont close the window |
| 856 | |
| 857 | if (index == 1) |
| 858 | return B_ERROR; // "don't save": just close the window |
| 859 | } |
| 860 | |