[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice-devel
Subject: Re: Extending KoTextEditingPlugin
From: "Fredy Yanardi" <fyanardi () gmail ! com>
Date: 2007-06-30 18:20:54
Message-ID: 1ec1a3270706301120j6cdf0c18p837ee759d0a88ff9 () mail ! gmail ! com
[Download RAW message or body]
On 6/30/07, Thomas Zander <zander@kde.org> wrote:
> 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?
Yes, I think the menu can be avoided actually by showing a dialog, I
was trying to do that partly just because I think it can be done. But
you're right, it would create a mess in the pop up menu ;)
> > 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.
Ok, I just commited it.
Thanks,
Fredy Yanardi
_______________________________________________
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