[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Extending KoTextEditingPlugin
From:       Thomas Zander <zander () kde ! org>
Date:       2007-06-30 5:58:45
Message-ID: 200706300758.49413.zander () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Friday 29 June 2007 17:12:23 Fredy Yanardi wrote:
> Hello all!
>
> I'm thinking of extending the KoTextEditing plugin to provide better
> user interaction by:
>
> 1. Adding a submenu to the PluginHelperAction. Since the
> PluginHelperAction inherits QAction, we can easily add a submenu via
> setMenu(). The menu itself must provided by the plugin factory and
> passed to the PluginHelperAction. The factory is also responsible for
> passing the menu to the plugin and the plugin will connect every
> action in the menu to its internal state.
> Example of this functionality is the Changecase plugin, if user right
> clicks a selection, the changecase plugin will show 5 submenu,
> uppercase, lowercase, initial caps, sentence case, and toggle case.

I have my doubts about this idea. Your usecase can easilly be solved by 
showing a dialog to ask the user which of the 4 he wants, and any other 
options the plugin could need.
The submenu idea has a big disadvantage in that it doesn't scale. If I 
have a lot of plugins things just get unmanageable. Too many items in the 
context menu, and for apps that want to show the items in their own menu 
it would most probably mean a 3 level deep menu.

Is there a way you can avoid having this? By showing a dialog when the 
user selects the menu item, for example?

> 2. Providing undo for the KoTextEditingPlugin. The plugin will emit a
> signal commandAvailable after it finishes processing the request and
> the command will be added to the TextTool.

This looks fine to me.

> Attached patch shows my idea about the submenu and undo. I'm also
> working on the changecase plugin which uses the submenu and undo. Any
> comments on it?

Apart from the submenu stuff, I think the patch looks good.
-- 
Thomas Zander

[Attachment #5 (application/pgp-signature)]

_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic