示例#1
0
    def __init__(self, prefs):
        BuilderAware.__init__(self, join_to_file_dir(__file__, 'editor_prefs.glade'))
        self.activator = shortcuts.ShortcutActivator(self.window)
        self.activator.bind('Escape', self.hide)

        self.prefs = prefs
        self.original_prefs = prefs.copy()

        self.langs.append(('default', ))
        lm = gtksourceview2.language_manager_get_default()
        for lang_id in sorted(lm.get_language_ids()):
            self.langs.append((lang_id, ))

        sm = gtksourceview2.style_scheme_manager_get_default()
        for style_id in sm.get_scheme_ids():
            self.styles.append((style_id, ))

        self.checks = ['use-tabs', 'show-right-margin', 'show-line-numbers', 'wrap-text',
            'highlight-current-line', 'show-whitespace', 'remove-trailing-space']

        for name in self.checks:
            getattr(self, name.replace('-', '_')).connect(
                'toggled', self.on_checkbox_toggled, name)

        self.margin_width.connect('value-changed', self.on_spin_changed, 'right-margin')
        self.tab_width.connect('value-changed', self.on_spin_changed, 'tab-width')
        self.line_spacing.connect('value-changed', self.on_spin_changed, 'line-spacing')

        self.font.connect('font-set', self.on_font_set, 'font')

        for h in on_dialog_created_hooks:
            h(self)
示例#2
0
文件: prefs.py 项目: bigdrum/snaked
    def __init__(self, existing_snippets):
        BuilderAware.__init__(self, join_to_file_dir(__file__, 'prefs.glade'))

        from snaked.core.shortcuts import ShortcutActivator
        self.activator = ShortcutActivator(self.window)
        self.activator.bind('Escape', self.hide)
        self.activator.bind('<alt>s', self.focus_search)
        self.existing_snippets = existing_snippets

        set_activate_the_one_item(self.search_entry, self.snippets_view)
示例#3
0
    def __init__(self):
        BuilderAware.__init__(self, join_to_file_dir(__file__, 'plugin_prefs.glade'))
        self.activator = ShortcutActivator(self.window)
        self.activator.bind('Escape', self.hide)

        self.plugins_tree.get_columns()[0].get_cell_renderers()[0].props.activatable = True
示例#4
0
 def __init__(self):
     BuilderAware.__init__(self, join_to_file_dir(__file__, 'shortcuts.glade'))
     self.activator = shortcuts.ShortcutActivator(self.window)
     self.activator.bind('Escape', self.hide)