Some settings fixes

This commit is contained in:
Michael Webster 2013-03-08 21:29:49 -05:00
parent 5b66f2edfe
commit e9d11bccaf
4 changed files with 55 additions and 64 deletions

View File

@ -106,7 +106,7 @@ class MainWindow( object ):
plugindir = os.path.join( os.path.expanduser( "~" ), ".linuxmint/mintMenu/plugins" )
sys.path.append( plugindir )
self.getSetGconfEntries()
self.getSetGSettingEntries()
self.SetupMintMenuBorder()
self.SetupMintMenuOpacity()
@ -182,7 +182,7 @@ class MainWindow( object ):
self.customheadingcolor = settings.get_string(key)
self.SetHeadingStyle( self.headingsToColor )
def getSetGconfEntries( self ):
def getSetGSettingEntries( self ):
self.dottedfile = os.path.join( self.path, "dotted.png")
self.pluginlist = self.settings.get_strv( "plugins-list" )
@ -437,7 +437,7 @@ class MainWindow( object ):
gc.collect()
self.getSetGconfEntries()
self.getSetGSettingEntries()
self.PopulatePlugins()
#print NAME+u" reloaded"

View File

@ -260,9 +260,9 @@ class mintMenuConfig( object ):
for count in range( len(self.customplacepaths) ):
self.customplacestreemodel.append( [ self.customplacenames[count], self.customplacepaths[count] ] )
self.customplacestreemodel.connect("row-changed", self.updatePlacesGconf)
self.customplacestreemodel.connect("row-deleted", self.updatePlacesGconf)
self.customplacestreemodel.connect("rows-reordered", self.updatePlacesGconf)
self.customplacestreemodel.connect("row-changed", self.updatePlacesGSettings)
self.customplacestreemodel.connect("row-deleted", self.updatePlacesGSettings)
self.customplacestreemodel.connect("rows-reordered", self.updatePlacesGSettings)
self.customplacestree.set_model( self.customplacestreemodel )
self.namescolumn = Gtk.TreeViewColumn( _("Name"), self.cell, text = 0 )
self.placescolumn = Gtk.TreeViewColumn( _("Path"), self.cell, text = 1 )
@ -275,7 +275,7 @@ class mintMenuConfig( object ):
self.builder.get_object("removeButton").connect("clicked", self.removePlace)
#Detect themes and show theme here
theme_name = commands.getoutput("mateconftool-2 --get /apps/mintMenu/theme_name").strip()
theme_name = self.settings.get ("string", "theme-name")
themes = commands.getoutput("find /usr/share/themes -name gtkrc")
themes = themes.split("\n")
model = Gtk.ListStore(str, str)
@ -300,25 +300,26 @@ class mintMenuConfig( object ):
model = widget.get_model()
iter = widget.get_active_iter()
theme_name = model.get_value(iter, 1)
os.system("mateconftool-2 --type string --set /apps/mintMenu/theme_name \"%s\"" % theme_name)
self.settings.set_string("theme-name", theme_name)
def getPluginsToggle(self):
if (commands.getoutput("mateconftool-2 --get /apps/mintMenu/plugins_list | grep recent | wc -l") == "0"):
self.showRecentPlugin.set_active(False)
else:
array = self.settings.get ("list-string", "plugins-list")
if "recent" in array:
self.showRecentPlugin.set_active(True)
if (commands.getoutput("mateconftool-2 --get /apps/mintMenu/plugins_list | grep applications | wc -l") == "0"):
self.showApplicationsPlugin.set_active(False)
else:
self.showRecentPlugin.set_active(False)
if "applications" in array:
self.showApplicationsPlugin.set_active(True)
if (commands.getoutput("mateconftool-2 --get /apps/mintMenu/plugins_list | grep system_management | wc -l") == "0"):
self.showSystemPlugin.set_active(False)
else:
self.showApplicationsPlugin.set_active(False)
if "system_management" in array:
self.showSystemPlugin.set_active(True)
if (commands.getoutput("mateconftool-2 --get /apps/mintMenu/plugins_list | grep places | wc -l") == "0"):
self.showPlacesPlugin.set_active(False)
else:
self.showSystemPlugin.set_active(False)
if "places" in array:
self.showPlacesPlugin.set_active(True)
else:
self.showPlacesPlugin.set_active(False)
def setPluginsLayout (self, widget):
visiblePlugins = []
@ -334,12 +335,7 @@ class mintMenuConfig( object ):
if self.showApplicationsPlugin.get_active() or self.showPlacesPlugin.get_active() or self.showSystemPlugin.get_active():
visiblePlugins.append("newpane")
visiblePlugins.append("recent")
layout = ""
for plugin in visiblePlugins:
layout = layout + plugin + ","
if len(layout) > 0 and layout[-1] == ",":
layout = layout[0:-1]
os.system("mateconftool-2 --type list --list-type string --set /apps/mintMenu/plugins_list [%s]" % layout)
self.settings.set ("list-string", "plugins-list", visiblePlugins)
def setShowButtonIcon( self, value ):
self.showButtonIcon.set_active(not value )
@ -528,7 +524,7 @@ class mintMenuConfig( object ):
else:
self.systemHeightButton.set_sensitive(False)
def updatePlacesGconf(self, treemodel, path, iter = None, new_order = None):
def updatePlacesGSettings(self, treemodel, path, iter = None, new_order = None):
# Do only if not partway though an append operation; Append = insert+change+change and each creates a signal
if ((iter == None) or (self.customplacestreemodel.get_value(iter, 1) != None)):
treeiter = self.customplacestreemodel.get_iter_first()

View File

@ -10,6 +10,7 @@ import ctypes
from ctypes import *
from easybuttons import *
from easygsettings import EasyGSettings
from execute import Execute
from user import home
from urllib import unquote
@ -49,20 +50,20 @@ class pluginclass( object ):
self.itemstocolor = [ builder.get_object( "viewport2" ) ]
# Settings
self.settings = Gio.Settings.new("com.linuxmint.mintmenu.plugins.places")
self.settings = EasyGSettings("com.linuxmint.mintmenu.plugins.places")
self.settings.connect( "changed::icon-size", self.RegenPlugin )
self.settings.connect( "changed::show-computer", self.RegenPlugin )
self.settings.connect( "changed::show-desktop", self.RegenPlugin )
self.settings.connect( "changed::show-home_folder", self.RegenPlugin )
self.settings.connect( "changed::show-network", self.RegenPlugin )
self.settings.connect( "changed::show-trash", self.RegenPlugin )
self.settings.connect( "changed::custom-names", self.RegenPlugin )
self.settings.connect( "changed::custom-paths", self.RegenPlugin )
self.settings.connect( "changed::allow-scrollbar", self.RegenPlugin )
self.settings.connect( "changed::show-gtk-bookmarks", self.RegenPlugin )
self.settings.connect( "changed::height", self.changePluginSize )
self.settings.connect( "changed::width", self.changePluginSize )
self.settings.notifyAdd( "icon-size", self.RegenPlugin )
self.settings.notifyAdd( "show-computer", self.RegenPlugin )
self.settings.notifyAdd( "show-desktop", self.RegenPlugin )
self.settings.notifyAdd( "show-home_folder", self.RegenPlugin )
self.settings.notifyAdd( "show-network", self.RegenPlugin )
self.settings.notifyAdd( "show-trash", self.RegenPlugin )
self.settings.notifyAdd( "custom-names", self.RegenPlugin )
self.settings.notifyAdd( "custom-paths", self.RegenPlugin )
self.settings.notifyAdd( "allow-scrollbar", self.RegenPlugin )
self.settings.notifyAdd( "show-gtk-bookmarks", self.RegenPlugin )
self.settings.notifyAdd( "height", self.changePluginSize )
self.settings.notifyAdd( "width", self.changePluginSize )
self.loadSettings()
@ -73,17 +74,17 @@ class pluginclass( object ):
self.refreshTrash()
def destroy( self ):
self.settings.disconnect_all()
self.settings.notifyRemoveAll()
def changePluginSize( self, client, connection_id, entry, args ):
self.allowScrollbar = self.settings.get_boolean( "allow-scrollbar" )
self.width = self.settings.get_int( "width" )
def changePluginSize( self, settings, key, args = None):
self.allowScrollbar = self.settings.get( "bool", "allow-scrollbar" )
self.width = self.settings.get( "int", "width" )
if (self.allowScrollbar == False):
self.height = -1
self.scrolledWindow.set_policy( Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.NEVER )
else:
self.scrolledWindow.set_policy( Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC )
self.height = self.settings.get_int( "height" )
self.height = self.settings.get( "int", "height" )
self.content_holder.set_size_request( self.width, self.height )
def RegenPlugin( self, *args, **kargs ):
@ -94,39 +95,39 @@ class pluginclass( object ):
self.do_gtk_bookmarks()
def loadSettings( self ):
self.width = self.settings.get_int( "width" )
self.allowScrollbar = self.settings.get_boolean( "allow-scrollbar" )
self.showGTKBookmarks = self.settings.get_boolean( "show-gtk-bookmarks" )
self.width = self.settings.get( "int", "width" )
self.allowScrollbar = self.settings.get( "bool", "allow-scrollbar" )
self.showGTKBookmarks = self.settings.get( "bool", "show-gtk-bookmarks" )
self.scrolledWindow.set_policy( Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC )
self.height = self.settings.get_int( "height" )
self.height = self.settings.get( "int", "height" )
self.content_holder.set_size_request( self.width, self.height )
if (self.allowScrollbar == False):
self.height = -1
self.scrolledWindow.set_policy( Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.NEVER )
self.content_holder.set_size_request( self.width, self.height )
self.iconsize = self.settings.get_int( "icon-size" )
self.iconsize = self.settings.get( "int", "icon-size" )
# Check default items
self.showcomputer = self.settings.get_boolean( "show-computer" )
self.showhomefolder = self.settings.get_boolean( "show-home-folder" )
self.shownetwork = self.settings.get_boolean( "show-network" )
self.showdesktop = self.settings.get_boolean( "show-desktop" )
self.showtrash = self.settings.get_boolean( "show-trash" )
self.showcomputer = self.settings.get( "bool", "show-computer" )
self.showhomefolder = self.settings.get( "bool", "show-home-folder" )
self.shownetwork = self.settings.get( "bool", "show-network" )
self.showdesktop = self.settings.get( "bool", "show-desktop" )
self.showtrash = self.settings.get( "bool", "show-trash" )
# Get paths for custom items
self.custompaths = self.settings.get_strv( "custom-paths" )
self.custompaths = self.settings.get( "list-string", "custom-paths" )
# Get names for custom items
self.customnames = self.settings.get_strv( "custom-names" )
self.customnames = self.settings.get( "list-string", "custom-names" )
# Hide vertical dotted separator
self.hideseparator = self.settings.get_boolean( "hide-separator" )
self.hideseparator = self.settings.get( "bool", "hide-separator" )
# Plugin icon
self.icon = self.settings.get_string( "icon" )
self.icon = self.settings.get( "string", "icon" )
# Allow plugin to be minimized to the left plugin pane
self.sticky = self.settings.get_boolean( "sticky")
self.minimized = self.settings.get_boolean( "minimized")
self.sticky = self.settings.get( "bool", "sticky")
self.minimized = self.settings.get( "bool", "minimized")
def ClearAll(self):
for child in self.placesBtnHolder.get_children():

View File

@ -198,12 +198,6 @@
</key>
</schema>
<schema id="com.linuxmint.mintmenu.plugins.applications" path="/com/linuxmint/mintmenu/plugins/applications/">
<key type="b" name="categories-mouse-over">