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

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

Add new version (v3) of patch, with the pending issue solved. Now only show the option when needed.

  • src/jarabe/journal/journaltoolbox.py

    From 1d34470694ca02a0bb613fa58655fe39ab264b85 Mon Sep 17 00:00:00 2001
    From: Gonzalo Odiard <godiard@gmail.com>
    Date: Thu, 22 Nov 2012 18:15:00 -0300
    Subject: [PATCH] Copying to Documents folder .v3 - SL #3076
    
    Avility to copy items to Documents folder from Journal's palette.
    
    Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
    Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
    
    v3: Show the option only when is not in the Documents folder
    ---
     src/jarabe/journal/journaltoolbox.py | 16 ++++++++++++++--
     src/jarabe/journal/palettes.py       | 16 ++++++++++++++--
     2 files changed, 28 insertions(+), 4 deletions(-)
    
    diff --git a/src/jarabe/journal/journaltoolbox.py b/src/jarabe/journal/journaltoolbox.py
    index e8b474b..b325a15 100644
    a b class DetailToolbox(ToolbarBox): 
    458458        palette.menu.append(clipboard_menu)
    459459        clipboard_menu.show()
    460460
     461        client = GConf.Client.get_default()
     462        color = XoColor(client.get_string('/desktop/sugar/user/color'))
     463
    461464        if self._metadata['mountpoint'] != '/':
    462             client = GConf.Client.get_default()
    463             color = XoColor(client.get_string('/desktop/sugar/user/color'))
    464465            journal_menu = VolumeMenu(self._metadata, _('Journal'), '/')
    465466            journal_menu.set_image(Icon(icon_name='activity-journal',
    466467                                        xo_color=color,
    class DetailToolbox(ToolbarBox): 
    469470            palette.menu.append(journal_menu)
    470471            journal_menu.show()
    471472
     473        documents_path = model.get_documents_path()
     474        if not self._metadata['uid'].startswith(documents_path):
     475            documents_menu = VolumeMenu(self._metadata, _('Documents'),
     476                                        documents_path)
     477            documents_menu.set_image(Icon(icon_name='user-documents',
     478                                          xo_color=color,
     479                                          icon_size=Gtk.IconSize.MENU))
     480            documents_menu.connect('volume-error', self.__volume_error_cb)
     481            palette.menu.append(documents_menu)
     482            documents_menu.show()
     483
    472484        volume_monitor = Gio.VolumeMonitor.get()
    473485        icon_theme = Gtk.IconTheme.get_default()
    474486        for mount in volume_monitor.get_mounts():
  • src/jarabe/journal/palettes.py

    diff --git a/src/jarabe/journal/palettes.py b/src/jarabe/journal/palettes.py
    index 6ab3375..44ae23f 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        if not self._metadata['uid'].startswith(documents_path):
     229            documents_menu = VolumeMenu(self._metadata, _('Documents'),
     230                                        documents_path)
     231            documents_menu.set_image(Icon(icon_name='user-documents',
     232                                          xo_color=color,
     233                                          icon_size=Gtk.IconSize.MENU))
     234            documents_menu.connect('volume-error', self.__volume_error_cb)
     235            self.append(documents_menu)
     236            documents_menu.show()
     237
    226238        volume_monitor = Gio.VolumeMonitor.get()
    227239        icon_theme = Gtk.IconTheme.get_default()
    228240        for mount in volume_monitor.get_mounts():