AkelPad Forum Index AkelPad
Support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Watch File Change feature enhancement

 
Post new topic   Reply to topic    AkelPad Forum Index -> Discussion (English)
View previous topic :: View next topic  
Author Message
danf84



Joined: 14 Mar 2011
Posts: 14

PostPosted: Tue Jul 17, 2012 10:40 am    Post subject: Watch File Change feature enhancement Reply with quote

Hello,

Could you enhance the Watch File Change feature as follows:
If a change has been made to the file externally, and the file has also been modified by the user, show a different message box or if the user selects to reload the file, tell them that the file has also been changed and the changes will be lost.

For example:

"C:\Temp\myFile.txt" has been modified outside.
Do you want to reopen it?"
Then if the user selects "Yes", follow the normal protocol, that is, "Do you want to save changes?" Because right now, AkelPad simply skips that.

Kind regards,

Dan
Back to top
View user's profile Send private message
Surveyor



Joined: 08 Feb 2008
Posts: 146
Location: British Columbia, Canada

PostPosted: Wed Jul 18, 2012 7:58 pm    Post subject: External changes to file detected Reply with quote

Dan,

I sort of see where you are going with the request, but I don't understand how it might work. For example:
  1. You open myFile.txt with AkelPad and make changes. Changes are not yet saved, so are in memory only.
  2. myFile.txt (same file, on disk!) is modified by unknown means. This could be you editing it in Notepad, or another program operating on that file as output, etc. Actual disk file is saved (i.e. modified on disk).
  3. AkelPad detects the change (archive bit set, size/date changed, or ?) and reports that the disk file you have loaded is now changed. "Do you want to reopen it?" Reopening it will destroy your current changes (still in memory).
  4. As per your request, AkelPad reports "Do you want to save changes?" You do, saving the file to its original disk container.
  5. AkelPad continues and reopens the file, as promised - but it is now the file you just saved! Changes made by the external program are gone.

The only way to beat this behaviour already exists; when AkelPad detects a change, don't reopen the file, but save it to another name instead (Save as...). Now reopening the file (F5) opens the file as modified by the external program. I don't see how you could have it both ways without having 2 files (i.e. one renamed).

Am I missing something else here? I supposed AkelPad could do some renaming, etc. for you, but I think this is contrary to the spirit of the program - you have control. If AkelPad is set for multiple files (tabs), then it could open the other file in a new tab, but then you would have 2 "identical" tabs, one that you edited, one edited by an external program - confusing! In non-tabbed mode, the externally modified file would open in a new AkelPad window - same problem (confusing).

Your suggestion, however, a good one - in most cases you would want to save your work before opening the externally modified copy. For some time I have thought that AkelPad should have an (optional) behaviour to save a .bak file, as many other applications do (Instructor - are you listening?!). That way you would always have the current version, and the previous version of any file.

- Surveyor
Back to top
View user's profile Send private message Send e-mail
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 5159

PostPosted: Thu Jul 19, 2012 4:59 am    Post subject: Re: External changes to file detected Reply with quote

Surveyor wrote:
For some time I have thought that AkelPad should have an (optional) behaviour to save a .bak file, as many other applications do...
SaveFile::AutoSave?
Back to top
View user's profile Send private message Send e-mail
danf84



Joined: 14 Mar 2011
Posts: 14

PostPosted: Mon Aug 06, 2012 9:19 pm    Post subject: Reply with quote

Sorry to reply so late. Completely forgot to check back as I thought the feature was pretty straight forward.

I don't want AkelPad to rename anything. I simply want AkelPad to tell - if the file watch is enabled - that the file has been modified externally, but in the same Message Box also add a note to let me know if file has also been modified internally; if the file hasn't been touched by AkelPad then the standard message should be displayed e.g. "File has been modified externally. Reload? Yes/No", and if it has been modified externally say "File has been modified externally. You've also made changes to the file here which will be lost if you press Yes; Yes/No/Cancel". Then *I* can decide whether to press "Yes" and make a choice to lose my changes or press "Cancel" and do File -> Save As; then the world's your oyster (then I can compare 2 files and ensure no data loss). Now, if the file has changed, and I don't remember whether I made changes to it or not inside AkelPad, and I find myself facing a dialog asking whether to reopen a file or not, I risk of inadvertantly *losing* my changes.

This feature is a *must* if any valuable stuff like code is to be done using AkelPad.

Kind regards, Dan
Back to top
View user's profile Send private message
Surveyor



Joined: 08 Feb 2008
Posts: 146
Location: British Columbia, Canada

PostPosted: Tue Aug 07, 2012 6:35 am    Post subject: Reply with quote

Dan,

Re: file changed inside AkelPad, have a look at the User Manual (posted now in the downloads section). Appendix E's ShowModify tool allows you to specify different ways to see if the file is modified (and not yet saved).

- Surveyor
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AkelPad Forum Index -> Discussion (English) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


SourceForge.net Logo Powered by phpBB © 2001, 2005 phpBB Group