diff options
author | Gonzalo Odiard <godiard@sugarlabs.org> | 2010-11-09 14:52:31 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@sugarlabs.org> | 2010-11-09 14:52:31 (GMT) |
commit | 24c3389f96936e426cd49ced2d2acf54e603a6d2 (patch) | |
tree | e7cc9d0d8fd1a479b0fd319156d1d1c8c78e3e9f | |
parent | a2c8c1ef1084929b2fdd9b8bc0e933486b8895fb (diff) |
Write: Change the default method of insert images
The patch add a checkbox to enable the user to select the method
-rw-r--r-- | toolbar.py | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -529,10 +529,24 @@ class ImageToolbar(gtk.Toolbar): self._image.set_tooltip(_('Insert Image')) self._image_id = self._image.connect('clicked', self._image_cb) self.insert(self._image, -1) + + palette = self._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._image.show() 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): chooser = ObjectChooser(_('Choose image'), self._parent, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, @@ -543,7 +557,8 @@ class ImageToolbar(gtk.Toolbar): logging.debug('ObjectChooser: %r' % chooser.get_selected_object()) jobject = chooser.get_selected_object() if jobject and jobject.file_path: - self._abiword_canvas.insert_image(jobject.file_path, True) + self._abiword_canvas.insert_image(jobject.file_path, + self.floating_image) finally: chooser.destroy() del chooser |