Fix silent save failure when file write is denied#3
Conversation
ddf3b06 to
1a5c408
Compare
|
Fixed. |
|
Just tested this. The save error popup now shows correctly for direct Save, Run, and Debug, so this is partially fixed. However, there are still a few cases where MeadowPy continues as if the save succeeded. When I click Run or Debug on a modified file MeadowPy cannot write to, it shows the save error popup but still runs/debugs the old on-disk file. In this scenario, I think Run/Debug should not continue if save-before-run/debug fails. Also, when closing the tab or exiting the app with unsaved changes, MeadowPy shows the “Save before closing?” prompt, but clicking Save behaves as if the file was saved even though it was not. These flows should stop after the failed save, show the save error, and keep the file open and marked unsaved. |

Summary
Fixes #2 — MeadowPy silently fails when saving a file it doesn't have write permission to. The unsaved dot disappears even though nothing was written to disk.
What changed
file_manager.py:save_file()now shows aQMessageBox.criticalerror dialog when the write fails (same style as existing error dialogs infile_explorer.py)workspace_controller.py:action_save()now checks the return value ofsave_file()— the modified flag and tab title are only updated on successImpact
All save paths that go through
action_save()are fixed:Save Aswas already handling failure correctly.After fix