Unicode support in GTK bookmarks

This commit is contained in:
Clement Lefebvre 2010-10-25 12:23:16 +01:00
parent d8ae8c10b2
commit 396cda23b5
2 changed files with 16 additions and 5 deletions

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
mintmenu (5.1.4) julia; urgency=low
* Unicode support in GTK bookmarks
-- Clement Lefebvre <root@linuxmint.com> Mon, 25 Oct 2010 12:22:00 +0000
mintmenu (5.1.3) julia; urgency=low mintmenu (5.1.3) julia; urgency=low
* APT search can be turned off * APT search can be turned off

View File

@ -14,6 +14,7 @@ from easybuttons import *
from execute import Execute from execute import Execute
from easygconf import EasyGConf from easygconf import EasyGConf
from user import home from user import home
from urllib import unquote
# i18n # i18n
gettext.install("mintmenu", "/usr/share/linuxmint/locale") gettext.install("mintmenu", "/usr/share/linuxmint/locale")
@ -209,7 +210,7 @@ class pluginclass( object ):
bookmarks = {} bookmarks = {}
with open(os.path.expanduser('~/.gtk-bookmarks'), 'r') as f: with open(os.path.expanduser('~/.gtk-bookmarks'), 'r') as f:
for line in f: for line in f:
line = line.replace('file://', '') #line = line.replace('file://', '')
line = line.rstrip() line = line.rstrip()
parts = line.split(' ') parts = line.split(' ')
@ -220,12 +221,16 @@ class pluginclass( object ):
bookmarks[junk[len(junk) - 1]] = parts[0] bookmarks[junk[len(junk) - 1]] = parts[0]
for name, path in bookmarks.iteritems(): for name, path in bookmarks.iteritems():
command = ( "nautilus \"" + path + "\"") name = unquote(name)
currentbutton = easyButton( "folder", self.iconsize, [name], -1, -1 ) currentbutton = easyButton( "folder", self.iconsize, [name], -1, -1 )
currentbutton.connect( "clicked", self.ButtonClicked, command ) currentbutton.connect( "clicked", self.launch_gtk_bookmark, path )
currentbutton.show() currentbutton.show()
self.placesBtnHolder.pack_start( currentbutton, False, False ) self.placesBtnHolder.pack_start( currentbutton, False, False )
def launch_gtk_bookmark (self, widget, path):
self.mintMenuWin.hide()
os.system("xdg-open %s &" % path)
def trashPopup( self, widget, event ): def trashPopup( self, widget, event ):
if event.button == 3: if event.button == 3:
trashMenu = gtk.Menu() trashMenu = gtk.Menu()