geany/geany — pull request #54 by stefanct (2012-07-27 03:07:19+00:00)
Title: Reload all

This took waaay longer than expected :/
I had to refactor some stuff to be able to skip the normal unchanged/deleted file dialogs, but the result might be worth it (hopefully :). Also, the check for modified files in on_key_press_event() made things complicated first. The check is now skipped for modifier-only key presses so that no unchanged/deleted file dialog *for single tabs* gets a change to emerge before the reload-all dialog is shown in case the user sets up a shortcut for reload-all including modifiers (likely if one uses the feature i guess. i am using ctrl+shift+r, but i did not set a default shortcut in my patch btw). It does not filter out alt+f, so if one tries to reload-all via that road the dialog for single files emerges... i dont want to add a workaround for this too, the file check itself is the culprit and needs to be removed (has other issues too, even without this patchset). This will be possible without any problems when the gio file monitor is enabled.

TODOs:
* should i mark tabs with modified files red when the reload-all dialog is canceled?

this would require checking all open files for changes. this would be superseded by proper file monitoring anyway, so i would rather leave it as it is.
* on_reload_as_activate has some issues (e.g. load a file, rm it externally, do a normal file/reload -> message: file not found), which could be fixed within this patchset.
* the use of monitor_*_file() (and their dialogs) in document_ensure_uptodate() might be not what we want... suggestions?
* evaluate/test if behavior of reload-all is what we want. what do you think?

PS: thanks to elextr and codebrainz for the pointers and discussion on IRC