Improved gmenu sub-category items detection, added python-gnomeapplet dependency, split other, administration and system tools categories

This commit is contained in:
Clement Lefebvre 2009-11-30 15:00:07 +00:00
parent 61273ca28d
commit 7ef7521e44
3 changed files with 40 additions and 18 deletions

10
debian/changelog vendored
View File

@ -1,8 +1,16 @@
mintmenu (4.9.1) helena; urgency=low
* Split Others, Administration and System tools categories (if we do it again we have to patch Alacarte to reflect this)
* Improved gmenu detection (didn't detect applications in sub-categories)
* Added dependency on python-gnomeapplet, needed by mintmenu
-- Clement Lefebvre <root@linuxmint.com> Mon, 30 Nov 2009 14:59:00 +0000
mintmenu (4.9.0) helena; urgency=low mintmenu (4.9.0) helena; urgency=low
* Changed hover delay from 150 to 50ms * Changed hover delay from 150 to 50ms
-- Clement Lefebvre <root@linuxmint.com> Fri, 29 Nov 2009 14:59:00 +0000 -- Clement Lefebvre <root@linuxmint.com> Fri, 27 Nov 2009 14:59:00 +0000
mintmenu (4.8.9) helena; urgency=low mintmenu (4.8.9) helena; urgency=low

2
debian/control vendored
View File

@ -7,6 +7,6 @@ Standards-Version: 3.7.2
Package: mintmenu Package: mintmenu
Architecture: all Architecture: all
Depends: python (>= 2.4), python (<< 3), python-gtk2, python-glade2, deskbar-applet, mint-common, python-gmenu Depends: python (>= 2.4), python (<< 3), python-gtk2, python-glade2, deskbar-applet, mint-common, python-gmenu, python-gnomeapplet
Description: Advanced Gnome menu Description: Advanced Gnome menu
One of the most advanced menus under Linux. MintMenu supports filtering, favorites, easy-uninstallation, autosession, and many other features. One of the most advanced menus under Linux. MintMenu supports filtering, favorites, easy-uninstallation, autosession, and many other features.

View File

@ -1197,10 +1197,10 @@ class pluginclass( object ):
for child in menu.directory.get_contents(): for child in menu.directory.get_contents():
if child.get_type() == gmenu.TYPE_DIRECTORY: if child.get_type() == gmenu.TYPE_DIRECTORY:
icon = str(child.icon) icon = str(child.icon)
if (icon == "preferences-system"): #if (icon == "preferences-system"):
self.adminMenu = child.name # self.adminMenu = child.name
if (icon != "applications-system" and icon != "applications-other"): #if (icon != "applications-system" and icon != "applications-other"):
newCategoryList.append( { "name": child.name, "icon": child.icon, "tooltip": child.name, "filter": child.name, "index": num } ) newCategoryList.append( { "name": child.name, "icon": child.icon, "tooltip": child.name, "filter": child.name, "index": num } )
num += 1 num += 1
return newCategoryList return newCategoryList
@ -1210,18 +1210,32 @@ class pluginclass( object ):
newApplicationsList = [] newApplicationsList = []
def find_applications_recursively(app_list, directory, catName):
for item in directory.get_contents():
if item.get_type() == gmenu.TYPE_ENTRY:
print "=======>>> " + str(item.name) + " = " + str(catName)
app_list.append( { "entry": item, "category": catName } )
elif item.get_type() == gmenu.TYPE_DIRECTORY:
find_applications_recursively(app_list, item, catName)
for menu in self.menuFiles: for menu in self.menuFiles:
for directory in menu.directory.get_contents(): directory = menu.directory
if directory.get_type() == gmenu.TYPE_DIRECTORY: for entry in directory.get_contents():
for application in directory.get_contents(): if entry.get_type() == gmenu.TYPE_DIRECTORY and len(entry.get_contents()):
if application.get_type() == gmenu.TYPE_ENTRY: #Entry is a top-level category
catName = directory.name #catName = entry.name
icon = str(directory.icon) #icon = str(entry.icon)
if (icon == "applications-system" or icon == "applications-other"): #if (icon == "applications-system" or icon == "applications-other"):
catName = self.adminMenu # catName = self.adminMenu
newApplicationsList.append( { "entry": application, "category": catName } ) for item in entry.get_contents():
else: if item.get_type() == gmenu.TYPE_DIRECTORY:
print "Missing something" find_applications_recursively(newApplicationsList, item, entry.name)
elif item.get_type() == gmenu.TYPE_ENTRY:
newApplicationsList.append( { "entry": item, "category": entry.name } )
#elif entry.get_type() == gmenu.TYPE_ENTRY:
# if not (entry.get_is_excluded() or entry.get_is_nodisplay()):
# print "=======>>> " + item.name + " = top level"
# newApplicationsList.append( { "entry": item, "category": "" } )
return newApplicationsList return newApplicationsList