diff --git a/PowerEditor/installer/nativeLang/english.xml b/PowerEditor/installer/nativeLang/english.xml
index f5a2ad70b..f7a8c17cd 100644
--- a/PowerEditor/installer/nativeLang/english.xml
+++ b/PowerEditor/installer/nativeLang/english.xml
@@ -1178,7 +1178,8 @@ Do you want to recover your langs.xml?"/>
-
+
ToElement()->SetAttribute(TEXT("name"), tvItem.pszText);
buildProjectXml(projRoot, tvProj, fn2write);
}
- projDoc.SaveFile();
+
+ if (!projDoc.SaveFile())
+ {
+ const TCHAR * title = _workSpaceFilePath.length() > 0 ? PathFindFileName (_workSpaceFilePath.c_str()) : _panelTitle.c_str();
+ NativeLangSpeaker *pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker();
+ pNativeSpeaker->messageBox("ProjectPanelSaveError",
+ _hSelf,
+ TEXT("An error occurred while writing your workspace file.\nYour workspace has not been saved."),
+ TEXT("$STR_REPLACE$"),
+ MB_OK | MB_ICONERROR,
+ 0,
+ title);
+ return false;
+ }
+ TCHAR * fileName = PathFindFileName(fn2write);
+ _treeView.renameItem(tvRoot, fileName);
return true;
}
@@ -1231,17 +1239,18 @@ bool ProjectPanel::saveWorkSpaceAs(bool saveCopyAs)
fDlg.setExtIndex(0); // 0 index for "custom extention" type if any else for "All types *.*"
const generic_string fn = fDlg.doSaveDlg();
- if (!fn.empty())
+ if (fn.empty())
+ return false;
+
+ if (!writeWorkSpace(fn.c_str()))
+ return false;
+
+ if (!saveCopyAs)
{
- writeWorkSpace(fn.c_str());
- if (!saveCopyAs)
- {
- _workSpaceFilePath = fn;
- setWorkSpaceDirty(false);
- }
- return true;
+ _workSpaceFilePath = fn;
+ setWorkSpaceDirty(false);
}
- return false;
+ return true;
}
void ProjectPanel::setFileExtFilter(CustomFileDialog & fDlg)