16 |
16 |
17 from .ConfigurationPageBase import ConfigurationPageBase |
17 from .ConfigurationPageBase import ConfigurationPageBase |
18 from .Ui_EditorHighlightersPage import Ui_EditorHighlightersPage |
18 from .Ui_EditorHighlightersPage import Ui_EditorHighlightersPage |
19 |
19 |
20 import Preferences |
20 import Preferences |
|
21 import UI.PixmapCache |
21 |
22 |
22 |
23 |
23 class EditorHighlightersPage(ConfigurationPageBase, Ui_EditorHighlightersPage): |
24 class EditorHighlightersPage(ConfigurationPageBase, Ui_EditorHighlightersPage): |
24 """ |
25 """ |
25 Class implementing the Editor Highlighter Associations configuration page. |
26 Class implementing the Editor Highlighter Associations configuration page. |
45 except AttributeError: |
46 except AttributeError: |
46 self.extsep = "." |
47 self.extsep = "." |
47 |
48 |
48 import QScintilla.Lexers |
49 import QScintilla.Lexers |
49 self.extras = ["-----------", self.tr("Alternative")] |
50 self.extras = ["-----------", self.tr("Alternative")] |
50 languages = [''] + sorted(lexers.keys()) + self.extras |
51 self.editorLexerCombo.addItem("") |
51 for lang in languages: |
52 self.editorLexerCombo.addItem( |
|
53 UI.PixmapCache.getIcon("fileText"), |
|
54 "Text" |
|
55 ) |
|
56 for lang in sorted(lexers.keys()): |
52 self.editorLexerCombo.addItem( |
57 self.editorLexerCombo.addItem( |
53 QScintilla.Lexers.getLanguageIcon(lang, False), |
58 QScintilla.Lexers.getLanguageIcon(lang, False), |
54 lang) |
59 lang |
|
60 ) |
|
61 self.editorLexerCombo.addItems(self.extras) |
55 |
62 |
56 pygmentsLexers = [''] + sorted(lex[0] for lex in get_all_lexers()) |
63 pygmentsLexers = [''] + sorted(lex[0] for lex in get_all_lexers()) |
57 self.pygmentsLexerCombo.addItems(pygmentsLexers) |
64 self.pygmentsLexerCombo.addItems(pygmentsLexers) |
58 |
65 |
59 # set initial values |
66 # set initial values |