Don't depend on a menu editor

mintMenu also runs as fallback in Cinnamon,
we don't want to pull an editor there.
This commit is contained in:
Clement Lefebvre 2019-07-29 12:12:58 +02:00
parent c02fc00522
commit 69475bbb38
3 changed files with 12 additions and 7 deletions

3
debian/control vendored
View File

@ -26,8 +26,7 @@ Depends:
gir1.2-matepanelapplet-4.0, gir1.2-matepanelapplet-4.0,
gir1.2-gtk-3.0, gir1.2-gtk-3.0,
gir1.2-mate-desktop, gir1.2-mate-desktop,
gir1.2-xapp-1.0, gir1.2-xapp-1.0
menulibre | mozo
Description: Advanced MATE menu Description: Advanced MATE menu
One of the most advanced menus under Linux. MintMenu supports filtering, One of the most advanced menus under Linux. MintMenu supports filtering,
favorites, easy-uninstallation, autosession, and many other features. favorites, easy-uninstallation, autosession, and many other features.

View File

@ -597,7 +597,7 @@ class MenuWin(object):
def showMenuEditor(self, action, userdata = None): def showMenuEditor(self, action, userdata = None):
if os.path.exists("/usr/bin/menulibre"): if os.path.exists("/usr/bin/menulibre"):
Execute("menulibre") Execute("menulibre")
else: elif os.path.exists("/usr/bin/mozo"):
Execute("mozo") Execute("mozo")
def showMenu(self, widget=None, event=None): def showMenu(self, widget=None, event=None):
@ -692,13 +692,16 @@ class MenuWin(object):
# this callback is to create a context menu # this callback is to create a context menu
def create_menu(self): def create_menu(self):
menu_file = "popup-without-edit.xml"
action_group = Gtk.ActionGroup(name="context-menu") action_group = Gtk.ActionGroup(name="context-menu")
action = Gtk.Action(name="MintMenuPrefs", label=_("Preferences"), tooltip=None) action = Gtk.Action(name="MintMenuPrefs", label=_("Preferences"), tooltip=None)
action.connect("activate", self.showPreferences) action.connect("activate", self.showPreferences)
action_group.add_action(action) action_group.add_action(action)
action = Gtk.Action(name="MintMenuEdit", label=_("Edit menu"), tooltip=None) if os.path.exists("/usr/bin/menulibre") or os.path.exists("/usr/bin/mozo"):
action.connect("activate", self.showMenuEditor) action = Gtk.Action(name="MintMenuEdit", label=_("Edit menu"), tooltip=None)
action_group.add_action(action) action.connect("activate", self.showMenuEditor)
action_group.add_action(action)
menu_file = "popup.xml"
action = Gtk.Action(name="MintMenuReload", label=_("Reload plugins"), tooltip=None) action = Gtk.Action(name="MintMenuReload", label=_("Reload plugins"), tooltip=None)
action.connect("activate", self.mainwin.RegenPlugins) action.connect("activate", self.mainwin.RegenPlugins)
action_group.add_action(action) action_group.add_action(action)
@ -707,7 +710,7 @@ class MenuWin(object):
action_group.add_action(action) action_group.add_action(action)
action_group.set_translation_domain ("mintmenu") action_group.set_translation_domain ("mintmenu")
xml = os.path.join(os.path.join(os.path.dirname(__file__)), "popup.xml") xml = os.path.join(os.path.join(os.path.dirname(__file__)), menu_file)
self.applet.setup_menu_from_file(xml, action_group) self.applet.setup_menu_from_file(xml, action_group)
def detect_desktop_environment (self): def detect_desktop_environment (self):

View File

@ -0,0 +1,3 @@
<menuitem name="Prefs" action="MintMenuPrefs"/>
<menuitem name="Reload" action="MintMenuReload"/>
<menuitem name="About" action="MintMenuAbout"/>