[beryl-commits] r2264 - trunk/beryl-settings-2

quinn at server.beryl-project.org quinn at server.beryl-project.org
Tue Jan 2 11:33:27 CET 2007


Author: quinn
Date: 2007-01-02 10:33:26 +0000 (Tue, 02 Jan 2007)
New Revision: 2264

Modified:
   trunk/beryl-settings-2/main.py
Log:
bsm++ NOW LIVE
BE CAREFUL!
it operates on your regular beryl settings now!


Modified: trunk/beryl-settings-2/main.py
===================================================================
--- trunk/beryl-settings-2/main.py	2007-01-02 10:23:07 UTC (rev 2263)
+++ trunk/beryl-settings-2/main.py	2007-01-02 10:33:26 UTC (rev 2264)
@@ -16,7 +16,6 @@
 		"imageformat":"categories/applications-graphics.svg"}
 
 Ctx=berylsettings.Context()
-Ctx.Profile="newprofile"
 Ctx.Read()
 Aps=Ctx.Plugin("_").Setting("active_plugins")
 
@@ -24,6 +23,10 @@
 
 AllowUpdate=True
 
+def WriteSettings():
+	Ctx.Write()
+	berylsettings.send_reload()
+
 AllCats=[]
 def QuitAll(v):
 	gtk.main_quit()
@@ -150,6 +153,7 @@
 
 def PluginButtonClicked(plb,pld):
 	global hideshowall
+	global AllowUpdate
 	if AllowUpdate:
 		if (plb.props.active):
 			#here is where a tryEnablePlugin would normally happen
@@ -160,8 +164,10 @@
 				ee=Aps.Value
 				ee.remove(pld[4].Name)
 				Aps.Value=ee
+		AllowUpdate=False
 		UpdateBindingsList(hideshowall.props.active)
-		Ctx.Write()
+		AllowUpdate=True
+		WriteSettings()
 
 def CatClicked(wid,event,CatInfo):
 	for s in AllCats:
@@ -291,7 +297,7 @@
 		GenStore.set(Iter,1,set.Value[0])
 	else:
 		GenStore.set(Iter,3,set.Value[1])
-	Ctx.Write()
+	WriteSettings()
 	AllowUpdate=True
 
 def SetWidgetsForSetting(setting):
@@ -366,7 +372,7 @@
 				val+=[set[1][1].get(Iter,0)[0]]
 				Iter=set[1][1].iter_next(Iter)
 			setting.Value=val
-	Ctx.Write()
+	WriteSettings()
 	AllowUpdate=False
 	SetWidgetsForSetting(setting)
 	AllowUpdate=True
@@ -604,7 +610,7 @@
 			trySetBinding(set,1,bent.get_text())
 		AllowUpdate=False
 		GenStore.set(Iter,1,set.Value[0],3,set.Value[1])
-		Ctx.Write()
+		WriteSettings()
 		AllowUpdate=True
 	dlg.destroy()
 
@@ -646,7 +652,7 @@
 		oset.Value=[vv[0],vv[1],vv[2],ne]
 	vals=wid.get_model().get(Iter,1,2)
 	if (vals[0]=='' and vals[1]==''):
-		Ctx.Write()
+		WriteSettings()
 		return
 	set=Ctx.Plugin(vals[0]).Setting(vals[1])
 	vv=set.Value
@@ -654,7 +660,7 @@
 	if not (ne.__contains__(berylsettings.edgetolist(edg)[0])):
 		ne=ne+berylsettings.edgetolist(edg)
 	set.Value=[vv[0],vv[1],vv[2],ne]
-	Ctx.Write()
+	WriteSettings()
 
 def MakeEdgeWidgets():
 	global AllowUpdate
@@ -709,7 +715,7 @@
 		set[0].Value=[v0,v1,set[0].Value[2],v3]
 	else:
 		set[0].ResetToDefault()
-	Ctx.Write()
+	WriteSettings()
 	AllowUpdate=False
 	SetWidgetsForSetting(set[0])
 	AllowUpdate=True




More information about the commits mailing list