Skip to content
Browse files

Update treeview when restoring default applets (fix for issue #375)

  • Loading branch information...
1 parent e0da935 commit aa870a8f2cf9212321cb5737ff353045bfd5cc32 @glebihan glebihan committed Feb 20, 2012
Showing with 10 additions and 1 deletion.
  1. +10 −1 files/usr/lib/cinnamon-settings/cinnamon-settings.py
View
11 files/usr/lib/cinnamon-settings/cinnamon-settings.py
@@ -386,7 +386,7 @@ def build(self):
scrolledWindow.set_shadow_type(Gtk.ShadowType.IN)
button = Gtk.Button(_("Restore to default"))
- button.connect("clicked", lambda x: os.system('gsettings reset org.cinnamon enabled-applets'))
+ button.connect("clicked", lambda x: self._restore_default_applets())
link = Gtk.LinkButton("http://cinnamon-spices.linuxmint.com/applets")
link.set_label(_("Get new applets"))
@@ -396,6 +396,15 @@ def build(self):
self.content_box.pack_start(link, False, False, 2)
self.content_box.show_all()
+
+ def _restore_default_applets(self):
+ os.system('gsettings reset org.cinnamon enabled-applets')
+ self.enabled_applets = self.settings.get_strv("enabled-applets")
+
+ self.model.clear()
+
+ self.load_applets_in('/usr/share/cinnamon/applets')
+ self.load_applets_in('%s/.local/share/cinnamon/applets' % home)
def load_applets_in(self, directory):
if os.path.exists(directory) and os.path.isdir(directory):

0 comments on commit aa870a8

Please sign in to comment.
Something went wrong with that request. Please try again.