[Okular-devel] [PATCHES] Customizable annotation tools

Albert Astals Cid aacid at kde.org
Tue Jul 31 22:32:06 UTC 2012


El Dilluns, 30 de juliol de 2012, a les 21:20:21, Fabio D'Urso va escriure:
> Hi everybody,

Hi

> The attached patches allow the user to change the default settings of each
> annotation tool. They also allow creation of new tools (for example, to
> create a second highlighter with a different color) and removal of existing
> ones. It's possible to set predefined values for any property that can be
> edited in existing annotations. In fact, I reused the same widget as the
> proerties dialog.
> I also added support for three new properties (inner color in polygons, line
> width in ink annotations, text alignment in inplace text annotations). The
> patches also expose some tools that were mostly implemented but not shown
> to the user:
>  - Squiggly and Strike out (both based on the TextSelector engine, which is
>    currently used to highlight and underline text)
>  - Rectangle (based on PickPoint engine, like Ellipse)
>  - Polyline (based on PolyLine engine, with a fix to make it possible to end
> a path by double-clicking on the last point).
> 
> Currently, the tools' list is stored in a XML file (ui/data/tools.xml). In
> principle, editing this file is enough to edit and create tools.
> The approach I've used is to store the tool list in the user's
> configuration, in form of a list of XML strings each representing a tool,
> and making the same functions that used to parse tools.xml parse these
> strings instead. Note that tools.xml is still used: it now contains the
> default tools.
> 
> == Brief summary of patches ==
Only had a look at the i18n patches since wanted to make sure we didn't have 
OneTimeTranslation issues.

> Patch 0008, together with patches 0030 and 0031 deals with translation
> issues. The problem is basically that tools.xml contains translatable
> strings (tools' names and tooltips), which were translated after tools.xml
> was parsed. But now we are allowing the user to edit the tools and, in
> particular, set its own tool names, therefore we can't assume that texts
> from the tool list are meant to be translated, because those set by the
> user are not.
> In patch 0008, I moved the translation phase to kcfg initialization. That
> is, tools.xml still contains translatable strings, but the setting property
> is translated. Therefore I can then assume that all texts in the tool list
> are already translated. Patches 0030 and 0031 go even further and remove
> all translatable texts from tools.xml.

It might be good adding some contents to PageViewAnnotator::defaultToolName 
since e.g. "Underline" can be read as a verb or as a noun.


> P.S.: Before we begin to review and commit patches, I'd like to have some
> feedback about the GUI changes.

What happens when there are lots of items in the toolbar, do you get a double 
line of icons?

Can we see screenshots of the other GUI changes you made for lazy people?

Cheers,
  Albert

> 
> Fabio


More information about the Okular-devel mailing list