Re: NautilusMenuItemDetails not defined in header file



2008/2/6, Alexander Larsson <alexl redhat com>:
>
> On Wed, 2008-02-06 at 13:35 +0100, Ouattara Oumar Aziz wrote:
> > Hello dear Nautilus masters :-)
> >
> > I have recently opened a bug on Launchpad and Gnome Bug tracker which
> > is more a code organization issue than an improvement.
> >
> > Here is the description of the bug :
> > <quote>
> > Hello,
> >
> > I wanted to patch nautilus-action to add submenu support to it and I
> > noticed that the struct _NautilusMenuItemDetails is not available in any
> > of the nautilus extension headers. A search on the web showed me that it
> > has been defined in the nautilus-menu-item.c source file. So we need to
> > move it from this file to the header file. Otherwise it's not possible
> > to use this struct in an external code.
> >
>
> Eh, that is the private implementation details of the class. It is in a
> separate struct for the exact purpose of not exporting that to other
> code.
>
> There should be no need for it. Everything that you need should be
> availible via GObject properties.
>
>

Well, actually, the piece of code that you gave works fine and well.
But in my case, i wanted to get the label of the NautilusMenuItem, and
I didn't find a way to do this. There is AFAIK no way to get the
details of a menu once it's set. If there is, this is the solution I
am looking for and there is no need for this patch.
But then, maybe the header should be documented concerning this matter.

One other point that made me thinks this was a bug was this comment
(in the nautilus-menu.h file).
So the developer want the user to know what is in the MenuItem, but I
didn't find any obvious way to get them once set.

/* NautilusMenuItem has the following properties:
 *   name (string)        - the identifier for the menu item
 *   label (string)       - the user-visible label of the menu item
 *   tip (string)         - the tooltip of the menu item
 *   icon (string)        - the name of the icon to display in the menu item
 *   sensitive (boolean)  - whether the menu item is sensitive or not
 *   priority (boolean)   - used for toolbar items, whether to show priority
 *                          text.
 *   menu (NautilusMenu)  - The menu belonging to this item. May be null.
 */

Maybe the GObject properties thing is the solution , but I don't know
it at all :-p


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