Skip to content

Commit

Permalink
Use dialog for external changes (#1309)
Browse files Browse the repository at this point in the history
* Ignore external changes after "Continue"

* Reload or Overwrite options

* Add AskSaveDialog.vala

* Introduce "locked" document state

* Lock document during loading; unlock after if writable

* Stop some functions if locked

* Modify save and save as functions for locked

* Make some funcs private

* Modify check file status function for locked

* Rewrite ask save location for dialog and locked

* Compile dialog

* Minor improvements

* Start unlocked after loading

* Handle closing changed locked documents

* Update saved status when locked status changes

* Amend tab tooltip when locked

* Rework external changes with dialog

* Connect focus-in handler with focus-out handler

* Fix focus in and overwrite

* Inline AskExternalChanges dialog

* Do not throw dialog if there are no unsaved internal edits

* Remove unused class

* Move some code back to original position

* Update last_save_content after loading external changes

* Check for external changes even when internal changes

* Only save deleted file if there are unsaved changes

* Update src/Services/Document.vala

Fix typo

Co-authored-by: Ryan Kornheisl <[email protected]>

* Use copy paste to autoload changed text

* Flag as not loaded while replacing text

* No undo on autoload

* Lose unused infobar

---------

Co-authored-by: Ryan Kornheisl <[email protected]>
  • Loading branch information
Jeremy Wootten and zeebok authored Jul 9, 2023
1 parent 059f4d3 commit 0c49cb7
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 120 deletions.
2 changes: 1 addition & 1 deletion src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ namespace Scratch {
if (doc.is_file_temporary == true) {
action_save_as ();
} else {
doc.save_with_hold.begin (true);
doc.save_request ();
}
}
}
Expand Down
Loading

0 comments on commit 0c49cb7

Please sign in to comment.