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

settings: display values from current file

Changeset d82070c97903

Parent b2aa0793b2db

by Steve Borho

Changes to one file · Browse files at d82070c97903 Showing diff from parent b2aa0793b2db Diff from another changeset...

 
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 
64
65
66
67
68
 
 
69
70
71
 
72
73
74
 
120
121
122
123
 
 
 
 
124
125
126
 
609
610
611
612
613
614
615
616
617
618
 
619
620
621
 
674
675
676
677
 
678
679
 
680
681
682
 
20
21
22
 
23
 
 
24
25
26
27
28
29
 
30
31
32
 
60
61
62
 
 
63
64
65
66
 
67
68
69
70
 
116
117
118
 
119
120
121
122
123
124
125
 
608
609
610
 
 
611
 
612
 
 
613
614
615
616
 
669
670
671
 
672
673
 
674
675
676
677
@@ -20,17 +20,13 @@
 from PyQt4.QtGui import *    # Technical Debt -# dirty indication  # stacked widget or pages need to be scrollable -# all entry widgets need virtual APIs for parent to set/query -# isDirty(), addHistory(), setCurValue(), getCurValue()  # hook up QSci as internal editor, enable ini syntax highlight  # initial focus not implemented  # add extensions page after THG 1.1 is released  # show icons in listview    _unspecstr = _('<unspecified>') -_unspeclocalstr = hglib.fromutf(_unspecstr)    class SettingsCombo(QComboBox):   def __init__(self, parent=None, **opts): @@ -64,11 +60,11 @@
  cur = self.count()   if self.defaults and self.previous:   self.insertSeparator(len(self.defaults)) - if cur: - self.setCurrentIndex(i) + if cur is not None: + self.setCurrentIndex(cur)   elif self.curvalue == False:   self.setCurrentIndex(0) - else: + elif self.curvalue:   self.addItem(self.curvalue)   self.setCurrentIndex(self.count()-1)   @@ -120,7 +116,10 @@
    def setCurValue(self, curvalue):   self.curvalue = curvalue - self.setPlainText(curvalue) + if curvalue: + self.setText(curvalue) + else: + self.setText('')     def getValue(self):   utext = self.text() @@ -609,13 +608,9 @@
  else:   pages = ((pagename,) + self.pages[pagename],)   for name, page_num, info, frame, widgets in pages: - - # standard configs   for row, (label, cpath, values, tooltip) in enumerate(info): - w = widgets[row]   curvalue = self.get_ini_config(cpath) - canedit = hasattr(w, 'isEditable') and w.isEditable() - # TODO: provide methods to add history, set cur value + widgets[row].setCurValue(curvalue)     def get_ini_config(self, cpath):   '''Retrieve a value from the parsed config file''' @@ -674,9 +669,9 @@
  return cfg     def recordNewValue(self, cpath, newvalue, keephistory=True): - # 'newvalue' is converted to local encoding + # 'newvalue' is in local encoding   section, key = cpath.split('.', 1) - if newvalue == _unspeclocalstr or newvalue == '': + if newvalue == False:   try:   del self.ini[section][key]   except KeyError: