Re: [gDesklets] submit two desklets
- From: Martin Grimme <martin grimme lintegra de>
- To: gdesklets-list gnome org
- Subject: Re: [gDesklets] submit two desklets
- Date: Thu, 31 May 2007 22:18:06 +0200
So, the mailing list ate the attachment again... *grml* >:(
Here's the clock.display file again...
-------8<---------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<display window-flags="sticky, below" anchor="center">
<meta author="Martin Grimme"
version="0.50.1"
name="clock"
description="A scalable and configurable clock for your desktop."
preview="gfx/pocketwatch.png"/>
<!-- clock face consisting of a background image and a canvas for
displaying
the hands -->
<group id="main">
<image id="face" uri="gfx/clock.png"
image-width="100%" image-height="100%" width="100%"
height="100%"/>
<canvas id="clock" width="4cm" height="4cm"/>
</group>
<!-- date and timezone labels beneath the clock -->
<label id="date" relative-to="main, y" x="50%" anchor="n"
font="Serif bold 12" color="white"/>
<label id="tz" relative-to="date, y" anchor="n" font="Serif bold 12"
color="white" visible="False"/>
<!-- the preferences dialog -->
<prefs callback="prefs_cb">
<page label="Appearance">
<enum label="Face:" bind="clockface" help="What the clock looks
like.">
<item label="Plain" value="clock.png"/>
<item label="gDesklets" value="gdclock.png"/>
<item label="Royal Air Force" value="rafclock.png"/>
<item label="GNOME" value="gnomeclock.png"/>
<item label="OS-X" value="osXclock.png"/>
<item label="Grandpa's pocket watch" value="pocketwatch.png"/>
</enum>
<float label="Size:" bind="size" min="0.5" max="50.0"
help="The size of the clockface."/>
<boolean label="Show seconds" bind="show_seconds"/>
</page>
<page label="Date">
<string label="Output format:" bind="date_format"
help="The ouput format of the date."/>
<boolean label="Display date" bind="Dsp.date.visible"/>
<font label="Font:" bind="Dsp.date.font"/>
<color label="Text color:" bind="Dsp.date.color"/>
</page>
<page label="Timezone">
<enum id="continent" label="Region:" bind="tz_continent"
callback="continent_cb">
<item label="System Default" value=""/>
<item label="Africa" value="Africa"/>
<item label="America" value="America"/>
<item label="Antarctica" value="Antarctica"/>
<item label="Arctic" value="Arctic"/>
<item label="Asia" value="Asia"/>
<item label="Atlantic Ocean" value="Atlantic"/>
<item label="Australia" value="Australia"/>
<item label="Europe" value="Europe"/>
<item label="Indian Ocean" value="Indian"/>
<item label="Pacific Ocean" value="Pacific"/>
</enum>
<enum id="city" label="Location:" bind="tz_city" callback="city_cb"/>
<boolean label="Display timezone" bind="Dsp.tz.visible"/>
<font label="Font:" bind="Dsp.tz.font"/>
<color label="Text color:" bind="Dsp.tz.color"/>
</page>
</prefs>
<script uri="timezones.script"/>
<script>
#<![CDATA[
HAND_HOUR = "<path d='M-1 8 L-1.5 -20 L1.5 -20 L1 8Z' " \
" style='stroke:none;fill:black' " \
" transform='rotate(%f)'/>"
HAND_MINUTE = "<path d='M-1 10 L-1.5 -28 L1.5 -28 L1 10Z' " \
" style='stroke:none;fill:black' " \
" transform='rotate(%f)'/>"
HAND_SECOND = "<path d='M-0.5 10 L-0.5 -30 L0.5 -30 L0.5 10Z' " \
" style='stroke:none;fill:red' " \
" transform='rotate(%f)'/>"
clockface = "clock.png"
size = 4.0
date_format = "%d. %m. %y"
show_seconds = False
tz_continent = ""
tz_city = ""
def prefs_cb(key, value):
if (key == "clockface"): set_face(value)
elif (key == "size"): set_scale(value)
def continent_cb(key, value):
Prefs.city.items = CITIES[value]
def city_cb(key, value):
if (tz_continent and tz_city):
tz = tz_continent + "/" + tz_city
else:
tz = tz_city
time.timezone = tz
Dsp.tz.value = time.timezone
def set_face(face):
Dsp.face.uri = "gfx/" + face
def do_time(value):
h, m, s = value
h_angle = 360 / 12 * (h + (m / 60.0))
m_angle = 360 / 60 * (m + (s / 60.0))
s_angle = 360 / 60 * s
w = Dsp.clock.width.as_px()
h = Dsp.clock.height.as_px()
scalex = float(w) / 100
scaley = float(h) / 100
body = HAND_HOUR % (h_angle) + HAND_MINUTE % (m_angle)
if (show_seconds): body += HAND_SECOND % (s_angle)
Dsp.clock.graphics = \
"<svg width='100' height='100'>" + \
"<g transform='translate(50,50)'>" + \
body + \
"</g></svg>"
def set_scale(value):
Dsp.clock.width = Unit(value, CM)
Dsp.clock.height = Unit(value, CM)
do_time(time.time)
def do_date(value):
y, m, d = value
out = date_format.replace("%y", `y`) \
.replace("%m", `m`) \
.replace("%d", `d`)
Dsp.date.value = out
# retrieve the time control
time = get_control("ITime:9y703dqtfnv4w373caserz68r")
# watch date and time
time.bind("date", do_date)
time.bind("time", do_time)
set_scale(size)
set_face(clockface)
do_time(time.time)
]]>
</script>
</display>
--------------------------------------------->8-------------------------
Martin Grimme schrieb:
Hi all,
I have fixed the clock desklet, so that it no longer produces error
and deprecation logs. The .display file is attached.
I'm currently on dialup for a few days where I don't have the bzr
client, so I cannot check it into launchpad myself before Monday.
Cheers,
Martin
Robo Pastierovic schrieb:
Xusheng Hou Sun COM wrote:
Hello,
I've submit two desklets(Clock and WorldTime) to www.gdesklets.de
today.
But I wonder how to change the picture after I submit it?
I just put one of the WorldTime desklets instead of put another thin
version. Because I think this one is better.
Any opinion?
And I'm digging into the Clock one at the moment. seems like it keep
writing to the log file.
Hopefully can fix this latter.
I think this is related with the problem in gdesklets core - latest
version 0.35.4 observed with plotter element also.
Robo
_______________________________________________
gDesklets-list mailing list
gDesklets-list gnome org
http://mail.gnome.org/mailman/listinfo/gdesklets-list
------------------------------------------------------------------------
_______________________________________________
gDesklets-list mailing list
gDesklets-list gnome org
http://mail.gnome.org/mailman/listinfo/gdesklets-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]