← Back to team overview

desktop-packages team mailing list archive

[Bug 499754] Re: I can not edit menu entries in alacarte at random - Ubuntu Lucid (10.04)

 

I'm still running Ubuntu 10.04 LTS with GNOME 2.30 at this late date and
just encountered this problem after installing LibreOffice 4.3.5, using
a DEB archive obtained from LibreOffice.org.  I didn't like the way the
installer put the entries in the Applications menu and began editing the
menu with alacarte (System -> Preferences - > Main Menu).  During this
edit I made a mistake, deleting a menu item, so I clicked on the
"Revert" button, after which havoc ensued.  A number of custom sub-menus
changed from their original names to "alacarte-made-x", where "x" was
some number, and those entries became non-editable.  The problem appears
to have been caused by alacarte improperly deleting one or more of its
.directory files in /home/<user>/.local/share/desktop-directories and
*possibly* by the LibreOffice installation causing additional
corruption.  I was able to recover by using the following steps.

1. In a terminal window in my home directory, I executed
   sudo chown -R <user> .config/menus
   sudo chown -R <user> .local

   (Substitute your user name for <user>.)  This fixes improper file
ownership issues.  Some of the alacarte-made non-editable menu entries
now became accessible with the Properties button, but several  menus
became cross-linked, so that when the name of one menu was changed in
the menu editor, the name of another, completely unrelated menu also
changed.

2. I looked in my .config/menus directory to find an "undo" .menu file
with a time stamp just after the new package was installed.  This was
easy, because the file with LibreOffice 4.3.5 had entries containing
"4.3.5" that could be found with a text editor.  I renamed
applications.menu as applications.menu.bak, then copied my chosen .menu
.undo-xx file to applications.menu.

3. The first two steps still didn't fully correct the problem, but by
looking in .local/share/desktop-directories and examining the contents
of the various .directory files and comparing what alacarte-made-x
entries there were displayed in my Applications Menu.  From this I was
able to deduce which .directory files were missing and using gedit I was
able to recreate them, using the existing .directory files as a
template.  Once the missing alacarte-made-x.directory files were
restored, the cross-linking of submenu entries in the Applications menu
was fixed, allowing all submenus and items to be edited normally again
with the Properties button.

A more drastic alternative would have been to wipe out the contents of
.local/share/desktop-directories and .config/menus and start over, but a
bit of patience in performing manual repairs as described above saved me
many, many hours of menu creation and customizing.

I think this may not be a bug in alacarte as such, but a general lack of
robustness in the GNOME 2 menu and the design of alacarte, in that
alacarte is unable to detect corruption in the menu files or missing
directory files, and simply gets confused.  The utility should have
automatic error detection and correction built in, or a button or menu
that can be invoked manually by the user to repair the menu structure
when something goes amiss.  There may also be problems with the way the
Revert feature works in alacarte, which *may* have been the cause of the
problem in this instance.

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to alacarte in Ubuntu.
https://bugs.launchpad.net/bugs/499754

Title:
  I can not edit menu entries in alacarte at random - Ubuntu Lucid
  (10.04)

Status in alacarte package in Ubuntu:
  Expired

Bug description:
  Binary package hint: alacarte

  Hello,
  Sometimes I am unable to edit a menu entry in alacarte, but sometimes I can. If I click on the properties button for the menu entries, it sometimes fails to open, however, If I continue to click on the properties button to other random menu entries, I will be able to edit the one I want to edit eventually. It seems that when I repeatedly click on the same properties button that failed to open, it makes the problem worse. This applies to Ubuntu Lucid Alpha 1.

  Running alacarte in the terminal provides this output as soon as a
  properties button fails to open:

  james@Lucid:~$ alacarte
  Traceback (most recent call last):
    File "/usr/lib/pymodules/python2.6/Alacarte/MainWindow.py", line 625, in on_properties_button_clicked
      self.on_edit_properties_activate(None)
    File "/usr/lib/pymodules/python2.6/Alacarte/MainWindow.py", line 377, in on_edit_properties_activate
      self.editor._MenuEditor__addUndo([(file_type, os.path.split(file_path)[1]),])
    File "/usr/lib/pymodules/python2.6/Alacarte/MenuEditor.py", line 428, in __addUndo
      undo_path = util.getUniqueUndoFile(file_path)
    File "/usr/lib/pymodules/python2.6/Alacarte/util.py", line 109, in getUniqueUndoFile
      filename, extension = os.path.split(filepath)[1].rsplit('.', 1)
  ValueError: need more than 1 value to unpack

  
  james@Lucid:~$ lsb_release -rd
  Description:	Ubuntu lucid (development branch)
  Release:	10.04

  apt-cache policy alacarte
  alacarte:
    Installed: 0.12.4-1ubuntu1
    Candidate: 0.12.4-1ubuntu1
    Version table:
   *** 0.12.4-1ubuntu1 0
          500 http://mirror.anl.gov lucid/main Packages
          100 /var/lib/dpkg/status

  james@Lucid:~$ apt-cache show alacarte
  Package: alacarte
  Priority: optional
  Section: utils
  Installed-Size: 1332
  Maintainer: Ubuntu Desktop Team <ubuntu-desktop@xxxxxxxxxxxxxxxx>
  Original-Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@xxxxxxxxxxxxxxxxxxxxxxx>
  Architecture: all
  Version: 0.12.4-1ubuntu1
  Replaces: smeg
  Provides: smeg
  Depends: python (>= 2.4), python-support (>= 0.90.0), python-gtk2 (>= 2.13.0), python-gmenu (>= 2.27.92), gnome-menus (>= 2.27.92), python-gobject (>= 2.15.1)
  Recommends: gnome-panel
  Conflicts: smeg (<< 0.8-0ubuntu1)
  Filename: pool/main/a/alacarte/alacarte_0.12.4-1ubuntu1_all.deb
  Size: 58004
  MD5sum: a69323948d770f6b47f104adc1c3586c
  SHA1: 50a5372e001097d6ef8a4ba1d23fa83bd51ff84b
  SHA256: c8eea88df662e7e71e3ad96fd6c97db26ce55c2e4e491b1f66506c2dd3c6c184
  Description: easy GNOME menu editing tool
   Alacarte is an easy-to-use menu editor for GNOME that can add
   and edit new entries and menus. It works with the freedesktop.org
   menu specification and should work with any desktop environment
   that uses the spec.
  Python-Version: 2.6
  Bugs: https://bugs.launchpad.net/ubuntu/+filebug
  Origin: Ubuntu
  Task: ubuntu-desktop, edubuntu-desktop, xubuntu-desktop, mythbuntu-backend-master, mythbuntu-backend-slave, mythbuntu-desktop, mythbuntu-frontend, ubuntu-netbook

  ProblemType: Bug
  Architecture: i386
  Date: Wed Dec 23 03:44:09 2009
  DistroRelease: Ubuntu 10.04
  InstallationMedia: Ubuntu 10.04 "Lucid Lynx" - Alpha i386 (20091209)
  NonfreeKernelModules: nvidia
  Package: alacarte 0.12.4-1ubuntu1
  PackageArchitecture: all
  ProcEnviron:
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  ProcVersionSignature: Ubuntu 2.6.32-7.10-generic
  SourcePackage: alacarte
  Tags: lucid
  Uname: Linux 2.6.32-7-generic i686

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/alacarte/+bug/499754/+subscriptions