your point of view about FR 2257774

Discussion about CodeLite development process and patches
jfouche
CodeLite Guru
Posts: 351
Joined: Mon Oct 20, 2008 7:26 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

your point of view about FR 2257774

Post 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 ?
Jérémie
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: your point of view about FR 2257774

Post by eranif »

I think that status bar is the more standard way to go.

A patch for this one is most welcome

Eran
Make sure you have read the HOW TO POST thread
tjulian
CodeLite Enthusiast
Posts: 32
Joined: Tue Nov 11, 2008 12:06 am
Contact:

Re: your point of view about FR 2257774

Post 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
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: your point of view about FR 2257774

Post 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
Make sure you have read the HOW TO POST thread
tjulian
CodeLite Enthusiast
Posts: 32
Joined: Tue Nov 11, 2008 12:06 am
Contact:

Re: your point of view about FR 2257774

Post 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.
You do not have the required permissions to view the files attached to this post.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: your point of view about FR 2257774

Post 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
Make sure you have read the HOW TO POST thread
tjulian
CodeLite Enthusiast
Posts: 32
Joined: Tue Nov 11, 2008 12:06 am
Contact:

Re: your point of view about FR 2257774

Post 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
jfouche
CodeLite Guru
Posts: 351
Joined: Mon Oct 20, 2008 7:26 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Re: your point of view about FR 2257774

Post 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...
You do not have the required permissions to view the files attached to this post.
Jérémie
tjulian
CodeLite Enthusiast
Posts: 32
Joined: Tue Nov 11, 2008 12:06 am
Contact:

Re: your point of view about FR 2257774

Post 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
tjulian
CodeLite Enthusiast
Posts: 32
Joined: Tue Nov 11, 2008 12:06 am
Contact:

Re: your point of view about FR 2257774

Post by tjulian »

Eran,
I will give it a shot tomorrow, and will let you know
Any update on this topic?
--tj
Post Reply