From 841f6f9c4629172f7b7c71167e9842ddb735ae4e Mon Sep 17 00:00:00 2001 From: Gonzalo Odiard Date: Fri, 05 Nov 2010 16:07:13 +0000 Subject: Write: Change the default method of insert images The patch add a checkbox to enable the user to select the method --- diff --git a/toolbar.py b/toolbar.py index 15c618d..85ec312 100644 --- a/toolbar.py +++ b/toolbar.py @@ -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) -- cgit v0.9.1