Configuration dialogs for Calligra Applications

Shantanu Tushar Jha jhahoneyk at gmail.com
Sat Jan 15 07:36:48 GMT 2011


Hi,

I spent few days working on this and have created a configuration dialog in
KoView with a virtual method which can be overridden by derived classes (for
example, Table's part/View) to add their additional custom pages.

I have attached a patch that adds the common configuration dialog to
libs/main/ and a sample in tables/part/view.cpp on how to add custom dialog
pages. By compiling and running this, you should see two "Configure Tables"
options in calligratables, the new one is the second one. Upon selecting
that, you can see a dialog with the common "Open/Save" page from
libs/main/dialogs/ and a custom page added from Tables.

Please review the patch and let me know if I missed something anywhere, and
when everyone is fine with it, I hope it can be merged. If the correct place
for this is reviewboard, let me know and I'll put it there :)

Thanks!

-- 

Shantanu Tushar    (UTC +0530)
http://www.shantanutushar.com

On Thu, Jan 13, 2011 at 7:23 PM, Shantanu Tushar Jha <jhahoneyk at gmail.com>wrote:

> Hi all,
>
>     We had a discussion on IRC about this (mainly with Boemann and Cyrille)
> and we reached an agreement that the shared configuration dialogs can be
> implemented using the same way tables does it using
> tables/part/dialogs/PreferenceDialog.
>
> So the idea is to have a PreferenceDialog in libs/main/ which is then
> loaded by a menu entry (corresponding to an action) in KoView. This in
> effect should add the entry to all apps using KoView and hence we can share
> common settings like autosave.
>
> An application can add custom pages to this dialog by calling a KoView
> method with the Page it wishes to add.
>
> So, I will be implementing as said above, and being a newcomer here, I'd
> really love to hear suggestions about this. Please reply!
>
> Cheers!
>
>
> --
>
> Shantanu Tushar    (UTC +0530)
> http://www.shantanutushar.com
>
> On Thu, Jan 13, 2011 at 1:32 PM, Cyrille Berger Skott <cberger at cberger.net
> > wrote:
>
>> Hi,
>>
>> On Thursday 13 January 2011, Shantanu Tushar Jha wrote:
>> > 1. Is the idea of sharing configuration dialog and common configuration
>> > pages sane? I don't have much idea about Calligra's (and hence
>> KOffice's)
>> > history so if this has been already discussed, please point to the ML
>> > thread.
>>
>> We had prior discussion on the subject, see [1]. It is all I could
>> remember.
>> Which lead to some config dialog to be put in libs/main/config see [2].
>> While
>> it allows the widgets to be the same, it still requires editing each
>> individual application.
>>
>> To conclude, yes it is a sane idea and a very wanted project :)
>>
>> > 2. To implement a shared dialog, where is the best place to add the
>> dialog?
>> > Being new to the codebase, lots of classes come to my mind (like
>> > KOApplication, KODocument etc) so I need a little bit of help here.
>>
>> I guess all depends how much time you are willing to invest in this. If
>> you
>> only have time for the autosave configuration, the quickest road is to add
>> a
>> widget to libs/main/config, and make all application use that. However, if
>> you
>> want to invest yourself more in the subject, and create a setting dialog
>> that
>> would allow "calligra-wide" configuration option as well as "application-
>> specific". I have outlined a possible solution in [3], the use of KCModule
>> [4]
>> would allow to move the settings to plugins.
>>
>> However, while I think it is an ideal solution, an intermediary solution
>> would
>> be to have a KoSettingsDialog inheriting KPageDialog, with a set of
>> predefined
>> pages, that can be extended by application for their own settings. The
>> location of that dialog should be in libs/main, and it should probably be
>> called from KoView. And I guess application specific pages could be
>> created by
>> adding a KoView::createPreferencesPage returning a list of
>> KPageWidgetItem*.
>>
>> [1] http://lists.kde.org/?l=koffice-devel&m=124932729205268&w=2
>> [2] http://gitweb.kde.org/calligra.git/tree/HEAD:/libs/main/config
>> [3] http://lists.kde.org/?l=koffice-devel&m=124937404927580&w=2
>> [4]
>> http://api.kde.org/4.x-api/kdelibs-apidocs/kdeui/html/classKCModule.html
>> --
>> Cyrille Berger Skott
>> _______________________________________________
>> calligra-devel mailing list
>> calligra-devel at kde.org
>> https://mail.kde.org/mailman/listinfo/calligra-devel
>>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20110115/6c5429ae/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: configuration-dialog.diff
Type: text/x-diff
Size: 14724 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20110115/6c5429ae/attachment.diff>


More information about the calligra-devel mailing list