On 09/30/09 12:25, eric b wrote:
Hi,
To customize the UI on powerless machines (like XO), I adapted a change
I did on Mac OS X some years ago. The idea is to provide configuration
files, to allow the customization (we'll probably have one dedicated for
the XO). If the user config file is not found, we'll use one in presets
( $OOO_BASE_DIR/presets ).
But I got a problem with Bootstrap::getFrom() and I wonder what exactly
happens ... Here is what I do :
1) in bootstraprc, I added the entries (Linux and OOo4Kids only) taken
from scp2 patch :
+ Key = "OOo4KidsIntegrationUserFile";
+ Value = "$UserInstallation/user/ooo4kidsrc.txt";
+ Key = "OOo4KidsIntegrationDefaultFile";
+ Value = "${OOO_BASE_DIR}/presets/ooo4kidsrc.txt";
-> verified ok, the boostraprc file does contain both after the
installation. Means if the first entry is wrong, the fallback is ok (and
tested ok)
2) And in vcl/unx/gdi/ooo4kidsint.cxx I do :
rtl::OUString aUserConfigFile;
rtl::OUString aDefaultConfigFile;
rtl::OUString aTryFiles[2];
// read the content of bootstraprc is necessary to find the path to
the user configuration file ~/.ooo4kids/0.6/user/OOo4kidsrc.txt
rtl::Bootstrap aBootstrap( rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("bootstraprc") ) );
I guess rtl::Bootstrap needs an absolute file URL for the bootstrap
ini-file (if your Midnight Commander has OOo's brand program dir as
current working dir, that might explain why this relative URL magically
happens to work then). Also note that ini-files have different names on
different platforms (boostraprc vs. bootstrap.ini). What you want to do
should be something like the following (untested, just hacked this in
from memory!):
rtl::OUString
aUserConfigFile(RTL_CONSTASCII_USTRINGPARAM("{$BRAND_BASE_DIR/program"
SAL_INIFILENAME("bootstrap") ":OOo4KidsIntegrationUserFile}"));
rtl::Bootstrap::expand(aUserConfigFile);
if (aUserConfigFile.getLength() != 0)
osl::FileBase::getSystemPathFromFileURL(aUserConfigFile, aTryFiles[0]);
and similarly for the DefaultFile.
-Stephan
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org