Subject: [Tecnologia] [sugar 2/4] Add the option to mount any user directory to journal

From: "Jorge (jasg) Saldivar" <[email-masked]>
Date: Fri, 21 May 2010 17:18:13 -0400

From: Jorge Saldivar <jorge@jorge-laptop.(none)>

Signed-off-by: Jorge Saldivar Galli <[email-masked]>
---
 src/jarabe/journal/volumestoolbar.py |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/src/jarabe/journal/volumestoolbar.py b/src/jarabe/journal/volumestoolbar.py
index 74b974c..07e63a6 100644
--- a/src/jarabe/journal/volumestoolbar.py
+++ b/src/jarabe/journal/volumestoolbar.py
@@ -21,6 +21,7 @@ import gobject
 import gio
 import gtk
 import gconf
+import os
 
 from sugar.graphics.radiotoolbutton import RadioToolButton
 from sugar.graphics.palette import Palette
@@ -50,9 +51,18 @@ class VolumesToolbar(gtk.Toolbar):
         button.show()
         self._volume_buttons = [button]
 
+        button = DirectoryButton()
+        button.props.group = self._volume_buttons[0]
+        button.set_palette(Palette(_('Directory GNOME')))
+        button.connect('toggled', self._button_toggled_cb)
+        self.insert(button, 1)
+        button.show()
+        self._volume_buttons.append(button)
+
         self.connect('destroy', self.__destroy_cb)
 
         gobject.idle_add(self._set_up_volumes)
+	
 
     def __destroy_cb(self, widget):
         volume_monitor = gio.volume_monitor_get()
@@ -69,6 +79,7 @@ class VolumesToolbar(gtk.Toolbar):
         for mount in volume_monitor.get_mounts():
             self._add_button(mount)
 
+
     def __mount_added_cb(self, volume_monitor, mount):
         self._add_button(mount)
 
@@ -179,3 +190,14 @@ class JournalButton(BaseButton):
         color = XoColor(client.get_string('/desktop/sugar/user/color'))
         self.props.xo_color = color
 
+class DirectoryButton(BaseButton):
+    def __init__(self):
+        BaseButton.__init__(self, mount_point=os.environ['HOME'])
+        #BaseButton.__init__(self, mount_point="/tmp/hola")
+
+	    #self.props.active = False
+        self.props.named_icon = 'drive'
+
+        client = gconf.client_get_default()
+        color = XoColor(client.get_string('/desktop/sugar/user/color'))
+        self.props.xo_color = color
-- 
1.7.0.4

_______________________________________________
Tecnologia mailing list
[email-masked]
http://mail.paraguayeduca.org/mailman/listinfo/tecnologia