Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

hgemail: get syntax highlight of QScintilla for preview area

Changeset bf5f87a7befd

Parent 69689dc06a96

by Yuya Nishihara

Changes to 2 files · Browse files at bf5f87a7befd Showing diff from parent 69689dc06a96 Diff from another changeset...

 
14
15
16
17
 
18
19
20
 
207
208
209
 
 
 
 
 
 
 
 
210
211
212
 
14
15
16
 
17
18
19
20
 
207
208
209
210
211
212
213
214
215
216
217
218
219
220
@@ -14,7 +14,7 @@
 from mercurial import hg, error, extensions, util  from tortoisehg.util import hglib, paths  from tortoisehg.hgqt.i18n import _ -from tortoisehg.hgqt import cmdui +from tortoisehg.hgqt import cmdui, lexers    try:   from tortoisehg.hgqt.ui_hgemail import Ui_EmailDialog @@ -207,6 +207,14 @@
  return len(self._revs) > 1     def _initpreviewtab(self): + def initqsci(w): + w.setUtf8(True) + w.setReadOnly(True) + w.setMarginWidth(1, 0) # hide area for line numbers + w.setLexer(lexers.DiffLexerSelector().lexer()) + # TODO: better way to setup diff lexer + initqsci(self._qui.preview_edit) +   self.connect(self._qui.main_tabs, SIGNAL('currentChanged(int)'),   self._refreshpreviewtab)   self._refreshpreviewtab(self._qui.main_tabs.currentIndex())
 
283
284
285
286
287
288
289
290
291
292
293
294
295
 
296
297
298
 
343
344
345
 
 
 
 
 
 
 
346
347
348
 
283
284
285
 
 
 
 
 
 
 
 
 
 
286
287
288
289
 
334
335
336
337
338
339
340
341
342
343
344
345
346
@@ -283,16 +283,7 @@
  </attribute>   <layout class="QGridLayout" name="gridLayout_2">   <item row="0" column="0"> - <widget class="QTextEdit" name="preview_edit"> - <property name="font"> - <font> - <family>Monospace</family> - </font> - </property> - <property name="readOnly"> - <bool>true</bool> - </property> - </widget> + <widget class="QsciScintilla" name="preview_edit"/>   </item>   </layout>   </widget> @@ -343,6 +334,13 @@
  </item>   </layout>   </widget> + <customwidgets> + <customwidget> + <class>QsciScintilla</class> + <extends>QFrame</extends> + <header>Qsci/qsciscintilla.h</header> + </customwidget> + </customwidgets>   <tabstops>   <tabstop>main_tabs</tabstop>   <tabstop>to_edit</tabstop>