[Kbabel] highlighting - first draft
Stanislav Visnovsky
visnovsky@nenya.ms.mff.cuni.cz
Mon, 25 Nov 2002 17:02:32 +0100 (CET)
Hi!
I've tested your code and it works really nicely. The only problem is that
if there is an error, it does not change the color to the error color.
But that could be just a problem with my current tree (it is heavily
modifed already, but the patch applied almost cleanly).
This would be nice to have for the next KBabel version.
The question about configuration: I'd like to keep the current interface
of MsgMultiLine, at least at the moment. I'm wondering if we need to
implement a central configuration singleton or something, just to keep the
configuration-related code reasonable (it starts to spread all over the
map).
KBabel already stores some of its regular expressions in the kbabelrc
config file (for example tag-matching regexps).
As to bold text, I'm not really sure about this: did you try it? I would
expect some problems with "dots".
Great work!
Stanislav
On Sun, 24 Nov 2002, Marco Wegner wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi all,
>
> I invite you to test the latest implementation of my highlighting class.
>
> For this please copy kbhighlighting.{cpp,h} from the archive to
> kdesdk/kbabel/kbabel and apply the patch in the same directory (current
> HEAD).
>
> I have completely overhauled my previous design and made the class much
> compacter than it was before. It is not yet complete but meanwhile I feel it
> is worth sharing :-)
> Right now the class has the same features (should have at least) as the
> implementation which is already in KBabel but is using a completely different
> approach.
>
> TODO:
> - -- we have to clean out mymultilineedit.{cpp,h} now since there is a lot of
> highlighting-related code which is not needed anymore (lend me a hand here,
> Stanislav?). Basically everything that's still needed is a
> KBabelHighlighter * hl = new KBabelHighlighter( this );
> in the constructor and a few calls to setHighlightColor().
> - -- I would like to put the regular expressions into an extra file (perhaps in
> XML format) so that they are not hard-coded but can be changed if the need
> arises
> - -- the setting of initial highlighting colors needs a little more work. We
> could either read them directly from the config file or let MsgMultiLineEdit
> do the reading and use KBabelHighlighting::setHighlightColor() for setting
> the colors. What do you think?
>
> IDEAS:
> * I'm playing with the thought of using bold font for the tag names and tag
> brackets (<, >) as well as for the entity names (similar to how it is
> highlighted in kate, for instance). Opinions?
>
> Happy testing,
> Marco
>
> - --
> Marco Wegner <mail@marcowegner.de>, <dubbleu@web.de>
> Contributing to KBabel http://i18n.kde.org/tools/kbabel
> and kde-i18n-de http://i18n.kde.org/teams/de
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.1 (GNU/Linux)
>
> iD8DBQE94C8mX3rotM03gSgRAqsCAJ9ou0QpN52dBHP5Q1Ef0ftSbXKeBQCgvbQx
> ZAXaTV4TF7guD+UvJHScgL0=
> =8GAv
> -----END PGP SIGNATURE-----
>