Added GTK Bookmarks in places (disabled by default)

This commit is contained in:
Clement Lefebvre 2010-09-23 09:54:23 +01:00
parent b9bb28eb61
commit 15b6b0100c
5 changed files with 101 additions and 50 deletions

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
mintmenu (5.1.0) julia; urgency=low
* Added GTK bookmarks in places
-- Clement Lefebvre <root@linuxmint.com> Thu, 23 Sep 2010 09:54:00 +0000
mintmenu (5.0.9) julia; urgency=low mintmenu (5.0.9) julia; urgency=low
* Added GTK RC name to mintmenu (allows GTK themes to have mintMenu specific sections) * Added GTK RC name to mintmenu (allows GTK themes to have mintMenu specific sections)

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-09-15 17:16+0100\n" "POT-Creation-Date: 2010-09-23 09:53+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -28,27 +28,27 @@ msgstr ""
msgid "Couldn't initialize plugin" msgid "Couldn't initialize plugin"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenu.py:537 #: usr/lib/linuxmint/mintMenu/mintMenu.py:539
msgid "Preferences" msgid "Preferences"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenu.py:537 #: usr/lib/linuxmint/mintMenu/mintMenu.py:539
msgid "Edit menu" msgid "Edit menu"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenu.py:537 #: usr/lib/linuxmint/mintMenu/mintMenu.py:539
msgid "Reload plugins" msgid "Reload plugins"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenu.py:537 #: usr/lib/linuxmint/mintMenu/mintMenu.py:539
msgid "About" msgid "About"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenu.py:745 #: usr/lib/linuxmint/mintMenu/mintMenu.py:747
msgid "Advanced Gnome Menu" msgid "Advanced Gnome Menu"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenu.py:748 #: usr/lib/linuxmint/mintMenu/mintMenu.py:750
msgid "Based on USP from S.Chanderbally" msgid "Based on USP from S.Chanderbally"
msgstr "" msgstr ""
@ -212,126 +212,130 @@ msgid "Places"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:88 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:88
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:99 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:100
msgid "Allow Scrollbar" msgid "Allow Scrollbar"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:89 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:89
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:100 msgid "Show GTK Bookmarks"
msgid "Height:"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:90 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:90
msgid "Toggle Default Places:" #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:101
msgid "Height:"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:91 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:91
#: usr/lib/linuxmint/mintMenu/plugins/places.py:145 msgid "Toggle Default Places:"
msgid "Computer"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:92 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:92
#: usr/lib/linuxmint/mintMenu/plugins/places.py:152 #: usr/lib/linuxmint/mintMenu/plugins/places.py:148
msgid "Home Folder" msgid "Computer"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:93 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:93
#: usr/lib/linuxmint/mintMenu/plugins/places.py:159 #: usr/lib/linuxmint/mintMenu/plugins/places.py:155
msgid "Network" msgid "Home Folder"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:94 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:94
#: usr/lib/linuxmint/mintMenu/plugins/places.py:179 #: usr/lib/linuxmint/mintMenu/plugins/places.py:162
msgid "Desktop" msgid "Network"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:95 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:95
#: usr/lib/linuxmint/mintMenu/plugins/places.py:186 #: usr/lib/linuxmint/mintMenu/plugins/places.py:182
msgid "Trash" msgid "Desktop"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:96 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:96
#: usr/lib/linuxmint/mintMenu/plugins/places.py:189
msgid "Trash"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:97
msgid "Custom Places:" msgid "Custom Places:"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:98 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:99
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:38 #: usr/lib/linuxmint/mintMenu/plugins/system_management.py:38
msgid "System" msgid "System"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:101 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:102
msgid "Toggle Default Items:" msgid "Toggle Default Items:"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:102 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:103
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:134 #: usr/lib/linuxmint/mintMenu/plugins/system_management.py:134
msgid "Software Manager" msgid "Software Manager"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:103 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:104
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:141 #: usr/lib/linuxmint/mintMenu/plugins/system_management.py:141
msgid "Package Manager" msgid "Package Manager"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:104 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:105
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:148 #: usr/lib/linuxmint/mintMenu/plugins/system_management.py:148
msgid "Control Center" msgid "Control Center"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:105 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:106
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:155 #: usr/lib/linuxmint/mintMenu/plugins/system_management.py:155
msgid "Terminal" msgid "Terminal"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:106 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:107
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:162 #: usr/lib/linuxmint/mintMenu/plugins/system_management.py:162
msgid "Lock Screen" msgid "Lock Screen"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:107 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:108
msgid "Log Out" msgid "Log Out"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:108 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:109
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:176 #: usr/lib/linuxmint/mintMenu/plugins/system_management.py:176
msgid "Quit" msgid "Quit"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:110 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:111
msgid "Edit Place" msgid "Edit Place"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:111 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:112
msgid "New Place" msgid "New Place"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:112 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:113
msgid "Select a folder" msgid "Select a folder"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:114 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:115
msgid "Keyboard shortcut:" msgid "Keyboard shortcut:"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:245 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:248
msgid "Name" msgid "Name"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:246 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:249
msgid "Path" msgid "Path"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:261 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:264
msgid "Desktop theme" msgid "Desktop theme"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:396 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:399
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:430 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:433
msgid "Name:" msgid "Name:"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:397 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:400
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:431 #: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:434
msgid "Path:" msgid "Path:"
msgstr "" msgstr ""
@ -510,27 +514,27 @@ msgstr ""
msgid "Shutdown, restart, suspend or hibernate" msgid "Shutdown, restart, suspend or hibernate"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/places.py:149 #: usr/lib/linuxmint/mintMenu/plugins/places.py:152
msgid "" msgid ""
"Browse all local and remote disks and folders accessible from this computer" "Browse all local and remote disks and folders accessible from this computer"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/places.py:156 #: usr/lib/linuxmint/mintMenu/plugins/places.py:159
msgid "Open your personal folder" msgid "Open your personal folder"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/places.py:163 #: usr/lib/linuxmint/mintMenu/plugins/places.py:166
msgid "Browse bookmarked and local network locations" msgid "Browse bookmarked and local network locations"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/places.py:183 #: usr/lib/linuxmint/mintMenu/plugins/places.py:186
msgid "Browse items placed on the desktop" msgid "Browse items placed on the desktop"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/places.py:192 #: usr/lib/linuxmint/mintMenu/plugins/places.py:195
msgid "Browse deleted files" msgid "Browse deleted files"
msgstr "" msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/places.py:207 #: usr/lib/linuxmint/mintMenu/plugins/places.py:232
msgid "Empty trash" msgid "Empty trash"
msgstr "" msgstr ""

View File

@ -1095,6 +1095,18 @@
<property name="position">2</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkCheckButton" id="showgtkbookmarkscheckbutton">
<property name="label" translatable="yes">Show GTK bookmarks</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="position">3</property>
</packing>
</child>
<child> <child>
<widget class="GtkFrame" id="frame2"> <widget class="GtkFrame" id="frame2">
<property name="visible">True</property> <property name="visible">True</property>

View File

@ -86,6 +86,7 @@ class mintMenuConfig( object ):
wTree.get_widget("placesLabel").set_text(_("Places")) wTree.get_widget("placesLabel").set_text(_("Places"))
wTree.get_widget("allowscrollbarcheckbutton").set_label(_("Allow Scrollbar")) wTree.get_widget("allowscrollbarcheckbutton").set_label(_("Allow Scrollbar"))
wTree.get_widget("showgtkbookmarkscheckbutton").set_label(_("Show GTK Bookmarks"))
wTree.get_widget("placesHeightEntryLabel").set_text(_("Height:")) wTree.get_widget("placesHeightEntryLabel").set_text(_("Height:"))
wTree.get_widget("defaultPlacesFrameLabel").set_text(_("Toggle Default Places:")) wTree.get_widget("defaultPlacesFrameLabel").set_text(_("Toggle Default Places:"))
wTree.get_widget("computercheckbutton").set_label(_("Computer")) wTree.get_widget("computercheckbutton").set_label(_("Computer"))
@ -149,10 +150,11 @@ class mintMenuConfig( object ):
self.trashtoggle = wTree.get_widget( "trashcheckbutton" ) self.trashtoggle = wTree.get_widget( "trashcheckbutton" )
self.customplacestree = wTree.get_widget( "customplacestree" ) self.customplacestree = wTree.get_widget( "customplacestree" )
self.allowPlacesScrollbarToggle = wTree.get_widget( "allowscrollbarcheckbutton" ) self.allowPlacesScrollbarToggle = wTree.get_widget( "allowscrollbarcheckbutton" )
self.showgtkbookmarksToggle = wTree.get_widget( "showgtkbookmarkscheckbutton" )
self.placesHeightButton = wTree.get_widget( "placesHeightSpinButton" ) self.placesHeightButton = wTree.get_widget( "placesHeightSpinButton" )
if (self.allowPlacesScrollbarToggle.get_active() == False): if (self.allowPlacesScrollbarToggle.get_active() == False):
self.placesHeightButton.set_sensitive(False) self.placesHeightButton.set_sensitive(False)
self.allowPlacesScrollbarToggle.connect("toggled", self.togglePlacesHeightEnabled ) self.allowPlacesScrollbarToggle.connect("toggled", self.togglePlacesHeightEnabled )
self.softwareManagerToggle = wTree.get_widget( "softwaremanagercheckbutton" ) self.softwareManagerToggle = wTree.get_widget( "softwaremanagercheckbutton" )
self.packageManagerToggle = wTree.get_widget( "packagemanagercheckbutton" ) self.packageManagerToggle = wTree.get_widget( "packagemanagercheckbutton" )
self.controlCenterToggle = wTree.get_widget( "controlcentercheckbutton" ) self.controlCenterToggle = wTree.get_widget( "controlcentercheckbutton" )
@ -218,6 +220,7 @@ class mintMenuConfig( object ):
self.bindGconfValueToWidget( self.gconfPlaces, "bool", "show_trash", self.trashtoggle, "toggled", self.trashtoggle.set_active, self.trashtoggle.get_active ) self.bindGconfValueToWidget( self.gconfPlaces, "bool", "show_trash", self.trashtoggle, "toggled", self.trashtoggle.set_active, self.trashtoggle.get_active )
self.bindGconfValueToWidget( self.gconfPlaces, "int", "height", self.placesHeightButton, "value-changed", self.placesHeightButton.set_value, self.placesHeightButton.get_value_as_int ) self.bindGconfValueToWidget( self.gconfPlaces, "int", "height", self.placesHeightButton, "value-changed", self.placesHeightButton.set_value, self.placesHeightButton.get_value_as_int )
self.bindGconfValueToWidget( self.gconfPlaces, "bool", "allowScrollbar", self.allowPlacesScrollbarToggle, "toggled", self.allowPlacesScrollbarToggle.set_active, self.allowPlacesScrollbarToggle.get_active ) self.bindGconfValueToWidget( self.gconfPlaces, "bool", "allowScrollbar", self.allowPlacesScrollbarToggle, "toggled", self.allowPlacesScrollbarToggle.set_active, self.allowPlacesScrollbarToggle.get_active )
self.bindGconfValueToWidget( self.gconfPlaces, "bool", "show_gtk_bookmarks", self.showgtkbookmarksToggle, "toggled", self.showgtkbookmarksToggle.set_active, self.showgtkbookmarksToggle.get_active )
self.bindGconfValueToWidget( self.gconfSystem, "bool", "show_software_manager", self.softwareManagerToggle, "toggled", self.softwareManagerToggle.set_active, self.softwareManagerToggle.get_active ) self.bindGconfValueToWidget( self.gconfSystem, "bool", "show_software_manager", self.softwareManagerToggle, "toggled", self.softwareManagerToggle.set_active, self.softwareManagerToggle.get_active )
self.bindGconfValueToWidget( self.gconfSystem, "bool", "show_package_manager", self.packageManagerToggle, "toggled", self.packageManagerToggle.set_active, self.packageManagerToggle.get_active ) self.bindGconfValueToWidget( self.gconfSystem, "bool", "show_package_manager", self.packageManagerToggle, "toggled", self.packageManagerToggle.set_active, self.packageManagerToggle.get_active )

View File

@ -57,6 +57,7 @@ class pluginclass( object ):
self.gconf.notifyAdd( "custom_names", self.RegenPlugin ) self.gconf.notifyAdd( "custom_names", self.RegenPlugin )
self.gconf.notifyAdd( "custom_paths", self.RegenPlugin ) self.gconf.notifyAdd( "custom_paths", self.RegenPlugin )
self.gconf.notifyAdd( "allowScrollbar", self.RegenPlugin ) self.gconf.notifyAdd( "allowScrollbar", self.RegenPlugin )
self.gconf.notifyAdd( "show_gtk_bookmarks", self.RegenPlugin )
self.gconf.notifyAdd( "height", self.changePluginSize ) self.gconf.notifyAdd( "height", self.changePluginSize )
self.gconf.notifyAdd( "width", self.changePluginSize ) self.gconf.notifyAdd( "width", self.changePluginSize )
self.gconf.bindGconfEntryToVar( "bool", "sticky", self, "sticky" ) self.gconf.bindGconfEntryToVar( "bool", "sticky", self, "sticky" )
@ -73,7 +74,7 @@ class pluginclass( object ):
self.gconf.notifyRemoveAll() self.gconf.notifyRemoveAll()
def changePluginSize( self, client, connection_id, entry, args ): def changePluginSize( self, client, connection_id, entry, args ):
self.allowScrollbar = self.gconf.get( "bool", "allowScrollbar", False) self.allowScrollbar = self.gconf.get( "bool", "allowScrollbar", False)
if entry.get_key() == self.gconf.gconfDir+"width": if entry.get_key() == self.gconf.gconfDir+"width":
self.width = entry.get_value().get_int() self.width = entry.get_value().get_int()
elif entry.get_key() == self.gconf.gconfDir+"height": elif entry.get_key() == self.gconf.gconfDir+"height":
@ -93,11 +94,13 @@ class pluginclass( object ):
self.ClearAll() self.ClearAll()
self.do_standard_places() self.do_standard_places()
self.do_custom_places() self.do_custom_places()
self.do_gtk_bookmarks()
def GetGconfEntries( self ): def GetGconfEntries( self ):
self.width = self.gconf.get( "int", "width", 200 ) self.width = self.gconf.get( "int", "width", 200 )
self.allowScrollbar = self.gconf.get( "bool", "allowScrollbar", False) self.allowScrollbar = self.gconf.get( "bool", "allowScrollbar", True)
self.showGTKBookmarks = self.gconf.get( "bool", "show_gtk_bookmarks", False)
self.scrolledWindow.set_policy( gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC ) self.scrolledWindow.set_policy( gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC )
self.height = self.gconf.get( "int", "height", 180 ) self.height = self.gconf.get( "int", "height", 180 )
self.content_holder.set_size_request( self.width, self.height ) self.content_holder.set_size_request( self.width, self.height )
@ -201,6 +204,28 @@ class pluginclass( object ):
currentbutton.show() currentbutton.show()
self.placesBtnHolder.pack_start( currentbutton, False, False ) self.placesBtnHolder.pack_start( currentbutton, False, False )
def do_gtk_bookmarks( self ):
if self.showGTKBookmarks:
bookmarks = {}
with open(os.path.expanduser('~/.gtk-bookmarks'), 'r') as f:
for line in f:
line = line.replace('file://', '')
line = line.rstrip()
parts = line.split(' ')
if len(parts) == 2:
bookmarks[parts[1]] = parts[0]
elif len(parts) == 1:
junk = os.path.split(parts[0])
bookmarks[junk[len(junk) - 1]] = parts[0]
for name, path in bookmarks.iteritems():
command = ( "nautilus \"" + path + "\"")
currentbutton = easyButton( "folder", self.iconsize, [name], -1, -1 )
currentbutton.connect( "clicked", self.ButtonClicked, command )
currentbutton.show()
self.placesBtnHolder.pack_start( currentbutton, False, False )
def trashPopup( self, widget, event ): def trashPopup( self, widget, event ):
if event.button == 3: if event.button == 3:
trashMenu = gtk.Menu() trashMenu = gtk.Menu()
@ -225,6 +250,7 @@ class pluginclass( object ):
def do_plugin( self ): def do_plugin( self ):
self.do_standard_places() self.do_standard_places()
self.do_custom_places() self.do_custom_places()
self.do_gtk_bookmarks()
def refreshTrash (self): def refreshTrash (self):
iconName = "user-trash" iconName = "user-trash"