From b1f7dd7d09bf088ef2dc369d4cf8cad59ce59bc5 Mon Sep 17 00:00:00 2001 From: clhodapp Date: Sat, 31 Oct 2009 07:52:26 +0800 Subject: [PATCH] Places Settings auto-applied --- usr/lib/linuxmint/mintMenu/mintMenuConfig.py | 4 ++-- usr/lib/linuxmint/mintMenu/plugins/places.py | 22 +++++++++++++++++--- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/mintMenuConfig.py b/usr/lib/linuxmint/mintMenu/mintMenuConfig.py index 812cb05..5aeb0d5 100755 --- a/usr/lib/linuxmint/mintMenu/mintMenuConfig.py +++ b/usr/lib/linuxmint/mintMenu/mintMenuConfig.py @@ -212,8 +212,8 @@ class mintMenuConfig( object ): self.bindGconfValueToWidget( self.gconfSystem, "int", "height", self.systemHeightButton, "value-changed", self.systemHeightButton.set_value, self.systemHeightButton.get_value_as_int ) self.bindGconfValueToWidget( self.gconfSystem, "bool", "allowScrollbar", self.allowSystemScrollbarToggle, "toggled", self.allowSystemScrollbarToggle.set_active, self.allowSystemScrollbarToggle.get_active ) - self.customplacenames = self.gconfPlaces.get( "list-string", "custom_names", [ ] ) self.customplacepaths = self.gconfPlaces.get( "list-string", "custom_paths", [ ] ) + self.customplacenames = self.gconfPlaces.get( "list-string", "custom_names", [ ] ) self.customplacestreemodel = gtk.ListStore( str, str) self.cell = gtk.CellRendererText() @@ -441,8 +441,8 @@ class mintMenuConfig( object ): customplacenames = customplacenames + [ self.customplacestreemodel.get_value(treeiter, 0 ) ] customplacepaths = customplacepaths + [ self.customplacestreemodel.get_value(treeiter, 1 ) ] treeiter = self.customplacestreemodel.iter_next(treeiter) - self.gconfPlaces.set( "list-string", "custom_names", customplacenames) self.gconfPlaces.set( "list-string", "custom_paths", customplacepaths) + self.gconfPlaces.set( "list-string", "custom_names", customplacenames) window = mintMenuConfig() diff --git a/usr/lib/linuxmint/mintMenu/plugins/places.py b/usr/lib/linuxmint/mintMenu/plugins/places.py index a165507..9e85ba8 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/places.py +++ b/usr/lib/linuxmint/mintMenu/plugins/places.py @@ -49,6 +49,13 @@ class pluginclass( object ): self.gconf = EasyGConf( "/apps/mintMenu/plugins/places/" ) self.gconf.notifyAdd( "icon_size", self.RegenPlugin ) + self.gconf.notifyAdd( "show_computer", self.RegenPlugin ) + self.gconf.notifyAdd( "show_desktop", self.RegenPlugin ) + self.gconf.notifyAdd( "show_home_folder", self.RegenPlugin ) + self.gconf.notifyAdd( "show_trash", self.RegenPlugin ) + self.gconf.notifyAdd( "custom_names", self.RegenPlugin ) + self.gconf.notifyAdd( "allowScrollbar", self.changePluginSize ) + self.gconf.notifyAdd( "allowScrollbar", self.RegenPlugin ) self.gconf.notifyAdd( "height", self.changePluginSize ) self.gconf.notifyAdd( "width", self.changePluginSize ) self.gconf.bindGconfEntryToVar( "bool", "sticky", self, "sticky" ) @@ -65,10 +72,17 @@ class pluginclass( object ): self.gconf.notifyRemoveAll() def changePluginSize( self, client, connection_id, entry, args ): + self.allowScrollbar = self.gconf.get( "bool", "allowScrollbar", False) if entry.get_key() == self.gconf.gconfDir+"width": self.width = entry.get_value().get_int() elif entry.get_key() == self.gconf.gconfDir+"height": - self.heigth = entry.get_value().get_int() + if (self.allowScrollbar == False): + self.height = -1 + self.scrolledWindow.set_policy( gtk.POLICY_AUTOMATIC, gtk.POLICY_NEVER ) + else: + self.scrolledWindow.set_policy( gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC ) + self.height = entry.get_value().get_int() + self.content_holder.set_size_request( self.width, self.height ) @@ -83,11 +97,13 @@ class pluginclass( object ): self.width = self.gconf.get( "int", "width", 200 ) self.allowScrollbar = self.gconf.get( "bool", "allowScrollbar", False) + self.scrolledWindow.set_policy( gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC ) + self.height = self.gconf.get( "int", "height", 180 ) + self.content_holder.set_size_request( self.width, self.height ) if (self.allowScrollbar == False): self.height = -1 self.scrolledWindow.set_policy( gtk.POLICY_AUTOMATIC, gtk.POLICY_NEVER ) - else: - self.height = self.gconf.get( "int", "height", 155 ) + self.content_holder.set_size_request( self.width, self.height ) self.execapp = self.gconf.get( "string", "execute_app", "nautilus" ) self.iconsize = self.gconf.get( "int","icon_size", 2 )