Ticket #2001: 0001-fix-SL-2001-Write-does-not-pass-parent-window-xid-to.patch

File 0001-fix-SL-2001-Write-does-not-pass-parent-window-xid-to.patch, 2.0 KB (added by godiard, 12 years ago)
  • AbiWordActivity.py

    From fa2177ab5defe4667fbb57c9e2d7d71d7d20ad78 Mon Sep 17 00:00:00 2001
    From: Gonzalo Odiard <godiard@sugarlabs.org>
    Date: Wed, 13 Oct 2010 11:20:23 -0300
    Subject: [PATCH] fix SL #2001 - Write does not pass parent window xid to ObjectChooser
    
    This is a regresion, probably introduced when changed the toolbar.
    May be pass self.abiword_canvas and self to ImageToolbar is not the smarter option.
    ---
     AbiWordActivity.py |    2 +-
     toolbar.py         |    5 +++--
     2 files changed, 4 insertions(+), 3 deletions(-)
    
    diff --git a/AbiWordActivity.py b/AbiWordActivity.py
    index f6c54fa..7deab8c 100644
    a b class AbiWordActivity (activity.Activity): 
    110110        toolbar_box.toolbar.insert(list_toolbar, -1)
    111111       
    112112        insert_toolbar = ToolbarButton()
    113         insert_toolbar.props.page = InsertToolbar(self.abiword_canvas)
     113        insert_toolbar.props.page = InsertToolbar(self.abiword_canvas, self)
    114114        insert_toolbar.props.icon_name = 'insert-table'
    115115        insert_toolbar.props.label = _('Table')
    116116        toolbar_box.toolbar.insert(insert_toolbar, -1)
  • toolbar.py

    diff --git a/toolbar.py b/toolbar.py
    index 75243c7..a16803c 100644
    a b class EditToolbar(gtk.Toolbar): 
    176176        tool_item.show()
    177177
    178178class InsertToolbar(gtk.Toolbar):
    179     def __init__(self, abiword_canvas):
     179    def __init__(self, abiword_canvas, parent):
    180180        gtk.Toolbar.__init__(self)
    181181
    182182        self._abiword_canvas = abiword_canvas
     183        self._parent = parent
    183184
    184185        self._table = abiword.TableCreator()
    185186        self._table.set_labels(_('Table'), _('Cancel'))
    class InsertToolbar(gtk.Toolbar): 
    234235        def cb(object):
    235236            logging.debug('ObjectChooser: %r' % object)
    236237            self._abiword_canvas.insert_image(object.file_path, True)
    237         chooser.pick(what=chooser.IMAGE, cb=cb)
     238        chooser.pick(parent=self._parent, what=chooser.IMAGE, cb=cb)
    238239
    239240    def _table_cb(self, abi, rows, cols):
    240241        self._abiword_canvas.insert_table(rows, cols)