experimental GExperts + code formatter for Delphi XE4

 Delphi, GExperts  Comments Off on experimental GExperts + code formatter for Delphi XE4
Apr 282013
 

There isn’t yet any official release of GExperts for Delphi XE4 but if you don’t mind a little bit of manual work for installing, you can have it anyway.

WARNING: I have just now made this version compile with Delphi XE4. I have not done any tests. You are on your own and responsible for any damage this version might do to your computer and your files. If you don’t accept this responsibility, do not download the software!

Download
GExperts-XE4-1.37-experimental-twm-2013-04-28.zip
and unpack it to a folder of your choice
(e.g. c:\program files\GExperts for RAD Studio XE4)
Copy the expert you want to use from one of the subdirectories created:

  • EditorExpert
  • RegularExpert

to the main directory.

Use the ExpertManager tool to register GExperts to Delphi XE4.
Voila, you are done.

This version is based on the current source code from the GExperts svn repository. I have not released it for any other Delphi versions because nothing has changed since the last release.

 Posted by on 2013-04-28 at 15:12

Storing gnugettext translations as resources

 Delphi  Comments Off on Storing gnugettext translations as resources
Apr 142013
 

I always wondered why the assemble tool in dxgettext appends the translation files directly to the executable rather than using the existing mechanism of resources. This is no longer necessary. I have updated the gnugettext code to optionally use RCDATA resources named after the files.

So you e.g. create a translations.rc file as

LOCALE_DE_DEFAULT RCDATA ..\locale\de\LC_MESSAGES\default.mo
LOCALE_DE_DELPHI RCDATA ..\locale\de\LC_MESSAGES\delphi2007.mo
LOCALE_DE_DZLIB RCDATA ..\locale\de\LC_MESSAGES\dzlib.mo
LOCALE_EN_DEFAULT RCDATA ..\locale\en\LC_MESSAGES\default.mo
LOCALE_EN_DELPHI RCDATA ..\locale\en\LC_MESSAGES\delphi2007.mo
LOCALE_EN_DZLIB RCDATA ..\locale\en\LC_MESSAGES\dzlib.mo

Compile it using a resource compiler e.g. brcc32 to translations.res and add it to the executable.

The new code in gnugettext will automatically find and use these resources, all you have to do is add the conditional define dx_SupportsResources.

// if the conditional dx_SupportsResources is defined the .mo files
// can also be added to the executable as Windows resources
// Be warned: This has not been thoroughly tested.
// Default is turned off.
{.$define dx_SupportsResources}

You can find the updated gnugettext.pas in the dxgettext subversion repository on sourceforge.

Disclaimer: I have only cursorily tested this code. Use it at your own risk!

 Posted by on 2013-04-14 at 19:31

setfacl woes

 Linux  Comments Off on setfacl woes
Apr 092013
 

Ever since I switched my Linux server to using ACLs (access control lists) for advanced access rights management I have struggled with rights being set too restrictive on new directories and files. Now it seems that I have solved the issue and this post is meant to remind me how to change the whole directory tree to the rights I want it to have:

sudo setfacl -Rm d:u::rwX,u::rwX,d:g::rwX,g::rwX,d:o:rX,o:rX directoryname

This recursively sets default and actual rights for directoryname and subdirectories as:

  • users: rw for files and directoryies, x for directories only
  • groups: the same
  • others: r for files and directories, x for directories only

I really hope that this is the last time I have to troubleshoot access rights issues. I want to concentrate on developing software rather than administrating bloody servers.

 Posted by on 2013-04-09 at 10:23