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 » Sat Jan 03, 2009 10:38 pm

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: 5926
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 » Sun Jan 04, 2009 2:06 am

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 » Mon Jan 05, 2009 8:38 pm

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: 5926
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 » Mon Jan 05, 2009 10:48 pm

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 » Tue Jan 06, 2009 12:09 am

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: 5926
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 » Tue Jan 06, 2009 12:20 am

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 » Tue Jan 06, 2009 12:53 am

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 » Tue Jan 06, 2009 9:52 pm

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 » Tue Jan 06, 2009 11:18 pm

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 » Sat Jan 10, 2009 1:06 am

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

Post Reply