On Fri, 2009-05-29 at 16:02 -0700, Akkana Peck wrote:
> Sven Neumann writes:
> > On Fri, 2009-05-29 at 10:18 -0700, Akkana Peck wrote:
> > > I need to show the dialogs because the plug-in needs to save a
> > > file (that's the whole point of the plug-in) and it seems like
> > > bad UI to pop up the JPEG save dialog without ever showing the
> > > user where the file is being saved, or offering them a chance
> > > to save it somewhere else.
> > Then please add a sane user interface to your plug-in and pop up a
> > file-chooser. The PDB was designed to allow plug-ins and scripts to call
> > procedures in GIMP, not to pop up specific user interface elements. It
> > is totally not suited for this kind of usage.
> I'm confused -- you say I should pop up a file chooser, then you
> say that's not what the PDB is for. Is there a non-PDB way to do
> this from a plug-in?
Yes, use the GtkFileChooserDialog. GTK+ is part of the GIMP plug-in API,
so that is available to you.
> Popping up a file chooser is exactly what I'm trying to do.
> But I'd ideally like it to be the gimp file chooser with the image
> file types, not a generic GTK file chooser (just for consistency,
> because the GIMP dialog is what the user expects to see elsewhere
> in gimp). That's why I was asking for an API to do that.
The PDB is the wrong place for such an API though. It is not meant to
provide user interfaces to plug-ins. The fact that it allows to call
plug-in procedures in interactive run-mode is just due to the fact that
the core uses the PDB to start a plug-in the user has selected in the
menus. Core procedures don't expose this functionality and they
Gimp-developer mailing list