Added no-background config option.
self.indiv=True
self.longpress=False
self.animate=True
+ self.nobg=False
self.maxsz=(8,4)
def getAnimate(self):
return(self.animate)
+ def setNoBg(self, nobg):
+ self.nobg=nobg
+
+ def getNoBg(self):
+ return(self.nobg)
+
def setApps(self, aps):
""" apps is a dictionary of (x,y)=>appname """
self.apps=aps
if dt==None:
dt={
- 'version': 4,
+ 'version': 5,
'data': {},
}
'indiv': self.getIndiv(),
'longpress': self.getLongpress(),
'animate': self.getAnimate(),
+ 'nobg': self.getNoBg(),
}
fn=get_config_fn()
return(dt)
+ def parse_v4(self, dt):
+ dt['version']=5
+
+ for i in dt['data']:
+ dt['data'][i]['nobg']=False
+
+ return(dt)
+
def load_all(self):
fn=get_config_fn()
if ret['version']==3:
ret=parse_v3(ret)
+
+ if ret['version']==4:
+ ret=parse_v4(ret)
except:
ret=None
self.setIndiv(dt['indiv'])
self.setLongpress(dt['longpress'])
self.setAnimate(dt['animate'])
+ self.setNoBg(dt['nobg'])
def check_init(self):
if self.id==None:
__version__ = "$Id: 0.py 2265 2010-02-21 19:16:26Z v13 $"
+import os.path
from drlaunch import widget
class DrlaunchPlugin(widget.DrlaunchPlugin):
hd_plugin_type = DrlaunchPlugin
+if os.path.exists('/tmp/drlaunch.log'):
+ redirect_err()
+
if __name__=="__main__":
import gobject
import gtk
cr=gtk.gdk.CairoContext(cr0)
# Paint the background
- s2=self.mkbg(t)
- cr.save()
- cr.set_source_surface(s2, 0, 0)
- cr.paint()
- cr.restore()
+ if not self.config.getNoBg():
+ s2=self.mkbg(t)
+ cr.save()
+ cr.set_source_surface(s2, 0, 0)
+ cr.paint()
+ cr.restore()
# If there is no icon then don't do anything more
if self.icon!=None:
config.setIndiv(dt['indiv'])
config.setLongpress(dt['longpress'])
config.setAnimate(dt['animate'])
+ config.setNoBg(dt['nobg'])
config.save()
# Resize widget
def handle_click(self, sender, icon):
""" common handler for longpress and click """
if icon.name!=None and icon.name!='':
+ print "name:", icon.name
launcher.launch(icon.name)
def signalLongpress(self, sender, icon):
# -----------------------------------------------
# Second column of options
vbox=gtk.VBox()
+
al=gtk.Alignment(xalign=0, yalign=1, xscale=1)
al.add(vbox)
self.col2=al
+
+ but=hildon.CheckButton(
+ gtk.HILDON_SIZE_AUTO_WIDTH | gtk.HILDON_SIZE_FINGER_HEIGHT)
+ but.set_label("No background")
+ #but.connect('toggled', self.slotButtonNoBackground)
+ self.buttonNoBackground=but
+ vbox.add(but)
+
#1 hbox.add(al)
but=hildon.Button(
gtk.HILDON_SIZE_AUTO_WIDTH | gtk.HILDON_SIZE_FINGER_HEIGHT,
self.setIndiv(self.config.getIndiv())
self.setLongpress(self.config.getLongpress())
self.setAnimate(self.config.getAnimate())
+ self.setNoBg(self.config.getNoBg())
hbox=gtk.HBox()
hbox.add(self.col1)
def setAnimate(self, ar):
self.buttonAnimateRotation.set_active(ar)
+ def setNoBg(self, nobg):
+ self.buttonNoBackground.set_active(nobg)
+
def doConfig(self, icon):
aps=apps.scan()
indiv=self.buttonRotateIndividually.get_active()
lp=self.buttonRequireLongpress.get_active()
ar=self.buttonAnimateRotation.get_active()
+ nobg=self.buttonNoBackground.get_active()
ret={
'size': sz,
'indiv': indiv,
'longpress': lp,
'animate': ar,
+ 'nobg': nobg,
}
return(ret)