From 12aead0ad4ee16a6210086e143da65794d8ab5ff Mon Sep 17 00:00:00 2001 From: Marc Maurer Date: Sun, 02 Sep 2007 20:49:59 +0000 Subject: Hook up the abiword canvas 'style-name' signal to the Format toolbar --- (limited to 'toolbar.py') diff --git a/toolbar.py b/toolbar.py index 2563ad1..89d1260 100644 --- a/toolbar.py +++ b/toolbar.py @@ -381,6 +381,17 @@ class FormatToolbar(gtk.Toolbar): self.insert(tool_item, -1); tool_item.show() + self._abiword_canvas.connect('style-name', self._style_cb) + + def _style_cb(self, abi, style_name): + for i, s in enumerate(self._styles): + if s[0] == style_name: + self._style_combo.handler_block(self._style_changed_id) + self._style_combo.set_active(i) + self._style_combo.handler_unblock(self._style_changed_id) + break; + # TODO: if no match is found, then add the style to the style dropdown + def _style_changed_cb(self, combobox): if self._style_combo.get_active() != -1: logger.debug('Setting style name: %s', self._styles[self._style_combo.get_active()][0]) -- cgit v0.9.1