alacarte menu editor: new item, new menu bug

Bug #1089438 reported by lordamit on 2012-12-12
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
alacarte (Ubuntu)
Undecided
Unassigned

Bug Description

I have installed alacarte in Lubuntu 12.10
After installing, I noticed that it does not work properly, that is - can not be used properly to insert new item, new menu etc.

I opened it using terminal and found the following trace when tried to add new menu:

Traceback (most recent call last):
  File "/usr/share/alacarte/Alacarte/MainWindow.py", line 267, in on_new_menu_button_clicked
    process = subprocess.Popen(['gnome-desktop-item-edit', file_path], env=os.environ)
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1259, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

For new item

Traceback (most recent call last):
  File "/usr/share/alacarte/Alacarte/MainWindow.py", line 283, in on_new_item_button_clicked
    process = subprocess.Popen(['gnome-desktop-item-edit', file_path], env=os.environ)
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1259, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Output of lsb_release -rd

Description: Ubuntu 12.10
Release: 12.10

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: alacarte 3.5.5-0ubuntu1.1
ProcVersionSignature: Ubuntu 3.5.0-19.30-generic 3.5.7
Uname: Linux 3.5.0-19-generic x86_64
ApportVersion: 2.6.1-0ubuntu6
Architecture: amd64
Date: Wed Dec 12 21:29:24 2012
InstallationDate: Installed on 2012-12-08 (3 days ago)
InstallationMedia: Lubuntu 12.10 "Quantal Quetzal" - Release amd64 (20121017.1)
MarkForUpload: True
PackageArchitecture: all
SourcePackage: alacarte
UpgradeStatus: No upgrade log present (probably fresh install)

lordamit (lordamit) wrote :
lordamit (lordamit) wrote :

I have found the solution after a bit of digging around.
For some reason, it is considering itself something other than XDG_CURRENT_DESKTOP - hence trying to invoke gnome-desktop-item-edit.
However, it is a command related to gnome-panel. So I changed the command to exo-desktop-item-edit like this:

if os.getenv("XDG_CURRENT_DESKTOP") == "XFCE":
            process = subprocess.Popen(['exo-desktop-item-edit', file_path], env=os.environ)
        else:
            process = subprocess.Popen(['exo-desktop-item-edit', file_path], env=os.environ)
        GObject.timeout_add(100, self.waitForNewMenuProcess, process, parent.get_menu_id(), file_path)

This is to be done for both new menu and new item function. The file is at

/usr/share/alacarte/Alacarte/MainWindow.py

And everything started working in alacarte. I have also attached the changed MainWindow.py file as a patch with this post.

Thank you.

lordamit (lordamit) wrote :

I have attached the patched version of MainWindow.py file. You can directly use it to replace your existing MainWindow.py file. Of course, keep proper backup of your old file before replacing - in case things go wrong.

lordamit (lordamit) wrote :

Looks like editing property also does not work properly for similar reasons. The fix is similar. In the function
on_edit_properties_activate
Change the gnome-desktop-item-edit to exo-desktop-item-edit

Thanks.

The attachment "Patched MainWindow.py file for Alacarte." of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
lordamit (lordamit) wrote :

I have improved the patch. Instead of being stuck between XFCE and Others - it now checks whether the desktop environment is LXDE as well.

        if os.getenv("XDG_CURRENT_DESKTOP") == "XFCE":
                process = subprocess.Popen(['exo-desktop-item-edit', file_path], env=os.environ)
        elif os.getenv("XDG_CURRENT_DESKTOP") == "LXDE":
                process = subprocess.Popen(['exo-desktop-item-edit', file_path], env=os.environ)
        else:
                process = subprocess.Popen(['gnome-desktop-item-edit', file_path], env=os.environ)
        GObject.timeout_add(100, self.waitForNewMenuProcess, process, parent.get_menu_id(), file_path)

It has been applied to

1. New Item
2. New Menu Item
3. Edit Properties
Same instructions, make a backup of /usr/share/alacarte/Alacarte/MainWindow.py and then replace it with the patch.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in alacarte (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers