mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-30 18:16:31 +03:00
ecode:
Closes SpartanJ/ecode#85. Gracefully handle document save failing. Fixed out of range access when editing files.
This commit is contained in:
@@ -102,8 +102,17 @@ void App::saveDoc() {
|
||||
return;
|
||||
|
||||
if ( mSplitter->getCurEditor()->getDocument().hasFilepath() ) {
|
||||
if ( mSplitter->getCurEditor()->save() )
|
||||
if ( mSplitter->getCurEditor()->save() ) {
|
||||
updateEditorState();
|
||||
} else {
|
||||
UIMessageBox * msgBox = errorMsgBox( i18n(
|
||||
"could_not_write_file", "Could not write file to disk.\nPlease check if the file "
|
||||
"is read-only or if ecode does not have permissions to write to that file.\n"
|
||||
"File path is: "
|
||||
) + mSplitter->getCurEditor()->getDocument().getFilePath() );
|
||||
|
||||
setFocusEditorOnClose( msgBox );
|
||||
}
|
||||
} else {
|
||||
saveFileDialog( mSplitter->getCurEditor() );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user