On Thu, 4 Feb 2010 22:40:21 +1100, Lex wrote:
On 4 February 2010 22:10, Joerg Desch jd.vvd@web.de wrote:
On Thu, 4 Feb 2010 20:00:15 +1100 Lex Trotman elextr@gmail.com wrote:
Thats certainly possible, but to be useful the dialog has to be non-modal so the user can do something about it. That is a lot more work than just adding a button to the current dialog and using a non-modal message only dialog with the list of files. The standard GTK message dialog can arrange for itself to close IIRC. Making files disappear off the list is for the wish list.
OK. Do I understand right? A non-modal dialog with an additional "reload all" button is possible? If so, the list of files which has to be reloaded could be added to the message text?
Certainly adding the list to the dialog should be possible, its just text, but making a dialog non-modal is more complicated, you need callbacks instead of waiting for the response etc. This changes the whole design of that section of the code. Its all possible, but it depends on if its worth it. I was suggesting leaving the current dialog modal and using the GTK standard message dialog that only has a close button that can be connected to close the dialog without any callbacks etc in the user code. Less work.. :-)
One thought I had which one of the Geany experts will have to answer is: once the dialog has appeared can it be stopped from continuing to appear if we save/rename the open files, ie is the detection of mismatched timestamps synchronous or asynchronous which would mean a queue of mismatches waiting to annoy us anyway?
Technically yes. Just keep a reference to the dialog widget and gtk_widget_destroy() it on demand.
Anyway, like Thomas said, don't make that simple, useful feature request such a huge beast. I like Nick's first suggestion: Reload All checks the timestamps of the files to reload and reloads them if necessary. If there are any unsaved files, just disable the Reload All action until they are saved (or reloaded manually or whatever). I see that this would be less convenient than a fancy big non-modal dialog which gives you super heavy ultra power over everything (:D) but as said, it's just a simple but useful feature to get some work done quickly.
Just my 2cents.
Oh, one last note: if you would like to have the 'Reload All' feature as a toolbar button as well, we would need an icon :). AFAIK there is no stock icon for such an action.
Is there an API for the script to detect a change?
I don't think such hooks exist and I would think it will take as much work as doing the dialog.
'Script hooks' don't exist as such but there is a plugin API for C/C++ plugins and there is the GeanyLua plugin which can run Lua code in Geany. Though, I don't know off-hand if the API provides all what would be necessary but missing parts could certainly added, if necessary. But well, see above.
Regards, Enrico