From: Stefanos Harhalakis Date: Thu, 13 Jan 2011 22:51:16 +0000 (+0000) Subject: Added logging capability if /tmp/drlaunch.log is present. X-Git-Url: https://vcs.maemo.org/git/?p=drlaunch;a=commitdiff_plain;h=1e08599a081f6130dfe9818b4c6aa535f70d5cc1 Added logging capability if /tmp/drlaunch.log is present. Added no-background config option. --- diff --git a/src/config.py b/src/config.py index 2ea4256..91e0a2e 100755 --- a/src/config.py +++ b/src/config.py @@ -66,6 +66,7 @@ class Config: self.indiv=True self.longpress=False self.animate=True + self.nobg=False self.maxsz=(8,4) @@ -99,6 +100,12 @@ class Config: 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 @@ -122,7 +129,7 @@ class Config: if dt==None: dt={ - 'version': 4, + 'version': 5, 'data': {}, } @@ -132,6 +139,7 @@ class Config: 'indiv': self.getIndiv(), 'longpress': self.getLongpress(), 'animate': self.getAnimate(), + 'nobg': self.getNoBg(), } fn=get_config_fn() @@ -175,6 +183,14 @@ class Config: 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() @@ -195,6 +211,9 @@ class Config: if ret['version']==3: ret=parse_v3(ret) + + if ret['version']==4: + ret=parse_v4(ret) except: ret=None @@ -217,6 +236,7 @@ class Config: self.setIndiv(dt['indiv']) self.setLongpress(dt['longpress']) self.setAnimate(dt['animate']) + self.setNoBg(dt['nobg']) def check_init(self): if self.id==None: diff --git a/src/drlaunch_widget.py b/src/drlaunch_widget.py index e5e27bf..c0f1f2a 100755 --- a/src/drlaunch_widget.py +++ b/src/drlaunch_widget.py @@ -22,6 +22,7 @@ __version__ = "$Id: 0.py 2265 2010-02-21 19:16:26Z v13 $" +import os.path from drlaunch import widget class DrlaunchPlugin(widget.DrlaunchPlugin): @@ -39,6 +40,9 @@ def redirect_err(): hd_plugin_type = DrlaunchPlugin +if os.path.exists('/tmp/drlaunch.log'): + redirect_err() + if __name__=="__main__": import gobject import gtk diff --git a/src/icon.py b/src/icon.py index a16f3bc..2982bf3 100755 --- a/src/icon.py +++ b/src/icon.py @@ -224,11 +224,12 @@ class Icon(gobject.GObject): 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: diff --git a/src/widget.py b/src/widget.py index ac912e5..8a8bd3c 100755 --- a/src/widget.py +++ b/src/widget.py @@ -161,6 +161,7 @@ class DrlaunchPlugin(IconGrid, HomePluginItem, FremantleRotation): config.setIndiv(dt['indiv']) config.setLongpress(dt['longpress']) config.setAnimate(dt['animate']) + config.setNoBg(dt['nobg']) config.save() # Resize widget @@ -176,6 +177,7 @@ class DrlaunchPlugin(IconGrid, HomePluginItem, FremantleRotation): 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): diff --git a/src/win_config.py b/src/win_config.py index 6d083b1..ba0eac2 100755 --- a/src/win_config.py +++ b/src/win_config.py @@ -130,9 +130,18 @@ class WinConfig(StackableWindow): #, FremantleRotation): # ----------------------------------------------- # 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, @@ -162,6 +171,7 @@ class WinConfig(StackableWindow): #, FremantleRotation): 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) @@ -331,6 +341,9 @@ class WinConfig(StackableWindow): #, FremantleRotation): 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() @@ -419,6 +432,7 @@ class WinConfig(StackableWindow): #, FremantleRotation): indiv=self.buttonRotateIndividually.get_active() lp=self.buttonRequireLongpress.get_active() ar=self.buttonAnimateRotation.get_active() + nobg=self.buttonNoBackground.get_active() ret={ 'size': sz, @@ -426,6 +440,7 @@ class WinConfig(StackableWindow): #, FremantleRotation): 'indiv': indiv, 'longpress': lp, 'animate': ar, + 'nobg': nobg, } return(ret)