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

settings: add folding feature to file editor

Changeset 5720594b2170

Parent 3f70c22ed9a0

by Yuya Nishihara

Changes to 2 files · Browse files at 5720594b2170 Showing diff from parent 3f70c22ed9a0 Diff from another changeset...

 
439
440
441
442
 
443
444
445
 
449
450
451
 
 
452
453
454
 
439
440
441
 
442
443
444
445
 
449
450
451
452
453
454
455
456
@@ -439,7 +439,7 @@
  def set_enable(self, *args, **kargs):   self.set_prop('setEnabled', *args, **kargs)   -def fileEditor(filename): +def fileEditor(filename, **opts):   'Open a simple modal file editing dialog'   dialog = QDialog()   dialog.setWindowFlags(dialog.windowFlags() & ~Qt.WindowContextHelpButtonHint) @@ -449,6 +449,8 @@
  editor.setBraceMatching(QsciScintilla.SloppyBraceMatch)   editor.setMarginLineNumbers(1, True)   editor.setMarginWidth(1, '000') + if opts.get('foldable'): + editor.setFolding(QsciScintilla.BoxedTreeFoldStyle)   vbox.addWidget(editor)   BB = QDialogButtonBox   bb = QDialogButtonBox(BB.Save|BB.Cancel)
 
655
656
657
658
 
659
660
661
 
655
656
657
 
658
659
660
661
@@ -655,7 +655,7 @@
  self.applyChanges()   elif ret == 2:   return - if qtlib.fileEditor(self.fn) == QDialog.Accepted: + if qtlib.fileEditor(self.fn, foldable=True) == QDialog.Accepted:   self.refresh()     def refresh(self, *args):