solemnwarning / rehex

Reverse Engineers' Hex Editor
https://rehex.solemnwarning.net/
GNU General Public License v2.0
2.31k stars 116 forks source link

"File modified" dialog improvement #222

Closed alexforencich closed 9 months ago

alexforencich commented 10 months ago

When looking at a file that's being continuously updated (e.g. being downloaded/written out a bit at a time), the "File modified" modal dialog box pops up all the time. No matter if "yes" or "no" is selected, the box can pop up again immediately. There definitely needs to be a rate limit on that so the file can be closed (maybe wait at least 5 seconds until popping it up again), but perhaps having an option to ignore updates or perhaps to continuously reload the file (naturally without scrolling back to the top) would be a useful improvement.

solemnwarning commented 9 months ago

Well playing with this made me discover another bug where pressing "No" on the file modified dialog reloads it anyway (d19b073e72a6ed8803b74d92c1fd7b56037efa27).

With that fixed, once you press "No" you won't be prompted again as the file will remain "already modified" when further writes occur. Not settled yet, but I'll probably add an auto-reload setting which can be enabled on a per-file basis from the dialog or toggled from the file menu.

alexforencich commented 9 months ago

Well, I suppose another option might be to scrap the modal box completely and instead pop up some other sort of less-intrusive notification, where you can either ignore it and keep working without reloading, or hit a button to "reload" or "dismiss" (either during the session, or until the next time the file changes).

solemnwarning commented 9 months ago

I added the auto reload toggle to the "File" menu and a button to enable it from the modal, which also won't pop up when the editor window is in the background to make it a bit less annoying.

Also the scroll position should be preserved correctly when reloading now.