Page 1 of 2

your point of view about FR 2257774

Posted: Sat Jan 03, 2009 10:38 pm
by jfouche
Hi

I would like to implement FR 2257774 : StatusBar indicator for Read-Only file
I can do the way proposed : status bar indicator (nothing or "R/O"), but another solution is to show this information directly on the file tab (the filename in italic for exemple).
What do you think. What is the best solution ?

Re: your point of view about FR 2257774

Posted: Sun Jan 04, 2009 2:06 am
by eranif
I think that status bar is the more standard way to go.

A patch for this one is most welcome

Eran

Re: your point of view about FR 2257774

Posted: Mon Jan 05, 2009 8:38 pm
by tjulian
I have already implemented this feature, as well preventing edits to Read-Only files (for Win32) in my working copy. If you are interested, I can provide a patch.
--tim

Re: your point of view about FR 2257774

Posted: Mon Jan 05, 2009 10:48 pm
by eranif
tjulian wrote: have already implemented this feature, as well preventing edits to Read-Only files (for Win32) in my working copy. If you are interested, I can provide a patch.
Ofc, send it over

Eran

Re: your point of view about FR 2257774

Posted: Tue Jan 06, 2009 12:09 am
by tjulian
Here is a read-only patch (generated by TortoiseSVN) for Win32, needs help for Linux/Mac.

--tim

My first patch, I do not know if I did this right.

Re: your point of view about FR 2257774

Posted: Tue Jan 06, 2009 12:20 am
by eranif
Since m_fileName is of type wxFileName, you could simply use m_fileName.IsFileWritable() instead of adding global method.

I will give it a shot tomorrow, and will let you know
Thanks,
Eran

Re: your point of view about FR 2257774

Posted: Tue Jan 06, 2009 12:53 am
by tjulian
I could not get IsFileWritable() to work in Win32, so I grabbed some code from wxWidgets to make it work. From what I tested, I came to the conclusion that IsFileWritable() only works with permissions and not the read-only attribute. I assume IsFileWritable() works on Linux/Mac but cannot test it (I stubbed it in globals.cpp). Maybe you can determine what the problem is.

My thoughts are that there probably should be a menu item that allows the read-only attribute to be cleared, but that's 'not-good' for how we use read-only files so I did not implement it. Also, I gave the read-only message in the StatusBar its own section, it instead could be appended to one of the others.

--
tim

Re: your point of view about FR 2257774

Posted: Tue Jan 06, 2009 9:52 pm
by jfouche
Hi
I tested wxFileName::IsFileWritable() and everything is fine for me. What is your problem ?
For example, here is my patch.
FYI : I think it can be a good idea to add an enum to name the status cols (msg, database, cur_pos, mode, build) for a better comprehension...

Re: your point of view about FR 2257774

Posted: Tue Jan 06, 2009 11:18 pm
by tjulian
FYI : I think it can be a good idea to add an enum to name the status cols (msg, database, cur_pos, mode, build) for a better comprehension...
I agree.
What is your problem ?
Open frame.cpp in CodeLite. Then in Windows Explorer, right-click frame.cpp and select properties. The check the 'read-only' checkbox. My problem is that IsFileWritable did not detect that the file is now read-only. Does it work for you?

--tj

Re: your point of view about FR 2257774

Posted: Sat Jan 10, 2009 1:06 am
by tjulian
Eran,
I will give it a shot tomorrow, and will let you know
Any update on this topic?
--tj