Ticket #1831: 0001-Revert-copy-to-Journal-palette-item-in-journal-detai.patch

File 0001-Revert-copy-to-Journal-palette-item-in-journal-detai.patch, 2.3 KB (added by alsroot, 13 years ago)
  • src/jarabe/journal/journaltoolbox.py

    From 58b2a0a77ffafede2891ffa955d7f98c1d8d8764 Mon Sep 17 00:00:00 2001
    From: Aleksey Lim <alsroot@member.fsf.org>
    Date: Mon, 15 Mar 2010 18:58:29 +0000
    Subject: Revert copy to "Journal" palette item in journal details view #1831
    
    
    diff --git a/src/jarabe/journal/journaltoolbox.py b/src/jarabe/journal/journaltoolbox.py
    index fe05657..61671bc 100644
    a b from sugar.graphics.xocolor import XoColor 
    3737from sugar.graphics import iconentry
    3838from sugar.graphics import style
    3939from sugar import mime
     40from sugar import profile
    4041
    4142from jarabe.model import bundleregistry
    4243from jarabe.journal import misc
    class EntryToolbar(gtk.Toolbar): 
    396397    def _resume_menu_item_activate_cb(self, menu_item, service_name):
    397398        misc.resume(self._metadata, service_name)
    398399
    399     def _copy_menu_item_activate_cb(self, menu_item, mount):
    400         model.copy(self._metadata, mount.get_root().get_path())
     400    def _copy_menu_item_activate_cb(self, menu_item, mount_point):
     401        model.copy(self._metadata, mount_point)
    401402
    402403    def _refresh_copy_palette(self):
    403404        palette = self._copy.get_palette()
    class EntryToolbar(gtk.Toolbar): 
    406407            palette.menu.remove(menu_item)
    407408            menu_item.destroy()
    408409
     410        if self._metadata['mountpoint'] != '/':
     411            journal_item = MenuItem(_('Journal'))
     412            journal_item.set_image(Icon(
     413                    icon_name='activity-journal',
     414                    xo_color=profile.get_color(),
     415                    icon_size=gtk.ICON_SIZE_MENU))
     416            journal_item.connect('activate',
     417                    self._copy_menu_item_activate_cb, '/')
     418            journal_item.show()
     419            palette.menu.append(journal_item)
     420
    409421        volume_monitor = gio.volume_monitor_get()
    410422        for mount in volume_monitor.get_mounts():
    411423            if self._metadata['mountpoint'] == mount.get_root().get_path():
    class EntryToolbar(gtk.Toolbar): 
    418430
    419431            menu_item.connect('activate',
    420432                              self._copy_menu_item_activate_cb,
    421                               mount)
     433                              mount.get_root().get_path())
    422434            palette.menu.append(menu_item)
    423435            menu_item.show()
    424436