mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#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:
parent
1f91405c50
commit
ac714ca2ea
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user