[gnome-clocks] Escape city name, just in case...



commit 61b2a04e7a36015ddc781a2e6869f88a8ce89314
Author: Paolo Borelli <pborelli gnome org>
Date:   Mon Aug 27 14:13:53 2012 +0200

    Escape city name, just in case...

 gnomeclocks/app.py     |    7 ++++---
 gnomeclocks/widgets.py |    6 ++++--
 2 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/gnomeclocks/app.py b/gnomeclocks/app.py
index 5b98740..08936d8 100644
--- a/gnomeclocks/app.py
+++ b/gnomeclocks/app.py
@@ -87,8 +87,7 @@ class Window(Gtk.ApplicationWindow):
 
     def _on_show_clock(self, widget, d):
         def show_standalone_clock():
-            self.toolbar._set_single_toolbar()
-            self.toolbar.city_label.set_markup("<b>%s</b>" % (d.id))
+            self.toolbar._set_single_toolbar(d.id)
             self.single_evbox.add(d.get_standalone_widget())
             self.single_evbox.show_all()
             self.notebook.set_current_page(-1)
@@ -353,13 +352,15 @@ class ClocksToolbar(Gtk.Toolbar):
         self.backButton.hide()
         self.city_label.hide()
 
-    def _set_single_toolbar(self):
+    def _set_single_toolbar(self, title):
         self.buttonBox.hide()
         self.newButton.hide()
         self.selectButton.hide()
         if not self.backButton.get_parent():
             self.leftBox.pack_start(self.backButton, False, False, 0)
         self.backButton.show_all()
+        label = GLib.markup_escape_text(title)
+        self.city_label.set_markup("<b>%s</b>" % label)
         self.city_label.show()
 
     def _on_toggled(self, widget, view):
diff --git a/gnomeclocks/widgets.py b/gnomeclocks/widgets.py
index 75d509a..c8ba641 100644
--- a/gnomeclocks/widgets.py
+++ b/gnomeclocks/widgets.py
@@ -16,7 +16,8 @@
 #
 # Author: Seif Lotfy <seif lotfy collabora co uk>
 
-from gi.repository import Gtk, Gdk, GdkPixbuf, GObject, Gio, Pango, PangoCairo
+from gi.repository import GLib, Gio, GObject
+from gi.repository import Gtk, Gdk, GdkPixbuf, Pango, PangoCairo
 from gi.repository import GWeather, Clutter, GtkClutter
 
 from storage import Location
@@ -233,7 +234,8 @@ class DigitalClockStandalone(Gtk.VBox):
         self.img = Gtk.Image()
         self.time_label = Gtk.Label()
         self.city_label = Gtk.Label()
-        self.city_label.set_markup("<b>" + location.get_city_name() + "</b>")
+        label = GLib.markup_escape_text(location.get_city_name())
+        self.city_label.set_markup("<b>%s</b>" % label)
         self.text = ""
         self.sunrise = sunrise
         self.sunset = sunset



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