I've elaborated a version which does allow re-loading all files which are 
**not-modified**, see the [branch 
here](https://github.com/peter-scholtens/geany/tree/re-load-all). The 
functionality is present under the pulldown menu _File -> Reload All 
(unmodified files only)_ of the main window.

The algorithm to implement this works roughly like:
1. Trigger checking the disk status of a single file with 
`document_check_disk_status` by e.g. key pressing or checking all files with 
`document_check_disk_status_others` when re-entering the window (the user could 
have done a revision change, untar, ..). Two distinctive functions are required 
for this, as a single file may trigger an avalanche effect of checking all 
others too if it is detected as modified (or deleted). The actual detection, 
and optionally reloading if allowed, is hidden inside 
`document_check_disk_status_single_file_and_optionally_reload`.
2. **Only** if the result of this function, called `modified_since_roundtrip` 
is **true**, ALL monitors will be refreshed. This is required, as the data 
content inside the monitors will be different: imagine if the monitor mentioned 
"3 files modified", then after saving one of them, it needs to be replaced with 
"2 files modified.".

This [branch](https://github.com/peter-scholtens/geany/tree/re-load-all) should 
now be fully functional, but please test and describe it if you see a bug. 
Furthermore, keep in mind that the GUI still needs reworks, as GtkInfoBar is 
now quite crowded, see the examples below. I will send a PR once I've finished 
that too.

**Deleted files** only require two buttons:

![geany_2_buttons](https://github.com/geany/geany/assets/7198614/1fbb24d8-8d36-402f-ac92-383541ead82b)

**A single modified file on disk** require three buttons:

![geany_3_buttons](https://github.com/geany/geany/assets/7198614/0eb6d181-7323-4a7b-9b37-f8302c0000b2)

**Multiple modified** files on disk require four buttons:

![geany_4_buttons](https://github.com/geany/geany/assets/7198614/5fa3b2d6-451f-407f-a14f-d286cf3a18db)

Multiple modified files on disk **with unsaved data** require five buttons:

![geany_5_buttons](https://github.com/geany/geany/assets/7198614/283da52a-68c6-45f9-a51e-a84de7c3c4fb)



-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/2540#issuecomment-1855581022
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/issues/2540/1855581...@github.com>

Reply via email to