Merge lp://staging/~voldyman/scratch/fixes-1198495 into lp://staging/~elementary-apps/scratch/scratch

Proposed by Akshay Shekher
Status: Merged
Approved by: Cody Garver
Approved revision: 1304
Merged at revision: 1318
Proposed branch: lp://staging/~voldyman/scratch/fixes-1198495
Merge into: lp://staging/~elementary-apps/scratch/scratch
Diff against target: 109 lines (+56/-9)
1 file modified
src/Services/Document.vala (+56/-9)
To merge this branch: bzr merge lp://staging/~voldyman/scratch/fixes-1198495
Reviewer Review Type Date Requested Status
Cody Garver (community) Approve
Mario Guerriero (community) Needs Fixing
Sergey "Shnatsel" Davidoff (community) Needs Fixing
Review via email: mp+220901@code.staging.launchpad.net

Commit message

Detect if file has been unmounted and offer to save it locally (fixes bug #1198495)

Description of the change

Fixed bug 1198495.

Whenever the file is changed, scratch will figure out the mount location and if it finds one it adds a callback to set mounted = false when the location is unmounted.

check_file_status function check the mounted variable to show the user alternatives when the file location is umounted

To post a comment you must log in.
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

We still have the no-autosave codepath in Scratch, so I believe we should handle this differently depending on whether the file was saved before unmounting or not. In particular, I'd like the regular "Save changes?" dialog should appear if the changes were not written to disk, otherwise closing Scratch results in silent data loss, which should never happen.

Also, "Save As" should be "Save As…"

Otherwise, looks good! Thanks!

review: Needs Fixing
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

Disclaimer: the above is based on merely looking at the code, not actually running it. If the dialog already does appear with autosave disabled - my bad, and carry on!

Revision history for this message
Mario Guerriero (mefrio-g) wrote :

If I "Save As" my document whose location was unmounted, it continously prompt me the warning message about the umounted path.

review: Needs Fixing
1302. By Akshay Shekher

Fixed save_as function & refactored the mount managing code

Revision history for this message
Akshay Shekher (voldyman) wrote :

Turns out the save_as function didn't work at all, fixed the function as well.

1303. By Akshay Shekher

 Save As → Save As...

Revision history for this message
Cody Garver (codygarver) wrote :

Use a real ellipsis …

There's an extra space before the filename is printed https://slack-files.com/T028SLY6K-F02D3C0UZ-4c8f65

review: Needs Fixing
1304. By Akshay Shekher

Fixed the extra spaces and used real ellipsis

Revision history for this message
Cody Garver (codygarver) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches