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

Bug #499754 reported by ankspo71
72
This bug affects 13 people
Affects Status Importance Assigned to Milestone
alacarte (Ubuntu)
Expired
Low
Unassigned

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 <email address hidden>
Original-Maintainer: Debian GNOME Maintainers <email address hidden>
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

Revision history for this message
ankspo71 (jamesb-71) wrote :
Revision history for this message
Antti Kaihola (akaihola) wrote :

On my Lucid Alpha 1 (clean install, up-to-date as of today) I can't find any menu items which would trigger the described error messages.

ankspo71, was this a fresh install or an upgrade?

You could take a look at /usr/share/desktop-directories and ~/.local/share/desktop-directories/ and verify that they contain files with the .directory extension.

Do you get the exception also when trying to open properties of a launcher (not a folder)? If so, the exception should be a bit different.

You could add the statement:
    print file_path
above line 377 (and indented similarly to the surrounding lines) of /usr/lib/pymodules/python2.6/Alacarte/MainWindow.py and see what file paths Alacarte prints out when you click on the "Properties" button. It looks like some of the file names lack an extension and cause the exception you described.

Revision history for this message
ankspo71 (jamesb-71) wrote :

Hi Antti Kaihola,
This is a clean install of Lucid Alpha 1 (i386) with no updates applied (I'm avoiding a partial upgrade) but with some various applications installed. All directory files do end in the .directory extension.

However, you have helped me find the problem. None of the applications (except for the ones I have added entries for) have the *.desktop extension in the folder ~/.local/share/applications .

$$$ ls /home/james/.local/share/applications
alacarte-made-1.desktop
alacarte-made.desktop
brasero
cgmail
defaults.list
empathy
evolution
evolution-mail
firefox
foobillard
f-spot
gcalctool
gimp
gnome-search-tool
Google-googleearth.desktop
lastfm
mimeapps.list
mimeinfo.cache
miro
openoffice.org-draw
sun-java6-javaws
thunderbird
Track Mania Nations For Ever.desktop
transmission
tsclient
ubuntuone-client-applet
userapp-sh-UTV15U.desktop
vinagre
wine
wine-browsedrive
wine-extension-chm.desktop
wine-extension-gbx.desktop
wine-extension-hlp.desktop
wine-extension-htm.desktop
wine-extension-html.desktop
wine-extension-ini.desktop
wine-extension-rtf.desktop
wine-extension-txt.desktop
wine-extension-wri.desktop
wine-extension-xml.desktop
xsane

Changing the ' firefox ' file to ' firefox.desktop ' allows me to change the property values of firefox in alacarte.

On the other hand, every file in the /usr/share/applications folder does have a *.desktop extension.

Whatever it is that is responsible for creating *.desktop extensions is failing to do so during ubuntu installation, and while using apt-get. I used command line apt-get to install my favorite applications from the ubuntu repositories. I have a few applications listed there that I have installed using another method... " sh GoogleEarthLinux.run " for example.

So it looks like I will have to rename each file (application entry) in the ls /home/james/.local/share/applications directory to ****.desktop if I want to edit them in alacarte.
Thanks.

Revision history for this message
ankspo71 (jamesb-71) wrote :

Just noting that this bug also has duplicates: Bug #497931, Bug #505673

Revision history for this message
ankspo71 (jamesb-71) wrote :

Bad typo: (except for the ones I have added entries for) = (except for the ones that had their own installers eg: googleearth)

Revision history for this message
ankspo71 (jamesb-71) wrote :

I managed to fix it. I downloaded a new alacarte source package and compiled the source code myself. I can now edit any menu entry in alacarte.

If anyone needs to fix alacarte in Ubuntu Lucid (alpha 1) (gnome-desktop), because you are unable to edit the entries in the gnome menu, see below.

I got alacarte from gnome 2.29.4 - alacarte version 0.12.4 found here:
http://www.icewalkers.com/download/GNOME/1075/dld/

I think the dependencies were intltool and libgnome-menu-dev
(when you run ./configure it will tell you)

./configure
make
sudo make install

you might need to reboot the system, if not log out and back in again.

Also, I was advised that *.desktop files are not present in the ~/.local/share/applications folder by default, so I am mistaken about that part in my earlier post.

Probable Bug Solution:
I think alacarte needs to be recompiled for i386 desktop (Lucid alpha 1) before alpha 2 is released.
Thanks,

Changed in alacarte (Ubuntu):
importance: Undecided → Low
Revision history for this message
SabreWolfy (sabrewolfy) wrote :

Low importance? Why? How do I edit menus in Lucid? Selecting "Edit Menus" does nothing.

Revision history for this message
Pedro Villavicencio (pedro) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. The issue that you reported is one that should be reproducible with the live environment of the Desktop CD of the development release - Oneiric Ocelot. It would help us greatly if you could test with it so we can work on getting it fixed in the next release of Ubuntu. You can find out more about the development release at http://www.ubuntu.com/testing/ . Thanks again and we appreciate your help.

Changed in alacarte (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for alacarte (Ubuntu) because there has been no activity for 60 days.]

Changed in alacarte (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Andrew P. (japoth) wrote :
Download full text (3.2 KiB)

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

Read more...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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