After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 355488 - support for Actions
support for Actions
Status: RESOLVED OBSOLETE
Product: gnome-menus
Classification: Core
Component: libgnome-menu
git master
Other Linux
: Normal normal
: ---
Assigned To: gnome-menus dummy account
gnome-menus dummy account
Depends on:
Blocks:
 
 
Reported: 2006-09-11 20:24 UTC by William Jon McCann
Modified: 2011-03-20 04:27 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description William Jon McCann 2006-09-11 20:24:59 UTC
It would be nice to have support for .desktop Actions.  We are considering using an Action for screensaver setup (as it is done in KDE).

It isn't very well documented in the current version of the spec but there is a bit more information in older versions:
http://standards.freedesktop.org/desktop-entry-spec/0.9.3/ar01s07.html

An example:
http://lists.freedesktop.org/archives/xdg/2006-February/007718.html


Here's one idea:
Add a DesktopEntryType DESKTOP_ENTRY_DESKTOP_ACTION.

gboolean      desktop_entry_has_actions      (DesktopEntry *entry);
GList        *desktop_entry_get_action_names (DesktopEntry *entry);
DesktopEntry *desktop_entry_get_action       (DesktopEntry *entry,
                                              const char   *action_name);

Where an action is basically a child Entry.

I suppose it is a separate question whether these action entries should be added to the "all-entries" set before processing menu rules.

What do you think?
Comment 1 Vincent Untz 2006-09-11 21:28:08 UTC
Some comments:

 + the Actions part of the desktop spec will be removed for the 1.0 version. It will be added later. Just FYI, it shouldn't be a problem.

 + I agree about the need of this somewhere

 + I'm not sure adding lots of stuff to parse entire .desktop files in gnome-menus is a good idea. Sounds to me that we should have somewhere in the stack a GObject/structure (more high-level than GKeyFile) to handle desktop files, and gnome-menus would then give you this. gnome-menus is not the best place for this, IMHO.
Comment 2 William Jon McCann 2006-09-11 21:43:04 UTC
Can you please explain why gnome-menus isn't a good place to have .desktop parsing?  Why should I have to link to another library just to get desktop file parsing that gnome-menus already does?  Please keep in mind that I'm not willing to link to gnome-vfs from the g-s daemon.
Comment 3 Vincent Untz 2006-09-11 21:50:38 UTC
(In reply to comment #2)
> Can you please explain why gnome-menus isn't a good place to have .desktop
> parsing?

Because some apps use .desktop files while not using menus.

> Why should I have to link to another library just to get desktop file
> parsing that gnome-menus already does?  Please keep in mind that I'm not
> willing to link to gnome-vfs from the g-s daemon.

I'm not saying this should live in yet another library. Maybe we could convince glib people to integrate this.
Comment 4 William Jon McCann 2006-09-12 14:30:50 UTC
Yeah, I guess that makes sense as long as it moves lower in the stack and not higher.  But if we're going that direction then doesn't it makes sense to move the menu functionality there along with it?

I think the problem is that DesktopEntry is tuned for memory usage.  It isn't a general purpose .desktop file parsing API and I'm not asking that it should be.  And I don't think you'll be able to make gnome-menus use a more generic parsing API because it will use too much memory needlessly (due to caching unused key/values).

My point is that, from my reading, actions are essentially new .desktop entries (related the the parent) and as such may need to be included in the menus.

So someone separate from that, for my specific usage, in gnome-screensaver gs-theme-manager used by gnome-screensaver-preferences I'd like to be able to do the following without doing IO:

info->has_setup = gmenu_tree_entry_has_action (entry, "Setup");

And then based on that info->has_setup value I'll either show a button/menu-item to configure or not.

At that point I think it is fine to hit the disk when doing the equivalent of:
action_entry = gmenu_tree_entry_get_action (entry, "Setup");