Skip to content

Commit e4694e6

Browse files
committed
Simplify cinnamon-menu-editor
cinnamon-menu-editor: Remove item cut/copy/paste from menu editor and add menu category selection to desktop editor instead so that instead of the menu editor adding <Include> and <Exclude> rules to the .menu file when launchers are added to/remove from categories, the desktop editor adds/removes categories to the Categories= field in the .desktop file. Remove code related to separators and menu layout/ordering as these are not used in cinnamon applets. Add "Restore Item" button and remove "Close" button. Handle flatpak apps properly. Use atomic save for .menu file Update some deprecated code. cinnamon-desktop editor: Add menu category selection for launcher editor. Add "Hide (NoDisplay)" toggle for launcher editor and directory editor. Remove unnecessary <Include> and <Exclude> rules from the .menu file added in previous versions of menu-editor when a .desktop file is updated. Show a warning infobar when editing a local file when no "restore" to system is available. Don't create a new .desktop file in ~/.local/share/applications if original is in a subdirectory of ~/.local/share/applications as it would be overriden anyway and edit original instead Add command line option --show-categories so that unnecessary complexity can be avoided when launched from the app menu. Add error dialog for write errors config.py: delete unused constants cinnamon-applications.menu: simplify logic in "Administration" menu remove unused "System" menu
1 parent 73f873d commit e4694e6

10 files changed

Lines changed: 1101 additions & 1345 deletions

File tree

files/etc/xdg/menus/cinnamon-applications.menu

Lines changed: 22 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
22
"http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd">
33

4+
<!-- Category selection logic in this file should be kept in sync with same in cinnamon-desktop-editor.py -->
45
<Menu>
56

67
<Name>Applications</Name>
@@ -20,10 +21,10 @@
2021
<Include>
2122
<And>
2223
<Category>Utility</Category>
23-
<!-- Accessibility spec must have either the Utility or Settings
24-
category, and we display an accessibility submenu already for
25-
the ones that do not have Settings, so don't display accessibility
26-
applications here -->
24+
<!-- Accessibility spec must have either the Utility or Settings
25+
category, and we display an accessibility submenu already for
26+
the ones that do not have Settings, so don't display accessibility
27+
applications here -->
2728
<Not><Category>Accessibility</Category></Not>
2829
<Not><Category>System</Category></Not>
2930
</And>
@@ -129,12 +130,6 @@
129130
</Include>
130131
</Menu>
131132

132-
<!-- System Tools-->
133-
<Menu>
134-
<Name>System</Name>
135-
<Directory>cinnamon-system-tools.directory</Directory>
136-
</Menu> <!-- End System Tools -->
137-
138133
<!-- Other -->
139134
<Menu>
140135
<Name>Other</Name>
@@ -176,36 +171,27 @@
176171
<Name>Administration</Name>
177172
<Directory>cinnamon-settings-system.directory</Directory>
178173
<Include>
179-
<And>
180-
<Category>Settings</Category>
181-
<Category>System</Category>
182-
</And>
183-
</Include>
184-
<Include>
185-
<And>
186-
<Category>System</Category>
187-
<Not><Category>Settings</Category></Not>
188-
</And>
174+
<Category>System</Category>
189175
</Include>
190176
</Menu> <!-- End System Settings -->
191177

192178
<Layout>
193-
<Merge type="menus"/>
194-
<Menuname>Accessories</Menuname>
195-
<Menuname>Education</Menuname>
196-
<Menuname>Games</Menuname>
197-
<Menuname>Graphics</Menuname>
198-
<Menuname>Internet</Menuname>
199-
<Menuname>Office</Menuname>
200-
<Menuname>Other</Menuname>
201-
<Menuname>Development</Menuname>
202-
<Menuname>Multimedia</Menuname>
203-
<Menuname>System</Menuname>
204-
<Menuname>Universal Access</Menuname>
205-
<Menuname>wine-wine</Menuname>
206-
<Menuname>Preferences</Menuname>
207-
<Menuname>Administration</Menuname>
208-
<Merge type="files"/>
179+
<Merge type="menus"/>
180+
<Menuname>Accessories</Menuname>
181+
<Menuname>Education</Menuname>
182+
<Menuname>Games</Menuname>
183+
<Menuname>Graphics</Menuname>
184+
<Menuname>Internet</Menuname>
185+
<Menuname>Office</Menuname>
186+
<Menuname>Other</Menuname>
187+
<Menuname>Development</Menuname>
188+
<Menuname>Science</Menuname>
189+
<Menuname>Multimedia</Menuname>
190+
<Menuname>Universal Access</Menuname>
191+
<Menuname>wine-wine</Menuname>
192+
<Menuname>Preferences</Menuname>
193+
<Menuname>Administration</Menuname>
194+
<Merge type="files"/>
209195
</Layout>
210196

211197
</Menu> <!-- End Applications -->

files/usr/bin/cinnamon-menu-editor

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,7 @@ from cme import MainWindow
1313

1414

1515
def main():
16-
try:
17-
from MenuEditor import config
18-
datadir = config.pkgdatadir
19-
version = config.VERSION
20-
except Exception:
21-
datadir = '.'
22-
version = '0.9'
23-
app = MainWindow.MainWindow(datadir, version)
16+
app = MainWindow.MainWindow()
2417
app.run()
2518

2619

0 commit comments

Comments
 (0)