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") ) );

   // retrieve the config files
if( aBootstrap.getFrom( rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM("OOo4KidsIntegrationUserFile") ), aUserConfigFile ) )
        osl::FileBase::getSystemPathFromFileURL(aUserConfigFile, aTryFiles[0]);

// Use that means OOo4Kidsrc.txt is not found in user install dir, and we fallback to the second OOo4Kidsrc.txt (with default values) if( aBootstrap.getFrom( rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM("OOo4KidsIntegrationDefaultFile") ), aDefaultConfigFile ) ) osl::FileBase::getSystemPathFromFileURL(aDefaultConfigFile, aTryFiles[1]);


No problem at build nor at install times : the config files are copied at the right place, and the install dir is ok (else the binary does not launch)

But it does not work:
- tracing the lines say that the string do not appear, means something is wrong perhaps with Bootstrap_Impl somewhere ... - or can this be some STRINGPARAM / USTRINGPARAM mismatch who caused the issue ? (boostrap.cxx uses both USTRINGPARAM and STRINGPARAM, maibe some issue with that) - worse: adding symbols in sal told me everything is pushed ok early at launch, but tracing in vcl, the strings are empty ? hmmm ... :-/


More odd, I found a way to make it (artificialy) work : using Midnight Commander, that's ok, and everything is found, and works as expected, and I can customize what I want.

.. that's all for now in my investigations.


Last but not least: maybe there is a better way to implement such feature ? Thanks in advance for any help :-)


Eric Bachard



--
qɔᴉɹə




Reply via email to