Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 2cfde418a97b0f63387a8807e6dcf0014b996fe8 Mon Sep 17 00:00:00 2001
- From: Martin Abente Lahaye <tch@sugarlabs.org>
- Date: Fri, 20 Jul 2012 15:02:16 -0400
- Subject: [PATCH] test1
- ---
- src/jarabe/journal/volumestoolbar.py | 27 +++++++++++++++++++++++++++
- 1 file changed, 27 insertions(+)
- diff --git a/src/jarabe/journal/volumestoolbar.py b/src/jarabe/journal/volumestoolbar.py
- index 71b6ea8..fe48e68 100644
- --- a/src/jarabe/journal/volumestoolbar.py
- +++ b/src/jarabe/journal/volumestoolbar.py
- @@ -191,6 +191,7 @@ class VolumesToolbar(gtk.Toolbar):
- def _set_up_volumes(self):
- self._set_up_documents_button()
- + self._set_up_examples_button()
- volume_monitor = gio.volume_monitor_get()
- self._mount_added_hid = volume_monitor.connect('mount-added',
- @@ -216,6 +217,21 @@ class VolumesToolbar(gtk.Toolbar):
- self._volume_buttons.append(button)
- self.show()
- + def _set_up_examples_button(self):
- + examples_path = '/home/tch/Devel/sugar-build/install/share/sugar/activities/TurtleArt.activity/Examples'
- + if examples_path is not None:
- + button = ExamplesButton(examples_path)
- + button.props.group = self._volume_buttons[0]
- + label = glib.markup_escape_text(_('Examples'))
- + button.set_palette(Palette(label))
- + button.connect('toggled', self._button_toggled_cb)
- + button.show()
- +
- + position = self.get_item_index(self._volume_buttons[-1]) + 1
- + self.insert(button, position)
- + self._volume_buttons.append(button)
- + self.show()
- +
- def __mount_added_cb(self, volume_monitor, mount):
- self._add_button(mount)
- @@ -402,3 +418,14 @@ class DocumentsButton(BaseButton):
- client = gconf.client_get_default()
- color = XoColor(client.get_string('/desktop/sugar/user/color'))
- self.props.xo_color = color
- +
- +class ExamplesButton(BaseButton):
- +
- + def __init__(self, examples_path):
- + BaseButton.__init__(self, mount_point=examples_path)
- +
- + self.props.named_icon = 'user-documents'
- +
- + client = gconf.client_get_default()
- + color = XoColor(client.get_string('/desktop/sugar/user/color'))
- + self.props.xo_color = color
- --
- 1.7.10.4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement