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): |
110 | 110 | toolbar_box.toolbar.insert(list_toolbar, -1) |
111 | 111 | |
112 | 112 | insert_toolbar = ToolbarButton() |
113 | | insert_toolbar.props.page = InsertToolbar(self.abiword_canvas) |
| 113 | insert_toolbar.props.page = InsertToolbar(self.abiword_canvas, self) |
114 | 114 | insert_toolbar.props.icon_name = 'insert-table' |
115 | 115 | insert_toolbar.props.label = _('Table') |
116 | 116 | toolbar_box.toolbar.insert(insert_toolbar, -1) |
diff --git a/toolbar.py b/toolbar.py
index 75243c7..a16803c 100644
a
|
b
|
class EditToolbar(gtk.Toolbar): |
176 | 176 | tool_item.show() |
177 | 177 | |
178 | 178 | class InsertToolbar(gtk.Toolbar): |
179 | | def __init__(self, abiword_canvas): |
| 179 | def __init__(self, abiword_canvas, parent): |
180 | 180 | gtk.Toolbar.__init__(self) |
181 | 181 | |
182 | 182 | self._abiword_canvas = abiword_canvas |
| 183 | self._parent = parent |
183 | 184 | |
184 | 185 | self._table = abiword.TableCreator() |
185 | 186 | self._table.set_labels(_('Table'), _('Cancel')) |
… |
… |
class InsertToolbar(gtk.Toolbar): |
234 | 235 | def cb(object): |
235 | 236 | logging.debug('ObjectChooser: %r' % object) |
236 | 237 | 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) |
238 | 239 | |
239 | 240 | def _table_cb(self, abi, rows, cols): |
240 | 241 | self._abiword_canvas.insert_table(rows, cols) |