Hi all.
I'm working with Geany and use CVS/SVN/HG from within a seperate shell. After an update Geany complains about changed files and ask to reload the changes file. It does this for every file.
What about an additional reload all button?
On Wed, 3 Feb 2010 10:22:27 +0100 Joerg Desch jd.vvd@web.de wrote:
I'm working with Geany and use CVS/SVN/HG from within a seperate shell. After an update Geany complains about changed files and ask to reload the changes file. It does this for every file.
What about an additional reload all button?
I think this would be useful, but 2 points:
1. I think it should not reload any unsaved documents as the user may have forgotten about changes when clicking reload all. 2. It could be optimised to only reload files that have the timestamp changed on disk.
Regards, Nick
On Wed, 3 Feb 2010 12:23:50 +0000 Nick Treleaven nick.treleaven@btinternet.com wrote:
On Wed, 3 Feb 2010 10:22:27 +0100 Joerg Desch jd.vvd@web.de wrote:
- I think it should not reload any unsaved documents as the
user may have forgotten about changes when clicking reload all.
Thats a good idea.
- It could be optimised to only reload files that have the
timestamp changed on disk.
Yes, only the timestamp. The file size must be ignored.
Regards
Joerg Desch wrote:
On Wed, 3 Feb 2010 12:23:50 +0000 Nick Treleaven nick.treleaven@btinternet.com wrote:
On Wed, 3 Feb 2010 10:22:27 +0100 Joerg Desch jd.vvd@web.de wrote:
- I think it should not reload any unsaved documents as the
user may have forgotten about changes when clicking reload all.
Thats a good idea.
- It could be optimised to only reload files that have the
timestamp changed on disk.
Yes, only the timestamp. The file size must be ignored.
I agree with mentioned above points. Just curious: Could this be done as part of the addons plugin?
Thanks, Frank
Am 03.02.2010 16:18, schrieb Frank Lanitz:
Joerg Desch wrote:
On Wed, 3 Feb 2010 12:23:50 +0000 Nick Treleavennick.treleaven@btinternet.com wrote:
On Wed, 3 Feb 2010 10:22:27 +0100 Joerg Deschjd.vvd@web.de wrote:
- I think it should not reload any unsaved documents as the
user may have forgotten about changes when clicking reload all.
Thats a good idea.
- It could be optimised to only reload files that have the
timestamp changed on disk.
Yes, only the timestamp. The file size must be ignored.
I agree with mentioned above points. Just curious: Could this be done as part of the addons plugin?
Thanks, Frank
No idea, but is it too heavy for the core? I imagine it adds a button to a core dialog, and when it's pressed already existing core functions are called.
Best regards
On Wed, 03 Feb 2010 16:24:34 +0100 Thomas Martitz thomas.martitz@student.HTW-Berlin.de wrote:
Am 03.02.2010 16:18, schrieb Frank Lanitz:
Joerg Desch wrote:
On Wed, 3 Feb 2010 12:23:50 +0000 Nick Treleavennick.treleaven@btinternet.com wrote:
On Wed, 3 Feb 2010 10:22:27 +0100 Joerg Deschjd.vvd@web.de wrote:
- I think it should not reload any unsaved documents as the
user may have forgotten about changes when clicking reload all.
Thats a good idea.
- It could be optimised to only reload files that have the
timestamp changed on disk.
Yes, only the timestamp. The file size must be ignored.
I agree with mentioned above points. Just curious: Could this be done as part of the addons plugin?
No idea, but is it too heavy for the core? I imagine it adds a button to a core dialog, and when it's pressed already existing core functions are called.
Just a thought as it would good match to the document pull-down IMHO.
Regards, Frank
I understood the requirement is to add a "reload all" button to the annoying existing dialog that pops up when files change on disk. So the user only sees it once if they press reload all. That would be hard to do in a plugin as I understand it.
Nick I agree with your limitation to saved files, what are you going to do to inform the user when several unsaved files change under them? If there is more than one such file I am likely to forget which ones I have to save under a different name until I check any conflicts. Maybe a list in a modeless dialog box so it can hang around, and the ultimate would be for Geany to change the list in the dialog as the conflict between unsaved and modified files goes away. ;-)
Cheers Lex
On 4 February 2010 02:18, Frank Lanitz frank@frank.uvena.de wrote:
Joerg Desch wrote:
On Wed, 3 Feb 2010 12:23:50 +0000 Nick Treleaven nick.treleaven@btinternet.com wrote:
On Wed, 3 Feb 2010 10:22:27 +0100 Joerg Desch jd.vvd@web.de wrote:
- I think it should not reload any unsaved documents as the
user may have forgotten about changes when clicking reload all.
Thats a good idea.
- It could be optimised to only reload files that have the
timestamp changed on disk.
Yes, only the timestamp. The file size must be ignored.
I agree with mentioned above points. Just curious: Could this be done as part of the addons plugin?
Thanks, Frank
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
On Thu, 4 Feb 2010 10:21:52 +1100 Lex Trotman elextr@gmail.com wrote:
If there is more than one such file I am likely to forget which ones I have to save under a different name until I check any conflicts.
That was my thought too.
What about adding the list of files affected to the dialog?
What about adding a checkbox to each entry to give the user the possibility to unselect some of the files.
And what about a common checkbox to enable a "save action" where all files which have to be reloaded are saved with a postfix like "-RELOADED"? Here I'm not sure if this is necessary.
Maybe a list in a modeless dialog box so it can hang around, and the ultimate would be for Geany to change the list in the dialog as the conflict between unsaved and modified files goes away. ;-)
The "add a postfix" action could supersede this!
On 4 February 2010 17:26, Joerg Desch jd.vvd@web.de wrote:
On Thu, 4 Feb 2010 10:21:52 +1100 Lex Trotman elextr@gmail.com wrote:
If there is more than one such file I am likely to forget which ones I have to save under a different name until I check any conflicts.
That was my thought too.
What about adding the list of files affected to the dialog?
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.
What about adding a checkbox to each entry to give the user the possibility to unselect some of the files.
And this means a custom dialog and handling, still if someone wrote it ...:-)
And what about a common checkbox to enable a "save action" where all files which have to be reloaded are saved with a postfix like "-RELOADED"? Here I'm not sure if this is necessary.
As above.
Maybe a list in a modeless dialog box so it can hang around, and the ultimate would be for Geany to change the list in the dialog as the conflict between unsaved and modified files goes away. ;-)
The "add a postfix" action could supersede this!
Personally I don't like this sort of solution, it tends to clutter up working directories, Yes I know rm *-RELOAD would delete them, but you have to run it in each directory.
Cheers Lex
-- Email: Joerg Desch <jd DOT vvd AT web DOT de> _______________________________________________ Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
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?
What about adding a checkbox to each entry to give the user the possibility to unselect some of the files.
And this means a custom dialog and handling, still if someone wrote it ...:-)
Is it possible to add a scripting hook to Geany? If the hook is registered, the internal dialog isn't used. Instead of it, the script is called.
Is there an API for the script to detect a change?
Personally I don't like this sort of solution, it tends to clutter up working directories, Yes I know rm *-RELOAD would delete them, but you have to run it in each directory.
You are right. It is more a work-a-round. By the may... make clean could do this job too. ;-)
Regards
Can we simply have that reload all button (without reloading unsaved files) and stop over-engineering this? :(
Best regards.
But then those files will still have a mismatched timestamp, so won't the dialog just re-appear?
Cheers Lex
On 4 February 2010 22:17, Thomas Martitz thomas.martitz@student.htw-berlin.de wrote:
Can we simply have that reload all button (without reloading unsaved files) and stop over-engineering this? :(
Best regards. _______________________________________________ Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
In fact thinking about it some more, all files are going to have to be handled in some way in the original modal dialog box otherwise any that still have timestamp mismatches and so will show the dialog again. The function document_check_disk_status is called from lots of places (eg keypresses and button clicks) but hopefully a modal dialog will not let it happen until all files are reloaded or their time updated to match the disk time.
Cheers Lex
On 4 February 2010 22:47, Lex Trotman elextr@gmail.com wrote:
But then those files will still have a mismatched timestamp, so won't the dialog just re-appear?
Cheers Lex
On 4 February 2010 22:17, Thomas Martitz thomas.martitz@student.htw-berlin.de wrote:
Can we simply have that reload all button (without reloading unsaved files) and stop over-engineering this? :(
Best regards. _______________________________________________ Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
On Thu, 4 Feb 2010 22:47:02 +1100 Lex Trotman elextr@gmail.com wrote:
But then those files will still have a mismatched timestamp, so won't the dialog just re-appear?
What's the problem with that? We can grey out the reload all button for the unsaved case. It should be a quite rare situation, I doubt the user would have more than one unsaved file that changed on disk.
On 4 February 2010 22:17, Thomas Martitz thomas.martitz@student.htw-berlin.de wrote:
Can we simply have that reload all button (without reloading unsaved files) and stop over-engineering this? :(
Regards, Nick
On 5 February 2010 02:35, Nick Treleaven nick.treleaven@btinternet.com wrote:
On Thu, 4 Feb 2010 22:47:02 +1100 Lex Trotman elextr@gmail.com wrote:
But then those files will still have a mismatched timestamp, so won't the dialog just re-appear?
What's the problem with that? We can grey out the reload all button for the unsaved case. It should be a quite rare situation, I doubt the user would have more than one unsaved file that changed on disk.
Hmmm I think you're probably right, although it annoys me having all the reloads, when I use the VCS I usually only have unsaved files by accident, so this would work.
Cheers Lex
On 4 February 2010 22:17, Thomas Martitz thomas.martitz@student.htw-berlin.de wrote:
Can we simply have that reload all button (without reloading unsaved files) and stop over-engineering this? :(
Regards, Nick _______________________________________________ Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
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?
Cheers Lex
What about adding a checkbox to each entry to give the user the possibility to unselect some of the files.
And this means a custom dialog and handling, still if someone wrote it ...:-)
Is it possible to add a scripting hook to Geany? If the hook is registered, the internal dialog isn't used. Instead of it, the script is called.
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.
Personally I don't like this sort of solution, it tends to clutter up working directories, Yes I know rm *-RELOAD would delete them, but you have to run it in each directory.
You are right. It is more a work-a-round. By the may... make clean could do this job too. ;-)
Regards
Email: Joerg Desch <jd DOT vvd AT web DOT de> _______________________________________________ Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
On Thu, 4 Feb 2010 22:40:21 +1100 Lex Trotman elextr@gmail.com wrote:
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?
I don't know Geanys design, so I can't answer this.
But why not use the current detection? At the time the changes of current file has been detected, Geany could check the others too.
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
Am Donnerstag, den 04.02.2010, 20:00 +1100 schrieb Lex Trotman:
On 4 February 2010 17:26, Joerg Desch jd.vvd@web.de wrote:
On Thu, 4 Feb 2010 10:21:52 +1100 Lex Trotman elextr@gmail.com wrote:
If there is more than one such file I am likely to forget which ones I have to save under a different name until I check any conflicts.
That was my thought too.
What about adding the list of files affected to the dialog?
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.
What about adding a checkbox to each entry to give the user the possibility to unselect some of the files.
And this means a custom dialog and handling, still if someone wrote it ...:-)
And what about a common checkbox to enable a "save action" where all files which have to be reloaded are saved with a postfix like "-RELOADED"? Here I'm not sure if this is necessary.
As above.
Maybe a list in a modeless dialog box so it can hang around, and the ultimate would be for Geany to change the list in the dialog as the conflict between unsaved and modified files goes away. ;-)
The "add a postfix" action could supersede this!
Personally I don't like this sort of solution, it tends to clutter up working directories, Yes I know rm *-RELOAD would delete them, but you have to run it in each directory.
Even if I wouldn't like that way also, what about using find there? find . -name "*-RELOAD" -delete
I could imagine that would work, but maybe also should be easier to handle for the user from within Geany, since Geany would generate the files.
Regards, Dom
Am Donnerstag, den 04.02.2010, 20:00 +1100 schrieb Lex Trotman:
On 4 February 2010 17:26, Joerg Desch jd.vvd@web.de wrote:
On Thu, 4 Feb 2010 10:21:52 +1100 Lex Trotman elextr@gmail.com wrote:
If there is more than one such file I am likely to forget which ones I have to save under a different name until I check any conflicts.
That was my thought too.
What about adding the list of files affected to the dialog?
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.
What about adding a checkbox to each entry to give the user the possibility to unselect some of the files.
And this means a custom dialog and handling, still if someone wrote it ...:-)
And what about a common checkbox to enable a "save action" where all files which have to be reloaded are saved with a postfix like "-RELOADED"? Here I'm not sure if this is necessary.
As above.
Maybe a list in a modeless dialog box so it can hang around, and the ultimate would be for Geany to change the list in the dialog as the conflict between unsaved and modified files goes away. ;-)
The "add a postfix" action could supersede this!
Personally I don't like this sort of solution, it tends to clutter up working directories, Yes I know rm *-RELOAD would delete them, but you have to run it in each directory.
Cheers Lex
From the perspective of a User and GUI-Designer, here is some inspiration how this could be done (Of course, that would need much work underneath):
http://www.pnotepad.org/wp-content/uploads/2008/03/savemodified.png
Also it maybe would be an idea to add "Reload" and "Reload all" to the popup menu when clicking on the document tabs.
Regards, Dom