NautilusMenuItemDetails not defined in header file

Bug #188288 reported by Oumar Aziz OUATTARA
6
Affects Status Importance Assigned to Milestone
Nautilus
Won't Fix
Medium
nautilus (Ubuntu)
Invalid
Wishlist
Ubuntu Desktop Bugs

Bug Description

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.

I have already made a patch.
Best Regards

Revision history for this message
Oumar Aziz OUATTARA (wattazoum) wrote :
Revision history for this message
Oumar Aziz OUATTARA (wattazoum) wrote :

Here is the associated debdiff.

Revision history for this message
Oumar Aziz OUATTARA (wattazoum) wrote :

I think I can confirm it since a patch is available.

Regards

Changed in nautilus:
status: New → Confirmed
Changed in nautilus:
status: New → Unknown
Changed in nautilus:
status: Unknown → New
Revision history for this message
Sebastien Bacher (seb128) wrote :

Could you mail the nautilus-list to get their comments on the change?

Changed in nautilus:
assignee: nobody → desktop-bugs
importance: Undecided → Wishlist
status: Confirmed → Triaged
Revision history for this message
Oumar Aziz OUATTARA (wattazoum) wrote : Re: [Bug 188288] Re: NautilusMenuItemDetails not defined in header file

2008/2/6, Sebastien Bacher <email address hidden>:
> Could you mail the nautilus-list to get their comments on the change?

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.

I have already made a patch.
Best Regards
</quote>

So basically, Sebastien wanted to know what you think about this bug
and patch before applying it to Ubuntu.
I have attached the same patch to the Gnome Bug .

Gnome bug : http://bugzilla.gnome.org/show_bug.cgi?id=513854
Launchpad bug : https://bugs.launchpad.net/bugs/188288

So basically the patch is just a move of a struct out of the source
*.c file to the header.
There is another struct that is defined in that source file but that
is commented as Private in the header, so I didn't move it.

Longing for your answer ...
Best Regards
Aziz

> --
> NautilusMenuItemDetails not defined in header file
> https://bugs.launchpad.net/bugs/188288
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Oumar Aziz OUATTARA (wattazoum) wrote :

This mail is waiting for an approval cause I am not a member of the list.

Revision history for this message
Oumar Aziz OUATTARA (wattazoum) wrote :

I have subscribed to the list and resend the mail (and I have of course cancel the last one)

Revision history for this message
A. Walton (awalton) wrote :

To be honest, this doesn't seem valid to me. It breaks the whole design of that structure, as it was intended to be opaque to the users of the API. It's a pretty common design pattern used throughout GNOME, specifically in this case to hide the NautilusMenuItemDetails from the consumers, forcing them to use nautilus_menu_item_set_[].

Iis there a reason nautilus_menu_item_set_submenu() won't work? Something like

NautilusMenu *nautilus_menu_mine = nautilus_menu_new ();
NautilusMenuItem *nautilus_menu_item_mine = nautilus_menu_item_new ("NautilusMenuMine::NautilusMenuMine", "My New Nautilus Menu Item", "Yaay", NULL);
nautilus_menu_item_set_submenu (nautilus_menu_item_mine, nautilus_menu_mine);
NautilusMenuItem *sub_menu_item = nautilus_menu_item_new ("NautilusMenuMine::SubMenuItem", "SubMenuItem", "Some More about it", NULL);
nautilus_menu_append_item (nautilus_menu_item, sub_menu_item);

That might be off a bit, but it's the general idea if I'm understanding the code correctly.

Revision history for this message
Oumar Aziz OUATTARA (wattazoum) wrote :

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.
 */

Revision history for this message
Oumar Aziz OUATTARA (wattazoum) wrote :

well
the patch has been rejected by the nautilus-list so , I am closing this bug .

Changed in nautilus:
status: Triaged → Invalid
Changed in nautilus:
status: New → Won't Fix
Changed in nautilus:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.