Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/toolbar.py
diff options
context:
space:
mode:
authorMarc Maurer <uwog@uwog.net>2007-09-02 20:49:59 (GMT)
committer Marc Maurer <uwog@uwog.net>2007-09-02 20:49:59 (GMT)
commit12aead0ad4ee16a6210086e143da65794d8ab5ff (patch)
tree70eb166e5adfedd000439abed2561fda2386c5a8 /toolbar.py
parentbdbbaa8a3ad17b65f96e0fb43f492a1a4c33db29 (diff)
Hook up the abiword canvas 'style-name' signal to the Format toolbar
Diffstat (limited to 'toolbar.py')
-rw-r--r--toolbar.py11
1 files changed, 11 insertions, 0 deletions
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])