Re: release notes: menu editing (no flames please)



I have put together some notes on menu-editing for both
gnome-panel-2.0.0 and gnome-panel-2.0.1.

These are attached (no ftp access at work)

I will be putiing them on my site tonight at 

http://www.redtux.demon.co.uk/docs/ 

Notes are not perfect but they work as of all latest packages last night.

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
Very basic notes on menu editing in Gnome2

This has been a problematic issue in gnome 2 leading to its complete removal between Gnome2 RC1 (gnome-panel-2.0.0) and gnome-panel-2.0.1 which will probably be the version in Gnome2 final.

So if you want to have panel based menu editing you will need to have gnome-panel version 2.0.0, all other packages should be fine.

The oustanding problem is dealing with gnome 1.4 desktop files.

The current spec for .desktop files depends on a Categories line in the file
Eg: Categories=Application;Network  for galeon etc

In gnome 1.4 this information was provided by the sub-directory that the desktop file was in ie: for galeon the file was in
Data directory/Network

In gnome2 there is a file called /etc/gnome-vfs-2.0/vfolders/application.vfolder.info (if gnome is built in a different directory prefix that to /etc), which is copied to $Home/.gnome2/vfolders when a succesful edit takes place.

The structure of this file is fairly simple

<!-- Merge dirs optional -->
  <MergeDir>/etc/X11/applnk/</MergeDir>
  <MergeDir>@datadir@/gnome/apps/</MergeDir>

  <!-- Merges in the main GNOME menus if you build into a non-default prefix -->
  <MergeDir>/usr/share/gnome/apps/</MergeDir>

  <!-- Control Center Merge Directories -->
  <MergeDir>@datadir@/control-center-2.0/capplets/</MergeDir>
  <MergeDir>@datadir@/gnome/capplets/</MergeDir>

  <DesktopDir>@datadir@/gnome/vfolders/</DesktopDir>

starts off with a list of directories to look in for .desktop files

<!-- Root folder -->
  <Folder>
    <Name>Applications</Name>
    <Desktop>Applications.directory</Desktop>
    <Exclude>gnome-search-tool.desktop</Exclude>

    <Query>
      <And>
        <Keyword>Core</Keyword>
	<Not>
	  <Keyword>Merged</Keyword>
        </Not>
      </And>
    </Query>

Then has a header entry defining the root menu followed by entries for each menu category eg: applications

<!-- Accesories -->
    <Folder>
      <Name>Accesories</Name> #name of menu category
      <Desktop>Accessories.directory</Desktop># in prefix/share/gnome/vfolders
      <Query>
	<And>
	  <Keyword>Application</Keyword>#words to look for all words in <AND>
	  <Keyword>Utility</Keyword>    # have to be in the file
	  <Not>
	    <Keyword>System</Keyword> #cannot be in the file
	  </Not>
	</And>
      </Query>
      <DontShowIfEmpty/>
    </Folder>

additional keywords can be added inside Or  brackets
These keywords which appear in the Categories line in gnome2.desktop files determine where a menu entry appears.
Easy editing (only applies to apps that generate good .desktop files, and not at all to gnome-panel-2.0.1)

To add menu item

Click on applications menu, move mouse to any item, right click, move mouse to entire menu , right click again, choose add new item

Fill in properties window as required

To delete menu item

Click on applications menu, move mouse to any item, right click, move mouse to entire menu , right click again, choose remove item

Fill in properties window as required

To add menu item

Click on applications menu, move mouse to any item, right click, move mouse to entire menu , choose properties

Fill in properties window as required

To move menu items

Open Nautilus

Find item you want to move to a different category, copy, move to directory entry where you want it to go, paste it.

Nautilus is liable to freeze but it works.

Hard(er) way but fullproof

Cp appropriate desktop file to your ~/.gnome2/applications/directory (or for a new one choose an appropriate file as a model)
Edit the file for 
Name=(descriptive name)
Type=application
Exec=(command)
Categories=Application;then other keywords from your ~/.gnome2/vfolders/application.vfolder.info

Works on all applications

Adding modifying new categories

Edit ~/.gnome2/vfolders/application.vfolder.info to taste following style of file
(submenus created by nesting subfolders)

If you create a new category, create a new .directory file to match, primary location $prefix/share/vfolders/, use existing one as a model. 

If you try to add,edit any old app menu item from the menu editor it will dissappear until you add the Categories field.

This works all the time, so if you to edit menus in gnome2, this is how you do it, even if it seems a bit hacky.



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