Beispiel #1
0
    def __init__(self):
        BuilderAware.__init__(self, join_to_file_dir(__file__, 'history.glade'))
        self.view.realize()

        self.activator = Activator()
        self.activator.bind_accel('window', 'escape', '_Close', 'Escape', self.on_window_delete_event)
        self.activator.attach(self.window)
Beispiel #2
0
    def __init__(self, prefs):
        BuilderAware.__init__(self, join_to_file_dir(__file__, 'editor_prefs.glade'))

        from snaked.core.manager import keymap
        self.activator = keymap.get_activator(self.window)
        self.activator.bind('any', 'escape', None, 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 sorted(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)
Beispiel #3
0
    def __init__(self):
        BuilderAware.__init__(self, join_to_file_dir(__file__, 'places.glade'))

        from fmd.app import keymap
        self.activator = keymap.get_activator(self.window)
        self.activator.bind('any', 'escape', '_Close', self.on_window_delete_event).to('Escape')

        self.view.realize()
Beispiel #4
0
    def __init__(self):
        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)

        set_activate_the_one_item(self.search_entry, self.dialogs_view)
Beispiel #5
0
    def __init__(self, existing_snippets):
        BuilderAware.__init__(self, join_to_file_dir(__file__, 'prefs.glade'))

        from snaked.core.manager import keymap
        self.activator = keymap.get_activator(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)
    def __init__(self):
        BuilderAware.__init__(self, join_to_file_dir(__file__, 'select_session.glade'))

        from snaked.core.prefs import get_settings_path

        self.dialog.vbox.remove(self.dialog.action_area)
        self.dialog.set_default_response(1)

        cfg = get_settings_path('')
        for p in os.listdir(cfg):
            if os.path.isdir(os.path.join(cfg, p)):
                self.sessions.append((p,))
Beispiel #7
0
    def __init__(self):
        BuilderAware.__init__(self, join_to_file_dir(__file__, 'plugin_prefs.glade'))

        from snaked.core.manager import keymap
        self.activator = keymap.get_activator(self.window)
        self.activator.bind('any', 'escape', None, self.hide)