[Trac #559] icons inside activities are not loaded

Zarro Boogs per Child bugtracker at laptop.org
Fri Jan 12 00:22:34 EST 2007


#559: icons inside activities are not loaded
------------------------+---------------------------------------------------
 Reporter:  ywwg        |        Owner:  ywwg   
     Type:  defect      |       Status:  new    
 Priority:  high        |    Milestone:  BTest-2
Component:  distro      |   Resolution:         
 Keywords:  sugar-love  |  
------------------------+---------------------------------------------------
Comment (by godiard):

 Marco:
 What you think about this try?
 We are in time to BTest2?

 {{{
 [gonzalo at nautilus sugar-jhbuild]$ diff -U0
 ./source/sugar/sugar/graphics/canvasicon.py ./build/lib/python2.4/site-
 packages/sugar/graphics/canvasicon.py
 --- ./source/sugar/sugar/graphics/canvasicon.py 2007-01-11
 07:23:32.000000000 -0300
 +++ ./build/lib/python2.4/site-packages/sugar/graphics/canvasicon.py
 2007-01-12 00:22:40.000000000 -0300
 @@ -55,13 +55,22 @@
 -        info = self._theme.lookup_icon(name, int(size), 0)
 -
 -        if color:
 -            key = (info.get_filename(), color.to_string())
 -        else:
 -            key = info.get_filename()
 -
 -        if self._icons.has_key(key):
 -            icon = self._icons[key]
 -        else:
 -            icon = self._read_icon(info.get_filename(), color)
 -            self._icons[key] = icon
 -        return icon
 +        logging.debug("* NOMBRE ICON: "+name)
 +       if name[0:6] == "theme:":
 +            name = name[6:]
 +            logging.debug("* CANVASICON NOMBRE ICON (THEME): "+name)
 +
 +            info = self._theme.lookup_icon(name, int(size), 0)
 +
 +            if color:
 +                key = (info.get_filename(), color.to_string())
 +            else:
 +                key = info.get_filename()
 +
 +            if self._icons.has_key(key):
 +                icon = self._icons[key]
 +            else:
 +                icon = self._read_icon(info.get_filename(), color)
 +                self._icons[key] = icon
 +            return icon
 +       else:
 +            logging.debug("* CANVASICON NOMBRE ICON (FILEE): "+name)
 +            icon = self._read_icon(name, color)
 +            return icon

 [gonzalo at nautilus sugar-jhbuild]$ diff -U0
 ./source/sugar/sugar/activity/bundle.py ./build/lib/python2.4/site-
 packages/sugar/activity/bundle.py
 --- ./source/sugar/sugar/activity/bundle.py     2007-01-11
 07:23:32.000000000 -0300
 +++ ./build/lib/python2.4/site-packages/sugar/activity/bundle.py
 2007-01-12 02:22:52.000000000 -0300
 @@ -52,0 +53,5 @@
 +            if
 os.path.isfile(os.path.join(os.path.dirname(info_path),self._icon+".svg")):
 +               self._icon =
 os.path.join(os.path.dirname(info_path),self._icon+".svg")
 +           else:
 +                self._icon = "theme:"+self._icon
 +           logging.debug("************************** NOMBRE ICON:
 "+self._icon)

 [gonzalo at nautilus sugar-jhbuild]$ diff -U0
 ./source/sugar/shell/view/frame/ZoomBox.py
 ./build/share/sugar/shell/view/frame/ZoomBox.py
 --- ./source/sugar/shell/view/frame/ZoomBox.py  2007-01-11
 07:23:32.000000000 -0300
 +++ ./build/share/sugar/shell/view/frame/ZoomBox.py     2007-01-12
 02:36:35.000000000 -0300
 @@ -40 +40 @@
 -        icon = CanvasIcon(icon_name='stock-share-mesh')
 +        icon = CanvasIcon(icon_name='theme:stock-share-mesh')
 @@ -44 +44 @@
 -        icon = CanvasIcon(icon_name='stock-close')
 +        icon = CanvasIcon(icon_name='theme:stock-close')
 @@ -84 +84 @@
 -        icon = CanvasIcon(icon_name='stock-zoom-mesh')
 +        icon = CanvasIcon(icon_name='theme:stock-zoom-mesh')
 @@ -89 +89 @@
 -        icon = CanvasIcon(icon_name='stock-zoom-friends')
 +        icon = CanvasIcon(icon_name='theme:stock-zoom-friends')
 @@ -94 +94 @@
 -        icon = CanvasIcon(icon_name='stock-zoom-home')
 +        icon = CanvasIcon(icon_name='theme:stock-zoom-home')
 @@ -99 +99 @@
 -        icon = CanvasIcon(icon_name='stock-zoom-activity')
 +        icon = CanvasIcon(icon_name='theme:stock-zoom-activity')

 [gonzalo at nautilus sugar-jhbuild]$ diff -U0
 ./source/sugar/shell/view/frame/overlaybox.py
 ./build/share/sugar/shell/view/frame/overlaybox.py
 --- ./source/sugar/shell/view/frame/overlaybox.py       2007-01-11
 07:23:32.000000000 -0300
 +++ ./build/share/sugar/shell/view/frame/overlaybox.py  2007-01-12
 02:37:56.000000000 -0300
 @@ -12 +12 @@
 -        icon = CanvasIcon(icon_name='stock-chat')
 +        icon = CanvasIcon(icon_name='theme:stock-chat')

 [gonzalo at nautilus sugar-jhbuild]$ diff -U0
 ./source/sugar/shell/view/home/MyIcon.py
 ./build/share/sugar/shell/view/home/MyIcon.py
 --- ./source/sugar/shell/view/home/MyIcon.py    2007-01-11
 07:23:32.000000000 -0300
 +++ ./build/share/sugar/shell/view/home/MyIcon.py       2007-01-12
 02:38:42.000000000 -0300
 @@ -22 +22 @@
 -        CanvasIcon.__init__(self, icon_name='stock-buddy',
 +        CanvasIcon.__init__(self, icon_name='theme:stock-buddy',

 [gonzalo at nautilus sugar-jhbuild]$ diff -U0
 ./source/sugar/shell/view/BuddyIcon.py
 ./build/share/sugar/shell/view/BuddyIcon.py
 --- ./source/sugar/shell/view/BuddyIcon.py      2007-01-11
 07:23:32.000000000 -0300
 +++ ./build/share/sugar/shell/view/BuddyIcon.py 2007-01-12
 02:46:02.000000000 -0300
 @@ -22 +22 @@
 -        MenuIcon.__init__(self, menu_shell, icon_name='stock-buddy',
 +        MenuIcon.__init__(self, menu_shell, icon_name='theme:stock-
 buddy',

 [gonzalo at nautilus sugar-jhbuild]$ diff -U0
 ./source/sugar/shell/view/BuddyMenu.py
 ./build/share/sugar/shell/view/BuddyMenu.py
 --- ./source/sugar/shell/view/BuddyMenu.py      2007-01-11
 07:23:32.000000000 -0300
 +++ ./build/share/sugar/shell/view/BuddyMenu.py 2007-01-12
 02:40:40.000000000 -0300
 @@ -85 +85 @@
 -            icon = CanvasIcon(icon_name='stock-remove')
 +            icon = CanvasIcon(icon_name='theme:stock-remove')
 @@ -88 +88 @@
 -            icon = CanvasIcon(icon_name='stock-add')
 +            icon = CanvasIcon(icon_name='theme:stock-add')
 @@ -97 +97 @@
 -            icon = CanvasIcon(icon_name='stock-invite')
 +            icon = CanvasIcon(icon_name='theme:stock-invite')

 [gonzalo at nautilus sugar-jhbuild]$ diff -U0
 ./source/sugar/shell/view/clipboardmenu.py
 ./build/share/sugar/shell/view/clipboardmenu.py
 --- ./source/sugar/shell/view/clipboardmenu.py  2007-01-11
 07:23:32.000000000 -0300
 +++ ./build/share/sugar/shell/view/clipboardmenu.py     2007-01-12
 02:41:22.000000000 -0300
 @@ -41 +41 @@
 -                self._remove_icon = CanvasIcon(icon_name='stock-remove')
 +                self._remove_icon = CanvasIcon(icon_name='theme:stock-
 remove')
 @@ -49 +49 @@
 -                self._stop_icon = CanvasIcon(icon_name='stock-close')
 +                self._stop_icon = CanvasIcon(icon_name='theme:stock-
 close')

 }}}

-- 
Ticket URL: <http://dev.laptop.org/ticket/559#comment:5>
One Laptop Per Child <http://laptop.org/>



More information about the Bugs mailing list