Ticket #4253: 0001-Adapt-to-PaletteMenu-changes-for-popdown-on-item-act.2.patch

File 0001-Adapt-to-PaletteMenu-changes-for-popdown-on-item-act.2.patch, 2.3 KB (added by manuq, 10 years ago)

Browse adapt patch.

  • palettes.py

    From 8331a7efaed531f5a2806952c6028e5eb92833b1 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Manuel=20Qui=C3=B1ones?= <manuq@laptop.org>
    Date: Mon, 10 Dec 2012 12:46:41 -0300
    Subject: [PATCH browse] Adapt to PaletteMenu changes for popdown on item
     activation - SL #4253
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    Mail-Followup-To: <sugar-devel@lists.sugarlabs.org>
    
    The toolkit now pops-down the Palette when an item is activated.  We
    do not have to do it manually anymore.
    
    Signed-off-by: Manuel Quiñones <manuq@laptop.org>
    ---
     palettes.py | 12 ------------
     1 file changed, 12 deletions(-)
    
    diff --git a/palettes.py b/palettes.py
    index bfb27e9..a155dbe 100644
    a b class SelectionPalette(Palette): 
    171171        menu_item.show()
    172172
    173173    def __copy_activate_cb(self, menu_item):
    174         self.popdown(immediate=True)
    175 
    176174        self._browser.copy_clipboard()
    177175
    178176
    class LinkPalette(Palette): 
    223221        menu_item.show()
    224222
    225223    def __follow_activate_cb(self, menu_item, new_tab=False):
    226         self.popdown(immediate=True)
    227 
    228224        if new_tab:
    229225            new_browser = self._browser.open_new_tab(self._url)
    230226        else:
    class LinkPalette(Palette): 
    232228            self._browser.grab_focus()
    233229
    234230    def __copy_activate_cb(self, menu_item):
    235         self.popdown(immediate=True)
    236 
    237231        clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
    238232        clipboard.set_text(self._url, -1)
    239233
    240234    def __download_activate_cb(self, menu_item):
    241         self.popdown(immediate=True)
    242 
    243235        nr = WebKit.NetworkRequest()
    244236        nr.set_uri(self._url)
    245237        download = WebKit.Download(network_request=nr)
    class ImagePalette(Palette): 
    279271        menu_item.show()
    280272
    281273    def __copy_activate_cb(self, menu_item):
    282         self.popdown(immediate=True)
    283 
    284274        # Download the image
    285275        temp_file = tempfile.NamedTemporaryFile(delete=False)
    286276        data = urllib2.urlopen(self._url).read()
    class ImagePalette(Palette): 
    294284        clipboard.set_image(image.get_pixbuf())
    295285
    296286    def __download_activate_cb(self, menu_item):
    297         self.popdown(immediate=True)
    298 
    299287        nr = WebKit.NetworkRequest()
    300288        nr.set_uri(self._url)
    301289        download = WebKit.Download(network_request=nr)