[Sugar-devel] [PATCH sugar-toolkit] Add TODOs reminding us to escape labels by default

Sascha Silbe silbe at activitycentral.com
Mon Jul 18 17:50:54 EDT 2011


Changing API now to escape labels by default would be more trouble than it's
worth (all activities would need changing, distinguishing between pre and
post API change sugar-toolkit versions). The upcoming GTK-3 port, however,
is a nice opportunity for this kind of change.

Signed-off-by: Sascha Silbe <silbe at activitycentral.com>
---
 src/sugar/graphics/menuitem.py |    2 ++
 src/sugar/graphics/palette.py  |    4 ++++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/sugar/graphics/menuitem.py b/src/sugar/graphics/menuitem.py
index 655f7cc..5b7ad24 100644
--- a/src/sugar/graphics/menuitem.py
+++ b/src/sugar/graphics/menuitem.py
@@ -32,6 +32,8 @@ class MenuItem(gtk.ImageMenuItem):
 
     def __init__(self, text_label=None, icon_name=None, text_maxlen=60,
                  xo_color=None, file_name=None):
+        # TODO: for the GTK-3 port we should escape the label by default and
+        # add API for the rare case somebody actually wants to use markup.
         gobject.GObject.__init__(self)
         self._accelerator = None
 
diff --git a/src/sugar/graphics/palette.py b/src/sugar/graphics/palette.py
index 46f167b..c68185f 100644
--- a/src/sugar/graphics/palette.py
+++ b/src/sugar/graphics/palette.py
@@ -231,6 +231,8 @@ class Palette(PaletteWindow):
         self._label.props.accel_widget = self.props.invoker.props.widget
 
     def set_primary_text(self, label, accel_path=None):
+        # TODO: for the GTK-3 port we should escape the label by default and
+        # add API for the rare case somebody actually wants to use markup.
         self._primary_text = label
 
         if label is not None:
@@ -245,6 +247,8 @@ class Palette(PaletteWindow):
                                     setter=set_primary_text)
 
     def set_secondary_text(self, label):
+        # TODO: for the GTK-3 port we should escape the label by default and
+        # add API for the rare case somebody actually wants to use markup.
         if label is not None:
             label = label.split('\n', 1)[0]
         self._secondary_text = label
-- 
1.7.5.4



More information about the Sugar-devel mailing list