Can't remove some categories from a launcher

Bug #1307002 reported by Pasi Lallinaho
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
MenuLibre
Fix Released
Low
OmegaPhil
menulibre (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

To reproduce:
1) Open MenuLibre
2) Create a new launcher inside the System submenu
3) Save the launcher (the launcher appears in the System submenu)
4) Add another categories for the launcher, eg. Game/Games
5) Save the launcher (the launcher appears in the Games submenu)
6) Remove the System/System category
7) Save the launcher

Expected result:
System/System category is removed and launcher disappears from the System menu

Actual result:
System/System category reappears and launcher is still in the System menu (but not in the Games submenu)

Running Xubuntu 14.04 with MenuLibre 2.0.3-1.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: menulibre 2.0.3-1
ProcVersionSignature: Ubuntu 3.13.0-24.46-generic 3.13.9
Uname: Linux 3.13.0-24-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.14.1-0ubuntu2
Architecture: amd64
CurrentDesktop: XFCE
Date: Sat Apr 12 21:36:10 2014
InstallationDate: Installed on 2011-10-14 (910 days ago)
InstallationMedia: Xubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
PackageArchitecture: all
SourcePackage: menulibre
UpgradeStatus: Upgraded to trusty on 2014-04-12 (0 days ago)

Revision history for this message
Pasi Lallinaho (knome) wrote :
Revision history for this message
Sean Davis (bluesabre) wrote :

Please attach your related menu and desktop files.

~/.config/menus/xfce4-applications.menu

The desktop file will be listed at the bottom of the MenuLibre editor window.

Changed in menulibre:
status: New → Confirmed
Changed in menulibre (Ubuntu):
status: New → Confirmed
Changed in menulibre:
importance: Undecided → High
Revision history for this message
Pasi Lallinaho (knome) wrote :

I can reproduce this bug with the default xfce-applications.menu file shipped with Xubuntu. Attached is the offending .desktop file.

description: updated
Revision history for this message
Sean Davis (bluesabre) wrote :

This functionality is by design (mostly). If a user were to add or move a launcher to a certain category/folder, they would expect it to be installed there. Without the categorization, the launcher would be in the wrong location. Of course, this poses an issue for multiple categories, so I will look into a possible fix for this.

Changed in menulibre:
importance: High → Wishlist
importance: Wishlist → High
Sean Davis (bluesabre)
Changed in menulibre:
importance: High → Low
Revision history for this message
Pasi Lallinaho (knome) wrote :

It seems like the worst offending categories are System and Utility.

Revision history for this message
Si Dedman (si-dedman) wrote :

I think I have the same issue: e.g. xfburn is in multimedia & accessories. If I hide it in accessories it hides it in multimedia. If I remove the archiving>accessories and utilities>accessories categories from the accessories entry, the utilities one reappears upon save. If I delete it, it reappears with both intact. It feels like something else has priority control over the changes...

Revision history for this message
OmegaPhil (omegaphil) wrote :

bluesabre, originally I PM'd you with this on 29.04.17 but haven't had a response - reviewing tasks atm so reposting it here:

[19:26:37] <OmegaPhil> Hmm. I have a mostly-working 'required category' removal capability atm, however it might be a challenge to get the UI to update to reflect the fact that the launcher should no longer appear in the current directory
[19:27:52] <OmegaPhil> I'm looking at MenulibreTreeView.remove_selected atm, I might hack up something to remove an item but not try to touch any files
[19:28:13] <OmegaPhil> Since the file has already been saved with the correct category information
[19:29:36] <OmegaPhil> Would you agree that extending remove_selected like this is appropriate?
[19:30:32] <OmegaPhil> I'll have an optional boolean, something like 'ui_only', that when True would ignore all the code associated with file deletion and just run the rest

Revision history for this message
OmegaPhil (omegaphil) wrote :

Have got the goahead to do this - I have attached my current WIP patch on this, feels like a hack but its worked for one attempt so far - playing with Bulk Rename, I removed 'Utility -> Accessories' and it disappeared from Accessories which is great, however when I tried to add the 'Utility -> Accessories' category back via System entry, I found there wasn't an 'Accessories' option under 'Utility'.

The options are sourced from MenulibreAplication.py:category_groups - is there any logic to what is and isn't here? Can I add any missing categories so that they match up with normal categories present on launchers?

Changed in menulibre:
assignee: nobody → OmegaPhil (omegaphil)
Revision history for this message
OmegaPhil (omegaphil) wrote :

Also theres some odd code in MenulibreTreeview.py:Treeview.remove_selected - 'if filename not in del_files' - how can filename not be part of the files to delete?

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "user-category-removal-wip.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Sean Davis (bluesabre) wrote :

The category group list is based on the standards provided here: https://specifications.freedesktop.org/menu-spec/latest/apa.html

As for the code in remove_selected, not sure why that is there, but possibly some issue related to treeview selections. It doesn't hurt to have it though.

Revision history for this message
OmegaPhil (omegaphil) wrote :

OK, so the standard goes into too much detail here, we just need the ability to set the 'Utility' category, rather than 'Utility -> Accessibility', etc.

It might look a little silly duplicating the main category name in the submenus, but I don't see how else to do it. Can I go ahead?

Revision history for this message
Sean Davis (bluesabre) wrote :

At one point, I thought this actually existed in MenuLibre. Go ahead and do this.

Revision history for this message
OmegaPhil (omegaphil) wrote :

Right, I finally have some working patches to add and remove categories here - along with it working for the selected launcher, the top-level directories the launcher should be in based on its current categories are reviewed, and launcher instances are added/removed as appropriate. This is a bit of a guess based on the category groups menulibre knows about (and does nothing for custom directory membership), but allows the tree to update usefully without having to restart menulibre to get at an updated GMenu tree.

Revision history for this message
OmegaPhil (omegaphil) wrote :
Revision history for this message
OmegaPhil (omegaphil) wrote :
Revision history for this message
OmegaPhil (omegaphil) wrote :

Last one. Some internal functions have been modified a bit so that I can reuse whats there without extra duplication.

I can squeeze the patches etc if needed.

Revision history for this message
Sean Davis (bluesabre) wrote :
Changed in menulibre:
status: Confirmed → Fix Committed
Revision history for this message
OmegaPhil (omegaphil) wrote :

Thanks

Sean Davis (bluesabre)
Changed in menulibre:
milestone: none → 2.1.4
Sean Davis (bluesabre)
Changed in menulibre:
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package menulibre - 2.1.5-0ubuntu1

---------------
menulibre (2.1.5-0ubuntu1) bionic; urgency=medium

  * New upstream release.
    - Fixes removal of categories from launchers (LP: #1307002)
    - Fixes PermissionError when saving launchers (LP: #1444668)
    - Reworked file and directory handling, resolving various issues
      with naming, saving, and reverting. Closes: #861540, #866133.
  * debian/compat:
    - Bump debhelper compatibility to 11
  * debian/control:
    - Update Standards-Version to 4.1.3
    - Updated VCS-Browser to secure origin
  * debian/manpages:
    - Added, resolves binary-without-manpage lintian warning
  * debian/menu:
    - Removed, resolves command-in-menu-file-and-desktop-file lintian
      warning
  * debian/rules:
    - Disabled verbose output.
    - Dropped override_dh_installchangelogs to resolve
      duplicate-changelog-files lintian warning. Closes: #834650
  * debian/watch:
    - Add upstream signing-key.asc

 -- Sean Davis <email address hidden> Thu, 08 Feb 2018 04:53:17 -0500

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

Other bug subscribers

Remote bug watches

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