[Kde-imaging] ImageCollection or Browser

Renchi Raju renchi at pooh.tam.uiuc.edu
Thu Jun 24 13:21:29 CEST 2004



On Thu, 24 Jun 2004, Aurélien Gâteau wrote:

> Le mercredi 23 Juin 2004 21:34, vous avez écrit :
> > | It seems we need "selection only" plugins. That is plugins which should
> > | only be enabled if images are selected. I suggest the following:
> > | - Add a slot named Interface::slotSelectionChanged() and a KIPI feature
> > | named SelectionOnlyPlugin.
> > | - The host app should call Interface::slotSelectionChanged() when the
> > | selection changes.
> > | - slotSelectionChanged() should loop on all plugins with the
> > | SelectionOnlyPlugin feature and disable or enable them if there is a
> > | selection.
> >
> > The host application already do emit signals, among these
> > selectionChanged( bool hasSelection );
> >
> > Wouldn't it be better to connect it to such signals?
>
> So maybe it can be fixed from within the plugin this way:
>
> // Plugin constructor
> MySelectionPlugin::MySelectionPlugin(KIPI::Interface* interface) {
>    connect(interface, SIGNAL(selectionChanged(bool)),
>    _mySelectionOnlyAction, SLOT(setEnabled(bool)) );
> }
>
> What do you think about this? I think it should solve your problem Renchi.

this is how we used to do things in the old digikamplugins. and this will
work. plugin always knows best about its own actions and should be the one
to enable/disable its actions.

but the real question is about currentScope() vs
currentAlbum()/currentSelection(). my issues with currentScope are:

a) unless a plugin makes sure to disable/enable plugins similar to what
you just mentioned, there is a danger that a selection_only plugin might
act on all images
b) some plugins want to act on either the selection or all, based on a
query result from the user. with currentscope you can't do that.

so i would recommend that currentScope be removed in favor of the other
two.

renchi


More information about the Kde-imaging mailing list