I don't see any need for 2 messages, and I would find this very annoying (IR puts out too many messages as it is).e34m5 wrote:No prob..I'll put a messsage on not save until you choose. Keep in mind that you will receive two messages then.
One for the buffer as you see today and another for the notes.
...
Not so easy my friend. In IR there isn't a flag per se. What happens when a file is opened the entire remote file is loaded into an array called Loaded.
During the time you work in IR another array called Buffer stores the all the new values.
When exiting (saving) the contents of the two are compared and if different you see the "Buffer has changed" note.
So because one could change notes w/o changing the IR file I think we need two separate checks.
The way I see it, it shouldn't be that hard to fix this in a sensible way. When an IR file is opened and the "loaded" array is loaded, you should also load an array called "notes-old". Then as the notes are added/changed, you should load the new version into an array called "notes-new".
Then when exiting and the "loaded" vs. "buffer" comparison is made, you should also do a "notes-old" vs. "notes-new" comparison. If either test fails (ie, the "loaded" or "notes-old" tests) you would put out 1 message asking the user if they want to save their changes.
If they answer "yes", you should then see which file was changed and perform the updates.
Regarding the notes file, if the new file is empty I think you should delete the notes file rather than replacing it with an empty file.
Somethings just occurred to me that may or may not be a problem with this. Let's say I create a file called robs-remote.txt and I add a bunch of comments (and save it). I then load this file into my remote and do further changes using the remote itself and then re-download. At this point IR doesn't have a file name in play. Next, I save the downloaded memory image over my old robs-remote.txt file. In this circumstance, I think I would like all my old comments to remain active, even though there wouldn't have been any comments associated with the downloaded image per se.