Review Request: User defined variables (2)
Sebastian Sauer
mail at dipe.org
Thu Dec 1 20:06:44 GMT 2011
> On Nov. 28, 2011, 6:53 a.m., Thorsten Zachmann wrote:
> > plugins/variables/UserVariable.h, lines 65-67
> > <http://git.reviewboard.kde.org/r/103276/diff/1/?file=42288#file42288line65>
> >
> > Is it possible to move the option widget into its own class. That makes it easier for applications not based on QWidget to use it?
>
> Sebastian Sauer wrote:
> Sure. But I would see that as new requirement which can be done after landing. Atm it's done the same way all our other variables including our API is done what means QWidget's are a hard requirement and logic is mixed with UI. What we would do ideally is to move *ALL* the UI things into plugins that are separated from the variable-plugin (kcm-like) and then depending on the UI either the QWidget-plugins are loaded or not. But that is out-of-scope of the work done in this branch and I would prefer not to raise the requirement to finally land that branch to master without really good reasons. The branch already produces additional work-time on my end that is not required when landed into master what should be done asap imho before a few more months are needed for the next iteration.
>
Meanwhile done with commit f7950678091a4753d9ee48f43772641cbaba800c.
- Sebastian
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/103276/#review8555
-----------------------------------------------------------
On Dec. 1, 2011, 7:13 p.m., Sebastian Sauer wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/103276/
> -----------------------------------------------------------
>
> (Updated Dec. 1, 2011, 7:13 p.m.)
>
>
> Review request for Calligra and Thorsten Zachmann.
>
>
> Description
> -------
>
> Following patch implements user defined variables. This solves bug https://bugs.kde.org/show_bug.cgi?id=282972
>
> What I did;
> * extended the KoVariableManager to handle now also such user defined variables.
> * the KoVariableManager now has loadOdf and saveOdf methods to load and save user defined variables declarations.
> * the user defined variables are implemented using the new plugins/variables/User* classes.
> * KoVariable::manager() can now be used even on KoVariable::createOptionsWidget
> * replaced the previous unused KoInlineObject::User with KoInlineObject::UserGet and KoInlineObject::UserInput and make use of them
> * extended KoTextLoader.cpp to proper load user defined variables into the KoVariableManager. Instances are created using the new UserVariable plugin.
> * extended KoOdfNumberStyles with the formatFraction method. Ideally I would also move the other format (e.g. formatDate, formatTime, etc.) methods from the plugin to the KoOdfNumberStyles class to have it reusable (we at least need formatDate and KoOdfNumberStyles also in the DateVariable later).
> * added the KoOdfNumberStyles::saveOdfBooleanStyle to also save boolean formattings proper back.
> * introduced the KoOdfNumberStyles::saveOdfNumberStyle method to handle choosing the proper KoOdfNumberStyles::saveOdf*Style methods.
> * extended KWOdfWriter.cpp to proper save the user defined variable declarations back to the ODT.
>
> Remaining problems;
> * there is no way to add/edit/remove/display such user defined variables in Calligra Tables. Seems oocalc has the same problem.
> * the UI still misses a way to set/modify custom formatings.
> * support for formulas... but this is another beast and partly already covered at bug 283816. I do not plan to work on this anytime soon.
>
> Update to the first review-request at https://git.reviewboard.kde.org/r/102890/ ;
> * loading of the variables happens now not any longer in the KoTextLoader but in the applications themself right after loading the body-element what is inline with how saving is done.
> * the same logic is applied to Calligra Words, Stage and Tables what means all 3 of them support now loading and saving of user defined variables. Editing can be done direct in the Insert=>Variable=>Custom (should we better rename it to "User defined" rather then "Custom"?) dialog what is inline with how it can be done in OO.org/LO.
>
>
> Diffs
> -----
>
> libs/kopageapp/KoPADocument.cpp 43e002a
> libs/kotext/InsertVariableAction.cpp de68bbf
> libs/kotext/KoInlineObject.h fbd1795
> libs/kotext/KoVariableManager.h 680a29b
> libs/kotext/KoVariableManager.cpp a915b77
> libs/kotext/tests/TestKoInlineTextObjectManager.cpp 5bafc82
> libs/odf/KoOdfNumberStyles.h 536408d
> libs/odf/KoOdfNumberStyles.cpp 5611465
> libs/odf/tests/CMakeLists.txt a1c71dc
> libs/odf/tests/TestNumberStyle.h PRE-CREATION
> libs/odf/tests/TestNumberStyle.cpp PRE-CREATION
> plugins/variables/CMakeLists.txt cca8198
> plugins/variables/UserVariable.h PRE-CREATION
> plugins/variables/UserVariable.cpp PRE-CREATION
> plugins/variables/UserVariableFactory.h PRE-CREATION
> plugins/variables/UserVariableFactory.cpp PRE-CREATION
> plugins/variables/VariablesPlugin.cpp 913aebc
> tables/DocBase.h daf758e
> tables/DocBase.cpp adb9940
> words/part/KWAboutData.h 68e9a6f
> words/part/KWOdfLoader.cpp 837280a
> words/part/KWOdfWriter.cpp ebfdad9
>
> Diff: http://git.reviewboard.kde.org/r/103276/diff/diff
>
>
> Testing
> -------
>
> see the documents attached to bug 282972
>
>
> Thanks,
>
> Sebastian Sauer
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20111201/faf1abc1/attachment.htm>
More information about the calligra-devel
mailing list