[beryl-commits] r2218 - trunk/beryl-settings-2
quinn at server.beryl-project.org
quinn at server.beryl-project.org
Mon Jan 1 14:26:41 CET 2007
Author: quinn
Date: 2007-01-01 13:26:40 +0000 (Mon, 01 Jan 2007)
New Revision: 2218
Modified:
trunk/beryl-settings-2/main.py
Log:
use new hints to create browse buttons when needed
Modified: trunk/beryl-settings-2/main.py
===================================================================
--- trunk/beryl-settings-2/main.py 2007-01-01 13:21:47 UTC (rev 2217)
+++ trunk/beryl-settings-2/main.py 2007-01-01 13:26:40 UTC (rev 2218)
@@ -221,7 +221,7 @@
if (m.Restrictions[1]):
mv1=m.Value[1]
else:
- mv1=m.Value[1]
+ mv1="N/A"
GenStore.set(SIter,0,m.ShortDesc,1,mv0,2,m.Restrictions[0],
3,mv1,4,m.Restrictions[1],5,p.Name,6,m.Name)
@@ -231,8 +231,8 @@
def MakeBindingsList():
genview=gtk.TreeView(GenStore)
genview.insert_column_with_attributes(0,"Name",gtk.CellRendererText(),text=0)
- genview.insert_column_with_attributes(1,"Key",gtk.CellRendererText(),text=1,editable=2)
- genview.insert_column_with_attributes(2,"Button",gtk.CellRendererText(),text=3,editable=4)
+ genview.insert_column_with_attributes(1,"Key",gtk.CellRendererText(),text=1,editable=2,sensitive=2)
+ genview.insert_column_with_attributes(2,"Button",gtk.CellRendererText(),text=3,editable=4,sensitive=4)
genview.props.headers_visible=False
genview.props.rules_hint=True
cont=gtk.ScrolledWindow()
@@ -342,9 +342,10 @@
delete.props.image=gtk.image_new_from_stock(gtk.STOCK_DELETE,gtk.ICON_SIZE_BUTTON)
tab.attach(up,0,1,0,1)
tab.attach(dn,0,1,2,3)
- #brw=gtk.Button("Browse")
- #brw.props.image=gtk.image_new_from_stock(gtk.STOCK_OPEN,gtk.ICON_SIZE_BUTTON)
- #tab.attach(brw,0,2,1,2)
+ if (setting.HasHint("file")):
+ brw=gtk.Button("Browse")
+ brw.props.image=gtk.image_new_from_stock(gtk.STOCK_OPEN,gtk.ICON_SIZE_BUTTON)
+ tab.attach(brw,0,2,1,2)
tab.attach(add,1,2,0,1)
tab.attach(delete,1,2,2,3)
bar.pack_start(tab,False,False)
@@ -360,6 +361,10 @@
else:
bar=gtk.Entry()
bar.props.width_chars=40
+ if (setting.HasHint("file")):
+ brw=gtk.Button("Browse")
+ brw.props.image=gtk.image_new_from_stock(gtk.STOCK_OPEN,gtk.ICON_SIZE_BUTTON)
+ foo.pack_end(brw,False,False)
foo.pack_end(bar,False,False)
SetWid=[bar]
elif (setting.Type == 'Int' or setting.Type=='Float'):
@@ -380,7 +385,7 @@
bat=gtk.SpinButton(Adj,setting.Restrictions[2],4)
else:
bar.props.digits=0
- bat=gtk.SpinButton(Adj,1,1)
+ bat=gtk.SpinButton(Adj,1,0)
baz.pack_start(bar,True,True)
baz.pack_start(bat,False,False)
SetWid=[bar,bat]
More information about the commits
mailing list