/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to diff.py

  • Committer: Szilveszter Farkas
  • Date: 2009-05-26 09:16:57 UTC
  • mto: (635.2.6 trunk)
  • mto: This revision was merged to the branch mainline in revision 639.
  • Revision ID: szilveszter.farkas@gmail.com-20090526091657-w4j8pzf9wue537wc
Changed all occurences of gtksourceview to version 2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import sys
20
20
 
21
21
try:
22
 
    import gtksourceview
 
22
    import gtksourceview2
23
23
    have_gtksourceview = True
24
24
except ImportError:
25
25
    have_gtksourceview = False
63
63
        self.set_shadow_type(gtk.SHADOW_IN)
64
64
 
65
65
        if have_gtksourceview:
66
 
            self.buffer = gtksourceview.SourceBuffer()
67
 
            slm = gtksourceview.SourceLanguagesManager()
68
 
            gsl = slm.get_language_from_mime_type("text/x-patch")
 
66
            self.buffer = gtksourceview2.Buffer()
 
67
            slm = gtksourceview2.LanguageManager()
 
68
            gsl = slm.guess_language(content_type="text/x-patch")
69
69
            if have_gconf:
70
70
                self.apply_gedit_colors(gsl)
71
71
            self.apply_colordiff_colors(gsl)
72
72
            self.buffer.set_language(gsl)
73
73
            self.buffer.set_highlight(True)
74
74
 
75
 
            self.sourceview = gtksourceview.SourceView(self.buffer)
 
75
            self.sourceview = gtksourceview2.View(self.buffer)
76
76
        else:
77
77
            self.buffer = gtk.TextBuffer()
78
78
            self.sourceview = gtk.TextView(self.buffer)
88
88
 
89
89
        This method needs the gconf module.
90
90
 
91
 
        :param lang: a gtksourceview.SourceLanguage object.
 
91
        :param lang: a gtksourceview2.Language object.
92
92
        """
93
93
        GEDIT_SYNTAX_PATH = '/apps/gedit-2/preferences/syntax_highlighting'
94
94
        GEDIT_LANG_PATH = GEDIT_SYNTAX_PATH + '/' + lang.get_id()
116
116
                    string_bool, string_bool, string_bool ]
117
117
            )
118
118
 
119
 
            style = gtksourceview.SourceTagStyle()
 
119
            style = gtksourceview2.Style()
120
120
 
121
121
            # XXX The mask attribute controls whether the present values of
122
122
            # foreground and background color should in fact be used. Ideally
151
151
 
152
152
        Both ~/.colordiffrc and ~/.colordiffrc.bzr-gtk are read.
153
153
 
154
 
        :param lang: a "Diff" gtksourceview.SourceLanguage object.
 
154
        :param lang: a "Diff" gtksourceview2.Language object.
155
155
        """
156
156
        colors = {}
157
157
 
194
194
            if color is None:
195
195
                continue
196
196
 
197
 
            style = gtksourceview.SourceTagStyle()
 
197
            style = gtksourceview2.Style()
198
198
            try:
199
199
                style.foreground = gtk.gdk.color_parse(color)
200
200
            except ValueError: