Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: GeO on March 27, 2010, 09:11:02 pm

Title: Patch for projectfileoptionsdlg.cpp
Post by: GeO on March 27, 2010, 09:11:02 pm
Just some optical improvements:
 -Layout the Dialog after inserting values
 -Better formatting of date and time
 -added bytes to the filelength (18456 bytes)

[attachment deleted by admin]
Title: Re: Patch for projectfileoptionsdlg.cpp
Post by: Ceniza on March 27, 2010, 10:03:58 pm
According to the patch the date is shown using the current locale. That means those of us who have configured the system to show it as dd/mm/yyyy would get it like that. That was my concern.

Patch looks good to me. I have NOT applied it, though.
Title: Re: Patch for projectfileoptionsdlg.cpp
Post by: GeO on March 27, 2010, 10:32:23 pm
Here is an update:
i reverted my date formating changes, but i changed the format string, so that the values will be filled with 0 if they are less then 10.

old format string:
Code
"%ld/%ld/%ld %ld:%ld:%ld"

new format string:
Code
"%02ld/%02ld/%ld %02ld:%02ld:%02ld"

[attachment deleted by admin]
Title: Re: Patch for projectfileoptionsdlg.cpp
Post by: killerbot on March 28, 2010, 12:06:39 am
great, but I think the %ld Bytes should be _() since the word bytes could be translated into other languages.
Title: Re: Patch for projectfileoptionsdlg.cpp
Post by: killerbot on March 28, 2010, 09:33:18 am
On my OpenSuse 10.3 box (aged distribution ;-)  ), I get the following for a timestamp (exiting CB code, the patch not applied yet) :

21/3/2010 14:140733193388067:22


Title: Re: Patch for projectfileoptionsdlg.cpp
Post by: GeO on March 28, 2010, 11:20:02 am
great, but I think the %ld Bytes should be _() since the word bytes could be translated into other languages.
Yes your are right. I changed it.

for the other problem, i think the reason is, that we use ld, which means long int or unsigned long int.
instead we should use hd, wich means short int or unsigned short int, because wxDateTime_t is defined as:

Code
typedef unsigned short wxDateTime_t;


[attachment deleted by admin]
Title: Re: Patch for projectfileoptionsdlg.cpp
Post by: killerbot on March 28, 2010, 02:58:40 pm
applied, and on my OpenSuse 10.3 box, I now get normal time stamps :-)
Title: Re: Patch for projectfileoptionsdlg.cpp
Post by: GeO on April 03, 2010, 07:09:08 pm
btw,
this patch solved bug 16288 on berlios
https://developer.berlios.de/bugs/?func=detailbug&bug_id=16288&group_id=5358 (https://developer.berlios.de/bugs/?func=detailbug&bug_id=16288&group_id=5358)
so it could be closed

greets GeO
Title: Re: Patch for projectfileoptionsdlg.cpp
Post by: killerbot on April 05, 2010, 07:02:37 pm
done. Thanks for pointing this out.