Advertisement
Guest User

Untitled

a guest
Jul 20th, 2012
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.28 KB | None | 0 0
  1. From 2cfde418a97b0f63387a8807e6dcf0014b996fe8 Mon Sep 17 00:00:00 2001
  2. From: Martin Abente Lahaye <tch@sugarlabs.org>
  3. Date: Fri, 20 Jul 2012 15:02:16 -0400
  4. Subject: [PATCH] test1
  5.  
  6. ---
  7.  src/jarabe/journal/volumestoolbar.py |   27 +++++++++++++++++++++++++++
  8.  1 file changed, 27 insertions(+)
  9.  
  10. diff --git a/src/jarabe/journal/volumestoolbar.py b/src/jarabe/journal/volumestoolbar.py
  11. index 71b6ea8..fe48e68 100644
  12. --- a/src/jarabe/journal/volumestoolbar.py
  13. +++ b/src/jarabe/journal/volumestoolbar.py
  14. @@ -191,6 +191,7 @@ class VolumesToolbar(gtk.Toolbar):
  15.  
  16.      def _set_up_volumes(self):
  17.          self._set_up_documents_button()
  18. +   self._set_up_examples_button()
  19.  
  20.          volume_monitor = gio.volume_monitor_get()
  21.          self._mount_added_hid = volume_monitor.connect('mount-added',
  22. @@ -216,6 +217,21 @@ class VolumesToolbar(gtk.Toolbar):
  23.              self._volume_buttons.append(button)
  24.              self.show()
  25.  
  26. +    def _set_up_examples_button(self):
  27. +        examples_path = '/home/tch/Devel/sugar-build/install/share/sugar/activities/TurtleArt.activity/Examples'
  28. +        if examples_path is not None:
  29. +            button = ExamplesButton(examples_path)
  30. +            button.props.group = self._volume_buttons[0]
  31. +            label = glib.markup_escape_text(_('Examples'))
  32. +            button.set_palette(Palette(label))
  33. +            button.connect('toggled', self._button_toggled_cb)
  34. +            button.show()
  35. +
  36. +            position = self.get_item_index(self._volume_buttons[-1]) + 1
  37. +            self.insert(button, position)
  38. +            self._volume_buttons.append(button)
  39. +            self.show()
  40. +
  41.      def __mount_added_cb(self, volume_monitor, mount):
  42.          self._add_button(mount)
  43.  
  44. @@ -402,3 +418,14 @@ class DocumentsButton(BaseButton):
  45.          client = gconf.client_get_default()
  46.          color = XoColor(client.get_string('/desktop/sugar/user/color'))
  47.          self.props.xo_color = color
  48. +
  49. +class ExamplesButton(BaseButton):
  50. +
  51. +    def __init__(self, examples_path):
  52. +        BaseButton.__init__(self, mount_point=examples_path)
  53. +
  54. +        self.props.named_icon = 'user-documents'
  55. +
  56. +        client = gconf.client_get_default()
  57. +        color = XoColor(client.get_string('/desktop/sugar/user/color'))
  58. +        self.props.xo_color = color
  59. --
  60. 1.7.10.4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement