diff options
author | Gonzalo Odiard <godiard@sugarlabs.org> | 2010-11-05 16:07:13 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@sugarlabs.org> | 2010-11-08 19:56:34 (GMT) |
commit | 841f6f9c4629172f7b7c71167e9842ddb735ae4e (patch) | |
tree | de01e4fcb9b18fcc9a6ef8d98e28b2220d41cca0 /toolbar.py | |
parent | 8dee9eeddf06e726876ca2e79402f5de4a08dc91 (diff) |
Write: Change the default method of insert images
The patch add a checkbox to enable the user to select the method
Diffstat (limited to 'toolbar.py')
-rw-r--r-- | toolbar.py | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -257,17 +257,32 @@ class InsertToolbar(gtk.Toolbar): self._image_id = image.connect('clicked', self._image_cb) self.insert(image, -1) + palette = image.get_palette() + content_box = gtk.VBox() + palette.set_content(content_box) + image_floating_checkbutton = gtk.CheckButton(_('Floating')) + image_floating_checkbutton.connect('toggled', + self._image_floating_checkbutton_toggled_cb) + content_box.pack_start(image_floating_checkbutton) + content_box.show_all() + self.floating_image = False + self.show_all() self._abiword_canvas.connect('table-state', self._isTable_cb) #self._abiword_canvas.connect('image-selected', # self._image_selected_cb) + def _image_floating_checkbutton_toggled_cb(self, checkbutton): + self.floating_image = checkbutton.get_active() + def _image_cb(self, button): def cb(object): logging.debug('ObjectChooser: %r' % object) - self._abiword_canvas.insert_image(object.file_path, True) + self._abiword_canvas.insert_image(object.file_path, + self.floating_image) + chooser.pick(parent=self._abiword_canvas.get_toplevel(), what=chooser.IMAGE, cb=cb) |