Fixed mouse grab issue, menu hiding and empty application list bugs
This commit is contained in:
parent
e3db4c0942
commit
b6f3353305
3
debian/changelog
vendored
3
debian/changelog
vendored
@ -2,6 +2,9 @@ mintmenu (5.0.6) julia; urgency=low
|
|||||||
|
|
||||||
* Removed sidepane (confusing), plugins are now enabled/disabled in preferences
|
* Removed sidepane (confusing), plugins are now enabled/disabled in preferences
|
||||||
* UI improvements (dotted separators, layout)
|
* UI improvements (dotted separators, layout)
|
||||||
|
* 150ms default hover delay
|
||||||
|
* Fixed empty application list bug
|
||||||
|
* Fixed mouse grab issue
|
||||||
|
|
||||||
-- Clement Lefebvre <root@linuxmint.com> Mon, 13 Sep 2010 12:09:00 +0000
|
-- Clement Lefebvre <root@linuxmint.com> Mon, 13 Sep 2010 12:09:00 +0000
|
||||||
|
|
||||||
|
@ -3,10 +3,11 @@
|
|||||||
import sys, os
|
import sys, os
|
||||||
|
|
||||||
if len(sys.argv) > 1:
|
if len(sys.argv) > 1:
|
||||||
if (sys.argv[1] == "clean"):
|
if (sys.argv[1] in ["clean", "clear", "reset", "--clean", "--clear", "--reset"]):
|
||||||
print "All mintMenu settings are now restored to default"
|
os.system("gconftool-2 --recursive-unset /apps/mintMenu")
|
||||||
os.system("gconftool-2 --recursive-unset /apps/mintMenu")
|
os.system("rm -rf ~/.linuxmint/mintMenu")
|
||||||
os.system("rm -rf ~/.linuxmint/mintMenu")
|
os.system("gconftool-2 --recursive-unset /apps/mintMenu")
|
||||||
|
os.system("rm -rf ~/.linuxmint/mintMenu")
|
||||||
|
print "All mintMenu settings are now restored to default"
|
||||||
else:
|
else:
|
||||||
os.system("/usr/lib/linuxmint/mintMenu/mintMenu.py run-in-window")
|
os.system("/usr/lib/linuxmint/mintMenu/mintMenu.py run-in-window")
|
||||||
|
|
||||||
|
@ -494,9 +494,8 @@ class MainWindow( object ):
|
|||||||
if event.type == gtk.gdk.UNMAP or event.type == gtk.gdk.SELECTION_CLEAR:
|
if event.type == gtk.gdk.UNMAP or event.type == gtk.gdk.SELECTION_CLEAR:
|
||||||
self.grab()
|
self.grab()
|
||||||
|
|
||||||
def hide( self, forceHide = False ):
|
def hide(self, forceHide = False):
|
||||||
if forceHide:
|
self.window.hide()
|
||||||
self.window.hide()
|
|
||||||
|
|
||||||
class MenuWin( object ):
|
class MenuWin( object ):
|
||||||
def __init__( self, applet, iid ):
|
def __init__( self, applet, iid ):
|
||||||
|
@ -222,7 +222,7 @@ class pluginclass( object ):
|
|||||||
|
|
||||||
@print_timing
|
@print_timing
|
||||||
def __init__( self, mintMenuWin, toggleButton ):
|
def __init__( self, mintMenuWin, toggleButton ):
|
||||||
|
os.system("echo `date` > /var/tmp/mintmenu.log")
|
||||||
self.apt_cache = None
|
self.apt_cache = None
|
||||||
try:
|
try:
|
||||||
self.apt_cache = apt.Cache()
|
self.apt_cache = apt.Cache()
|
||||||
@ -502,7 +502,7 @@ class pluginclass( object ):
|
|||||||
self.favCols = self.gconf.get( "int", "fav_cols", 2 )
|
self.favCols = self.gconf.get( "int", "fav_cols", 2 )
|
||||||
self.swapgeneric = self.gconf.get( "bool", "swap_generic_name", False )
|
self.swapgeneric = self.gconf.get( "bool", "swap_generic_name", False )
|
||||||
self.showcategoryicons = self.gconf.get( "bool", "show_category_icons", True )
|
self.showcategoryicons = self.gconf.get( "bool", "show_category_icons", True )
|
||||||
self.categoryhoverdelay = self.gconf.get( "int", "category_hover_delay", 50 )
|
self.categoryhoverdelay = self.gconf.get( "int", "category_hover_delay", 150 )
|
||||||
self.showapplicationcomments = self.gconf.get( "bool", "show_application_comments", True )
|
self.showapplicationcomments = self.gconf.get( "bool", "show_application_comments", True )
|
||||||
|
|
||||||
self.lastActiveTab = self.gconf.get( "int", "last_active_tab", 0 )
|
self.lastActiveTab = self.gconf.get( "int", "last_active_tab", 0 )
|
||||||
@ -586,7 +586,8 @@ class pluginclass( object ):
|
|||||||
self.searchEntry.grab_focus()
|
self.searchEntry.grab_focus()
|
||||||
self.searchEntry.select_region( sel[0], sel[1] )
|
self.searchEntry.select_region( sel[0], sel[1] )
|
||||||
|
|
||||||
def buildButtonList( self ):
|
def buildButtonList( self ):
|
||||||
|
os.system("echo buildButtonList >> /var/tmp/mintmenu.log")
|
||||||
if self.buildingButtonList:
|
if self.buildingButtonList:
|
||||||
self.stopBuildingButtonList = True
|
self.stopBuildingButtonList = True
|
||||||
gobject.timeout_add( 100, self.buildButtonList )
|
gobject.timeout_add( 100, self.buildButtonList )
|
||||||
@ -594,7 +595,7 @@ class pluginclass( object ):
|
|||||||
|
|
||||||
self.stopBuildingButtonList = False
|
self.stopBuildingButtonList = False
|
||||||
|
|
||||||
gobject.idle_add( self.updateBoxes )
|
self.updateBoxes()
|
||||||
|
|
||||||
def categoryBtnFocus( self, widget, event, category ):
|
def categoryBtnFocus( self, widget, event, category ):
|
||||||
self.scrollItemIntoView( widget )
|
self.scrollItemIntoView( widget )
|
||||||
@ -1185,7 +1186,7 @@ class pluginclass( object ):
|
|||||||
except Exception, detail:
|
except Exception, detail:
|
||||||
print detail
|
print detail
|
||||||
|
|
||||||
def onLaunchApp( self, menu, widget ):
|
def onLaunchApp( self, menu, widget ):
|
||||||
widget.execute()
|
widget.execute()
|
||||||
self.mintMenuWin.hide()
|
self.mintMenuWin.hide()
|
||||||
|
|
||||||
@ -1293,7 +1294,7 @@ class pluginclass( object ):
|
|||||||
|
|
||||||
def do_plugin( self ):
|
def do_plugin( self ):
|
||||||
self.Todos()
|
self.Todos()
|
||||||
self.buildFavorites()
|
self.buildFavorites()
|
||||||
|
|
||||||
# Scroll button into view
|
# Scroll button into view
|
||||||
def scrollItemIntoView( self, widget, event = None ):
|
def scrollItemIntoView( self, widget, event = None ):
|
||||||
@ -1558,26 +1559,31 @@ class pluginclass( object ):
|
|||||||
self.menuChangedTimer = gobject.timeout_add( 100, self.updateBoxes )
|
self.menuChangedTimer = gobject.timeout_add( 100, self.updateBoxes )
|
||||||
|
|
||||||
def updateBoxes( self ):
|
def updateBoxes( self ):
|
||||||
|
os.system("echo updateboxes >> /var/tmp/mintmenu.log")
|
||||||
# FIXME: This is really bad!
|
# FIXME: This is really bad!
|
||||||
if self.rebuildLock:
|
if self.rebuildLock:
|
||||||
|
os.system("echo rebuildLock >> /var/tmp/mintmenu.log")
|
||||||
return
|
return
|
||||||
|
|
||||||
self.rebuildLock = True
|
self.rebuildLock = True
|
||||||
|
|
||||||
self.menuChangedTimer = None
|
self.menuChangedTimer = None
|
||||||
|
|
||||||
|
os.system("echo step1 >> /var/tmp/mintmenu.log")
|
||||||
self.loadMenuFiles()
|
self.loadMenuFiles()
|
||||||
|
os.system("echo step2 >> /var/tmp/mintmenu.log")
|
||||||
# Find added and removed categories than update the category list
|
# Find added and removed categories than update the category list
|
||||||
newCategoryList = self.buildCategoryList()
|
newCategoryList = self.buildCategoryList()
|
||||||
|
os.system("echo \"%d categories\" >> /var/tmp/mintmenu.log" % len(newCategoryList))
|
||||||
addedCategories = []
|
addedCategories = []
|
||||||
removedCategories = []
|
removedCategories = []
|
||||||
|
|
||||||
# TODO: optimize this!!!
|
# TODO: optimize this!!!
|
||||||
if not self.categoryList:
|
if not self.categoryList:
|
||||||
|
os.system("echo a >> /var/tmp/mintmenu.log")
|
||||||
addedCategories = newCategoryList
|
addedCategories = newCategoryList
|
||||||
else:
|
else:
|
||||||
|
os.system("echo b >> /var/tmp/mintmenu.log")
|
||||||
for item in newCategoryList:
|
for item in newCategoryList:
|
||||||
found = False
|
found = False
|
||||||
for item2 in self.categoryList:
|
for item2 in self.categoryList:
|
||||||
@ -1605,14 +1611,17 @@ class pluginclass( object ):
|
|||||||
else:
|
else:
|
||||||
categoryIconSize = 0
|
categoryIconSize = 0
|
||||||
|
|
||||||
|
os.system("echo c >> /var/tmp/mintmenu.log")
|
||||||
|
|
||||||
for key in removedCategories:
|
for key in removedCategories:
|
||||||
self.categoryList[key]["button"].destroy()
|
self.categoryList[key]["button"].destroy()
|
||||||
del self.categoryList[key]
|
del self.categoryList[key]
|
||||||
|
|
||||||
|
os.system("echo d >> /var/tmp/mintmenu.log")
|
||||||
|
|
||||||
if addedCategories:
|
if addedCategories:
|
||||||
sortedCategoryList = []
|
sortedCategoryList = []
|
||||||
|
os.system("echo e >> /var/tmp/mintmenu.log")
|
||||||
for item in self.categoryList:
|
for item in self.categoryList:
|
||||||
self.categoriesBox.remove( item["button"] )
|
self.categoriesBox.remove( item["button"] )
|
||||||
sortedCategoryList.append( ( str(item["index"]) + item["name"], item["button"] ) )
|
sortedCategoryList.append( ( str(item["index"]) + item["name"], item["button"] ) )
|
||||||
@ -1633,9 +1642,10 @@ class pluginclass( object ):
|
|||||||
|
|
||||||
self.categoryList.append( item )
|
self.categoryList.append( item )
|
||||||
sortedCategoryList.append( ( str(item["index"]) + item["name"], item["button"] ) )
|
sortedCategoryList.append( ( str(item["index"]) + item["name"], item["button"] ) )
|
||||||
|
os.system("echo f >> /var/tmp/mintmenu.log")
|
||||||
sortedCategoryList.sort()
|
sortedCategoryList.sort()
|
||||||
|
|
||||||
|
os.system("echo g >> /var/tmp/mintmenu.log")
|
||||||
for item in sortedCategoryList:
|
for item in sortedCategoryList:
|
||||||
self.categoriesBox.pack_start( item[1], False )
|
self.categoriesBox.pack_start( item[1], False )
|
||||||
|
|
||||||
@ -1645,10 +1655,13 @@ class pluginclass( object ):
|
|||||||
addedApplications = []
|
addedApplications = []
|
||||||
removedApplications = []
|
removedApplications = []
|
||||||
|
|
||||||
|
os.system("echo h >> /var/tmp/mintmenu.log")
|
||||||
# TODO: optimize this!!!
|
# TODO: optimize this!!!
|
||||||
if not self.applicationList:
|
if not self.applicationList:
|
||||||
|
os.system("echo i >> /var/tmp/mintmenu.log")
|
||||||
addedApplications = newApplicationList
|
addedApplications = newApplicationList
|
||||||
else:
|
else:
|
||||||
|
os.system("echo j >> /var/tmp/mintmenu.log")
|
||||||
for item in newApplicationList:
|
for item in newApplicationList:
|
||||||
found = False
|
found = False
|
||||||
for item2 in self.applicationList:
|
for item2 in self.applicationList:
|
||||||
@ -1672,17 +1685,17 @@ class pluginclass( object ):
|
|||||||
# because when it is removed the index of all later items is
|
# because when it is removed the index of all later items is
|
||||||
# going to be decreased
|
# going to be decreased
|
||||||
key += 1
|
key += 1
|
||||||
|
os.system("echo k >> /var/tmp/mintmenu.log")
|
||||||
for key in removedApplications:
|
for key in removedApplications:
|
||||||
self.applicationList[key]["button"].destroy()
|
self.applicationList[key]["button"].destroy()
|
||||||
del self.applicationList[key]
|
del self.applicationList[key]
|
||||||
|
os.system("echo l >> /var/tmp/mintmenu.log")
|
||||||
if addedApplications:
|
if addedApplications:
|
||||||
sortedApplicationList = []
|
sortedApplicationList = []
|
||||||
for item in self.applicationList:
|
for item in self.applicationList:
|
||||||
self.applicationsBox.remove( item["button"] )
|
self.applicationsBox.remove( item["button"] )
|
||||||
sortedApplicationList.append( ( item["button"].appName, item["button"] ) )
|
sortedApplicationList.append( ( item["button"].appName, item["button"] ) )
|
||||||
|
os.system("echo \"%d added apps\" >> /var/tmp/mintmenu.log" % len(addedApplications))
|
||||||
for item in addedApplications:
|
for item in addedApplications:
|
||||||
item["button"] = MenuApplicationLauncher( item["entry"].get_desktop_file_path(), self.iconSize, item["category"], self.showapplicationcomments )
|
item["button"] = MenuApplicationLauncher( item["entry"].get_desktop_file_path(), self.iconSize, item["category"], self.showapplicationcomments )
|
||||||
if item["button"].appExec:
|
if item["button"].appExec:
|
||||||
@ -1690,6 +1703,7 @@ class pluginclass( object ):
|
|||||||
item["button"].connect( "button-release-event", self.menuPopup )
|
item["button"].connect( "button-release-event", self.menuPopup )
|
||||||
item["button"].connect( "focus-in-event", self.scrollItemIntoView )
|
item["button"].connect( "focus-in-event", self.scrollItemIntoView )
|
||||||
item["button"].connect( "clicked", lambda w: self.mintMenuWin.hide() )
|
item["button"].connect( "clicked", lambda w: self.mintMenuWin.hide() )
|
||||||
|
os.system("echo \"%s '%s' filter\" >> /var/tmp/mintmenu.log" % (self.activeFilter[0], self.activeFilter[1]))
|
||||||
if self.activeFilter[0] == 0:
|
if self.activeFilter[0] == 0:
|
||||||
item["button"].filterText( self.activeFilter[1] )
|
item["button"].filterText( self.activeFilter[1] )
|
||||||
else:
|
else:
|
||||||
@ -1701,9 +1715,12 @@ class pluginclass( object ):
|
|||||||
|
|
||||||
|
|
||||||
sortedApplicationList.sort()
|
sortedApplicationList.sort()
|
||||||
|
os.system("echo \"%d apps\" >> /var/tmp/mintmenu.log" % len(sortedApplicationList))
|
||||||
for item in sortedApplicationList:
|
for item in sortedApplicationList:
|
||||||
self.applicationsBox.pack_start( item[1], False )
|
self.applicationsBox.pack_start( item[1], False )
|
||||||
|
|
||||||
self.rebuildLock = False
|
self.rebuildLock = False
|
||||||
|
os.system("echo fin >> /var/tmp/mintmenu.log")
|
||||||
|
|
||||||
|
|
||||||
# Reload the menufiles from the filesystem
|
# Reload the menufiles from the filesystem
|
||||||
|
Loading…
Reference in New Issue
Block a user