Patch: Screenlets randomly overrides options with theme default on reload.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Screenlets |
Fix Committed
|
Undecided
|
Unassigned |
Bug Description
Quite a few screenlets use theme.conf to set different settings like 'text_color' which can then be customised by the user.
eg: AppMenu, Clock, DiskSpace, FeedReader, and Output screenlets all use these theme options overrides, from a quick look, there are probably many more.
But on reload, any option saved before the theme_name (in the unordered dictionary) will be overridden by the theme options.
To reproduce this bug: If I set the shadow colour of the 'Output' screenlet and reload it, the shadow_color doesn't get saved, but all other colours are.
my 'Output1.ini' looks like this:
opacity=1.0
shadow_
scale=1.0
run=dmesg
theme_name=default
is_sticky=False
frame_
h=404
is_widget=True
text_color=
width=380
iner_frame_
keep_above=False
is_dragged=False
w=380
keep_below=True
y=34
x=986
skip_taskbar=True
height=404
My fix is:
'session.py' from line 422 in '__restore_
replace:
if opts:
for o in opts:
# get the attribute's Option-object from Screenlet
opt = screenlet.
# NOTE: set attribute in Screenlet by calling the
# on_import-function for the Option (to import
# the value as the required type)
if opt:
setattr(
with:
if opts:
#theme must be read in first so the user's options are not overridden
for o in opts:
opt = screenlet.
if opt and opt.name=
for o in opts:
# get the attribute's Option-object from Screenlet
opt = screenlet.
# NOTE: set attribute in Screenlet by calling the
# on_import-function for the Option (to import
# the value as the required type)
if opt and opt.name!
setattr(
There is probably also a cleaner way to do this, my python is rusty :p
Related branches
Changed in screenlets: | |
status: | New → Fix Committed |
Can you use Bazaar in Launchpad? It would be okay, if you implemented the corrections yourself... If you don't want to do that, hopefully someone else will... Please let us know, how you feel about it.