~ubuntu-branches/ubuntu/maverick/awn-extras-applets/maverick

« back to all changes in this revision

Viewing changes to applets/maintained/cairo-clock/cairo-clock.py

  • Committer: Bazaar Package Importer
  • Author(s): Julien Lavergne
  • Date: 2010-08-29 14:29:52 UTC
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: james.westby@ubuntu.com-20100829142952-rhvuetyms9bv5uu7
Tags: upstream-0.4.0+bzr1372
ImportĀ upstreamĀ versionĀ 0.4.0+bzr1372

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
pygtk.require("2.0")
21
21
import gtk
22
22
 
23
 
from awn.extras import awnlib, __version__
 
23
from awn.extras import _, awnlib, __version__
24
24
import cairo
25
25
 
26
26
from analogclock import *
27
27
import locations, weather
28
28
 
29
 
applet_name = "Cairo Clock"
30
 
applet_description = "Applet that displays an analog clock and supports additional clocks for different locations"
 
29
applet_name = _("Cairo Clock")
 
30
applet_description = _("Applet that displays an analog clock and supports additional clocks for different locations")
31
31
 
32
32
# Logo of the applet, shown in the GTK About dialog
33
33
applet_logo = os.path.join(os.path.dirname(__file__), "cairo-clock-logo.svg")
152
152
        prefs = gtk.Builder()
153
153
        prefs.add_from_file(ui_file)
154
154
 
 
155
        self.binder = self.applet.settings.get_binder(prefs)
 
156
 
155
157
        self.setup_general_preferences(prefs)
156
158
        self.setup_plugins_preferens(prefs)
157
159
 
161
163
    def setup_general_preferences(self, prefs):
162
164
        container = gtk.VBox()
163
165
        prefs.get_object("vbox-general").reparent(container)
164
 
        self.preferences_notebook.append_page(container, gtk.Label("General"))
 
166
        self.preferences_notebook.append_page(container, gtk.Label(_("General")))
165
167
 
166
168
        refresh_title = lambda v: self.__clock_updater.update_title()
167
169
        refresh_clock = lambda v: self.__clock_updater.draw_clock_cb()
183
185
        if self.applet.settings["theme"] not in self.themes:
184
186
            self.applet.settings["theme"] = default_theme
185
187
 
186
 
        self.binder = self.applet.settings.get_binder(prefs)
187
188
        self.binder.bind("time-24-format", "radio-24-format", key_callback=refresh_title)
188
189
        self.binder.bind("time-date", "check-time-date", key_callback=refresh_title)
189
190
        self.binder.bind("time-seconds", "check-time-seconds", key_callback=refresh_title)
262
263
            format = hours + ":%M" + seconds + ampm
263
264
 
264
265
            if self.applet.settings["time-date"]:
265
 
                format = "%a %b %d " + format + " %Y"
 
266
                format = format + ", %A, %d %B %Y"
266
267
 
267
268
        self.applet.tooltip.set(time.strftime(format, local_time))
268
269