Re: pluggable context menus ...
- From: Michael Meeks <michael ximian com>
- To: James Willcox <jwillcox cs indiana edu>
- Cc: Dave Camp <dave ximian com>, Alex Larsson <alexl redhat com>, nautilus-list gnome org
- Subject: Re: pluggable context menus ...
- Date: 26 Oct 2002 14:56:14 +0100
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.
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 :-].
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.
Overall - an excellent feature; and nice coding - especially the async
component activation so it's snappy, great to have you hacking on
Nautilus.
Regards,
Michael;
--
mmeeks gnu org <><, Pseudo Engineer, itinerant idiot
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]