diff options
author | Walter Bender <walter@walter-laptop.(none)> | 2009-09-06 12:45:40 (GMT) |
---|---|---|
committer | Walter Bender <walter@walter-laptop.(none)> | 2009-09-06 12:45:40 (GMT) |
commit | 8cbd77401d49850ae729c4ff50939ae0504f17a1 (patch) | |
tree | bf0db12f9b166017136acb20712e87416d77fc3f | |
parent | e2fe9afa0a15fad90d03fd0b1bd911aa534dd643 (diff) |
fixed another typo
-rw-r--r-- | widgets.py | 77 |
1 files changed, 1 insertions, 76 deletions
@@ -121,81 +121,6 @@ class FontSizeCombo(ComboBox): self.set_active(i) self.handler_unblock(self._changed_id) break; -""" -# Replacing ComboBox with two Radio Palettes -class StyleCombo(ComboBox): - def __init__(self, abi): - ComboBox.__init__(self) - - self._abi_handler = abi.connect('style-name', self._style_cb) - - self._styles = [ ['Heading 1', _('Heading 1')], - ['Heading 2', _('Heading 2')], - ['Heading 3', _('Heading 3')], - ['Heading 4', _('Heading 4')], - ['Bullet List', _('Bullet List')], - ['Dashed List', _('Dashed List')], - ['Numbered List', _('Numbered List')], - ['Lower Case List', _('Lower Case List')], - ['Upper Case List', _('Upper Case List')], - ['Block Text', _('Block Text')], - ['Normal', _('Normal')], - ['Plain Text', _('Plain Text')] ] - - self._has_custom_styles = False - self._style_changed_id = self.connect('changed', self._style_changed_cb, - abi) - - for i, s in enumerate(self._styles): - self.append_item(i, s[1], None) - if s[0] == 'Normal': - self.set_active(i) - - def _style_changed_cb(self, combobox, abi): - if self.get_active() != -1: - logger.debug('Set style: %s', self._styles[self.get_active()][0]) - try: - abi.handler_block(self._abi_handler) - abi.set_style(self._styles[self.get_active()][0]) - finally: - abi.handler_unblock(self._abi_handler) - - def _style_cb(self, abi, style_name): - if style_name is None or style_name == 'None': - style_name = 'Normal' - - style_index = -1 - for i, s in enumerate(self._styles): - if s[0] == style_name: - style_index = i - break; - - # if we don't know this style yet, then add it (temporary) to the list - if style_index == -1: - logger.debug('Style not found in style list: %s', style_name) - - if not self._has_custom_styles: - # add a separator to seperate the non-available styles from - # the available ones - self._styles.append(['','']) # ugly - self.append_separator() - self._has_custom_styles = True - - # add the new style - self._styles.append([style_name, style_name]) - self.append_item(0, style_name, None) - - # see how many styles we have now, so we can select the last one - model = self.get_model() - num_children = model.iter_n_children(None) - logger.debug('Number of styles in the list: %d', num_children) - style_index = num_children-1 - - if style_index > -1: - self.handler_block(self._style_changed_id) - self.set_active(style_index) - self.handler_unblock(self._style_changed_id) -""" class AbiButton(RadioToolButton): def __init__(self, abi, abi_signal, do_abi_cb, on_abi_cb=None, **kwargs): @@ -306,7 +231,7 @@ class HeadingsPalette(RadioPalette): append('paragraph-h2', _('Heading 2'), lambda: abi.set_style('Heading 2'), - lambda abi, style: style == 'Heading 3') + lambda abi, style: style == 'Heading 2') append('paragraph-h3', _('Heading 3'), lambda: abi.set_style('Heading 3'), |