Re: [Gimp-developer] where to put widgets for plugins

2009-07-12 Thread Martin Nordholts
On 07/12/2009 04:53 AM, Roman Joost wrote:
 On Sat, Jul 11, 2009 at 08:33:11AM +0200, Martin Nordholts wrote:

 On 07/11/2009 08:23 AM, Roman Joost wrote:
  
 Hi,

 I wonder where I can put and compile a widget I've written for the
 metadata browser. [...]

 Since we don't want the libgimpwidgets to depend on the metadata
 plug-in, you should put the widget along with the metadata plug-in
 source. That the metadata plug-in will depend on a UI library is not a
 problem. If we can avoid extending our plug-in API we should do that.
  
 Thank you!

 Not beeing to fuzzy here, but do I need to follow a directory structure?
 Say, all the widgets - it's currently just one - should be placed into a
 subdirectory widgets.


No that's not necessary, there are not that many files in total and 
everything will compiled to a single binary anyway

  / Martin

___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


[Gimp-developer] meta-data browser: EntryWidget + treemodel = chicken/egg problem

2009-07-12 Thread Roman Joost
Hi folks,

I pimped an GtkEntry widget for the metadata editor - thanks to Sven for
his help.

the problem:

 The XMP metadata is stored in a treemodel. The metadata browser has
 currently two notebook panes where the user can enter data: the
 description tab for title, author, description and the advanced tab
 which is a view onto that treemodel.

 If I type in the title in the description tab, the change is reflected
 in the treemodel therefore also visible in the advanced tab. If I
 change values in the advanced tab I was not able to e.g. update the
 title entry widget.

my possible solution:

 My GtkEntry is instantiated with the xmp_model (read treemodel), the
 schema uri (e.g. http://purl.org/dc/elements/1.1/) and the property
 name (e.g. title). I subscribe to the 'row-changed' signal of the
 treemodel (now maybe that's my first mistake), as well as the entry
 changed signal (maybe another mistake).
 During initialisation nothing is written to the model and my entry
 widget is not emitting any signals.

 When I enter the first characters in the entry, the following happens:

1. the schema is set (row-changed signal is emitted)
2. the property *value* is set (another row-changed signal)

 That raises actually to a big problem, because when I populate two
 of my Entry widgets in the browser I get a pingpong going on between
 the Entries. Funny, but not usable.

Is it possible to subscribe to a row-changed event by also using a
GtkTreePath as some kind of selector? The problem is, that on
instantiation time, I don't have a value set in the treestore, therefore
also no path :( Maybe using the treestore as a view (model) as well as a
data (model) is another problem here.

I also thought about changing the xmp-model to emit custom signals, like
a 'property changed' event, which uses the schema_uri and the property
as an identifier. I can't really see that solving my problem here
though.

Additionally, I've read the GtkEntry and GtkCellView source code for any
additional information. The GtkCellView is storing the model in a
private (need to read what this is about) and a it is using a reference
for the row. Maybe that's something I should try...

Any help or pointers to documentation or source code would be very much
appreciated!

Cheers,
-- 
Roman Joost
www: http://www.romanofski.de
email: romanof...@gimp.org


signature.asc
Description: Digital signature
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] API for bringing up a Save dialog

2009-07-12 Thread Joao S. O. Bueno
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


Re: [Gimp-developer] API for bringing up a Save dialog

2009-07-12 Thread Joao S. O. Bueno
k!!

The E-mail client is showing me unread messages from months ago as if they 
where New  :-(
Sorry for digging into this ancient thread.  :-(  


js
--

___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer