(#630) Give warning if user tries to save project to a read only file

Add saved file to recent file list
This commit is contained in:
Magne Sjaastad 2015-11-20 10:50:23 +01:00
parent 1f91405c50
commit ac714ca2ea

View File

@ -569,11 +569,20 @@ bool RiaApplication::saveProjectPromptForFileName()
bool RiaApplication::saveProjectAs(const QString& fileName)
{
m_project->fileName = fileName;
m_project->writeFile();
if (!m_project->writeFile())
{
QMessageBox::warning(NULL, "Error when saving project file", QString("Not possible to save project file. Make sure you have sufficient access rights.\n\nProject file location : %1").arg(fileName));
return false;
}
m_preferences->lastUsedProjectFileName = fileName;
caf::PdmSettings::writeFieldsToApplicationStore(m_preferences);
RiuMainWindow* mainWnd = RiuMainWindow::instance();
mainWnd->addRecentFiles(fileName);
return true;
}