On Friday 29 May 2009, Martin Nordholts wrote: > Akkana Peck wrote: > > I'd like a way of bringing up a Save-as or Export-as dialog > > from a Python script. There's no API for this currently, as far > > as I can tell. > > The Save and Export dialogs are rather tightly coupled to the core > currently so it will not be trivial to extend the plug-in API to show > and interact these dialogs but I would not reject patches that > implemented it properly. > > > Would be be possible to add an API for this, or maybe an optional > > argument in gimp_file_save and the corresponding _export function? > > IMO we should not reuse gimp_file_save() for this but instead introduce > gimp_show_save_dialog() and gimp_show_export_dialog(). I am a bit > worried however that plug-ins will abuse this power. In your case, why > do you need to show these dialogs? Isn't it better if the user has to go > through a single place to save or export?
Certainly not -- the idea of plug-ins is to automate workflows! And a common enoguh use case is to save a modified copy of an image - or a series of images with diferences between them (although this would need a folder + file name pattern rther than =justa file path). Akkana: I've never missed callign the save or export dialogs because I normally use the PF_FILE and PF_DIRECTORY entry parameters for my plug-ins taht deal with file export. Aren't they (with gimp_file_save) enough for your use case? > > In the new framework, will gimp_file_save() fail if the filename isn't > > xcf? > > No, the existing API needs to be backwards compatible so even though it > is unfortunate that _save() can be used to export, we need to allow that > for the sake of backwards compatibility. > > / Martin js -><-
_______________________________________________ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer