Re: [gDesklets] submit two desklets

So, the mailing list ate the attachment again... *grml* >:(

Here's the clock.display file again...
<?xml version="1.0" encoding="UTF-8"?>

<display window-flags="sticky, below" anchor="center">

 <meta author="Martin Grimme"
       description="A scalable and configurable clock for your desktop."

<!-- 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"/>


 <!-- 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"/>

     <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 label="Date">
     <string label="Output format:" bind="date_format"
             help="The ouput format of the date."/>
     <boolean label="Display date" bind=""/>
     <font label="Font:" bind=""/>
     <color label="Text color:" bind=""/>
<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 id="city" label="Location:" bind="tz_city" callback="city_cb"/>

     <boolean label="Display timezone" bind=""/>
     <font label="Font:" bind=""/>
     <color label="Text color:" bind=""/>

 <script uri="timezones.script"/>

   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): = CITIES[value]

   def city_cb(key, value):

       if (tz_continent and tz_city):
           tz = tz_continent + "/" + tz_city
           tz = tz_city
       time.timezone = tz = 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) = \
                "<svg width='100' height='100'>" + \
                "<g transform='translate(50,50)'>" + \
                body + \

   def set_scale(value):

       Dsp.clock.width = Unit(value, CM)
       Dsp.clock.height = Unit(value, CM)

   def do_date(value):

       y, m, d = value
       out = date_format.replace("%y", `y`) \
                        .replace("%m", `m`) \
                        .replace("%d", `d`) = out

   # retrieve the time control
   time = get_control("ITime:9y703dqtfnv4w373caserz68r")

   # watch date and time
   time.bind("date", do_date)
   time.bind("time", do_time)




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.


Robo Pastierovic schrieb:
Xusheng Hou Sun COM wrote:
I've submit two desklets(Clock and WorldTime) to 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.

gDesklets-list mailing list
gDesklets-list gnome org


gDesklets-list mailing list
gDesklets-list gnome org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]