Ticket #3076: 0001-Copying-to-Documents-folder-SL-3076.patch

File 0001-Copying-to-Documents-folder-SL-3076.patch, 2.2 KB (added by humitos, 12 years ago)

This patch is not finished. I don't know how to get the "selected_volume" yet

  • src/jarabe/journal/palettes.py

    From 8dac2abd86ee18e79f3e8a0dd0ae532abb077b19 Mon Sep 17 00:00:00 2001
    From: Manuel Kaufmann <humitos@gmail.com>
    Date: Fri, 12 Oct 2012 16:42:36 -0300
    Subject: [PATCH sugar] Copying to Documents folder SL #3076
    
    Avility to copy items to Documents folder from Journal's palette.
    
    Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
    ---
     src/jarabe/journal/palettes.py | 19 +++++++++++++++++--
     1 file changed, 17 insertions(+), 2 deletions(-)
    
    diff --git a/src/jarabe/journal/palettes.py b/src/jarabe/journal/palettes.py
    index 43f9905..4a9ef53 100644
    a b class CopyMenu(Gtk.Menu): 
    212212        self.append(clipboard_menu)
    213213        clipboard_menu.show()
    214214
     215        client = GConf.Client.get_default()
     216        color = XoColor(client.get_string('/desktop/sugar/user/color'))
     217
    215218        if self._metadata['mountpoint'] != '/':
    216             client = GConf.Client.get_default()
    217             color = XoColor(client.get_string('/desktop/sugar/user/color'))
    218219            journal_menu = VolumeMenu(self._metadata, _('Journal'), '/')
    219220            journal_menu.set_image(Icon(icon_name='activity-journal',
    220221                                        xo_color=color,
    class CopyMenu(Gtk.Menu): 
    223224            self.append(journal_menu)
    224225            journal_menu.show()
    225226
     227        documents_path = model.get_documents_path()
     228        # FIXME: I don't know how to get the selected_volume from the
     229        # MainToolbox
     230        selected_volume = None
     231        if selected_volume != documents_path:
     232            documents_menu = VolumeMenu(self._metadata, _('Documents'),
     233                                        documents_path)
     234            documents_menu.set_image(Icon(icon_name='user-documents',
     235                                          xo_color=color,
     236                                          icon_size=Gtk.IconSize.MENU))
     237            documents_menu.connect('volume-error', self.__volume_error_cb)
     238            self.append(documents_menu)
     239            documents_menu.show()
     240
    226241        volume_monitor = Gio.VolumeMonitor.get()
    227242        icon_theme = Gtk.IconTheme.get_default()
    228243        for mount in volume_monitor.get_mounts():