Re: pluggable context menus ...



On Sat, 2002-10-26 at 08:56, Michael Meeks wrote:
> Hi James,
> 
> On Sat, 2002-10-26 at 08:48, James Willcox wrote:
> > Um, that last patch was brain damaged.  This one is better, I promise :)
> 
> 	Ok - it looks nice; there are a few bits that need cleaning up, but the
> feature looks great to me :-)
> 
> 	Firstly: instead of duplicating the verbs we should use:
> 
> BonoboUINode *node = bonobo_ui_util_new_ui (same args as add_ui);
> 
> 	...
> 
> 	In the ... we need to do something like:
> 
> 	BonoboUINode *l;
> 
> 	for (l = node; l; l = bonobo_ui_node_next (l)) {
> 		BonoboUINode *l2;
> 
> 		if (bonobo_ui_node_has_name ("commands")) {
> 
> 		for (l2 = bonobo_ui_node_children (node);
> 		     l2; l2 = bonobo_ui_node_next (l2)) {
> 			... build the verb stuff here ...
> 		}
> 	}	
> 
> 	bonobo_ui_component_set_tree (component, nodes, etc.);
> 
> 	Of course - quite how we translate these things I don't know; if we
> stored the XML in the .server file we'd have a mechanism; inside a
> separate file, it's more complex; clearly the .po file for the App would
> have the information if it was loaded - but it isn't ;-) Ultimately then
> it might be almost necessary to do the b-a-s work to make verbatim
> embedding of XML fragments easy, to make it i18n-able.

Ok, I am still not seeing the advantage of putting the UI stuff directly
in the .server file.  I am also not sure how the i18n stuff works for UI
files, so maybe that is part of my problem :)  Also, I don't see how we
are duplicating verbs....sorry for being so thick headed :/

> 
> 	Also, a slight problem in:
> 
> +               Bonobo_Listener_event (listener, data->verb,
> +                                      (CORBA_any*)data->uri, &ev);
> 
> 	Sadly you can't do that; you have to do something like (easyish):
> 
> 	BonoboArg *arg;
> 
> 	arg = bonobo_arg_new_from (CORBA_TC_String, path->uri);
> 
> 	pass the arg as a CORBA_any (what it is in fact)
> 
> 	then bonobo_arg_free (arg); [ you also need to
> bonobo_object_release_unref () after a queryInterface :-].
> 

Ah, ok.  Yeah, what I was doing seemed evil, but I wasn't sure what else
to do.

> 	Of course - it seems to me that the selection could be more than 1 item
> - how do you handle that ? it's fairly easy to make a structure up to
> pass to the listener in the Any - indeed, there are types lurking in
> Nautilus to do that; (Nautilus_URIList) eg.

The current patch does not put anything in the popup menu if there is
more than one thing selected.  We could fix this, though, so that it
only pops up actions common to all the selected files.  I think this is
icing on the cake, though.

> 
> 	Overall - an excellent feature; and nice coding - especially the async
> component activation so it's snappy, great to have you hacking on
> Nautilus.

Thanks!

James




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]