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

settings: basic operations appear to work

Changeset d8c15ef0057f

Parent 9cf0160cb7b4

by Steve Borho

Changes to one file · Browse files at d8c15ef0057f Showing diff from parent 9cf0160cb7b4 Diff from another changeset...

 
47
48
49
 
50
51
52
53
54
 
55
56
57
 
58
 
 
59
60
61
 
 
62
 
 
63
64
65
66
67
68
69
 
 
70
71
72
73
 
74
75
76
 
96
97
98
 
99
100
101
102
 
103
104
105
 
109
110
111
112
 
113
114
115
 
121
122
123
124
 
125
126
127
 
501
502
503
504
 
505
506
507
 
544
545
546
547
548
549
550
 
574
575
576
577
578
579
580
 
603
604
605
606
 
607
608
609
 
47
48
49
50
51
52
53
54
 
55
56
57
 
58
59
60
61
62
 
 
63
64
65
66
67
68
 
 
 
 
 
 
69
70
71
72
73
 
74
75
76
77
 
97
98
99
100
101
102
103
 
104
105
106
107
 
111
112
113
 
114
115
116
117
 
123
124
125
 
126
127
128
129
 
503
504
505
 
506
507
508
509
 
546
547
548
 
549
550
551
 
575
576
577
 
578
579
580
 
603
604
605
 
606
607
608
609
@@ -47,30 +47,31 @@
    def resetList(self):   self.clear() + ucur = hglib.tounicode(self.curvalue or '')   if self.opts.get('defer') and not self.loaded:   if self.curvalue == False: # unspecified   self.addItem(_unspecstr)   else: - self.addItem(self.curvalue or '...') + self.addItem(ucur or '...')   return   self.addItem(_unspecstr) - cur = None + curindex = None   for s in self.defaults: + if ucur == s: + curindex = self.count()   self.addItem(s) - if self.curvalue == s: - cur = self.count() + if self.defaults and self.previous: + self.insertSeparator(len(self.defaults)+1)   for m in self.previous: + if ucur == m and not curindex: + curindex = self.count()   self.addItem(m) - if self.curvalue == s: - cur = self.count() - if self.defaults and self.previous: - self.insertSeparator(len(self.defaults)) - if cur is not None: - self.setCurrentIndex(cur) + if curindex is not None: + self.setCurrentIndex(curindex)   elif self.curvalue == False:   self.setCurrentIndex(0)   elif self.curvalue: - self.addItem(self.curvalue) + self.addItem(ucur)   self.setCurrentIndex(self.count()-1)     def showPopup(self): @@ -96,10 +97,11 @@
  return False   if 'nohist' in self.opts or utext in self.defaults + self.previous:   return hglib.fromunicode(utext) + print 'saving', self.opts['cpath'], utext   self.previous.insert(0, utext)   self.previous = self.previous[:10]   settings = QSettings() - settings.setValue('settings/'+opts['cpath'], self.previous) + settings.setValue('settings/'+self.opts['cpath'], self.previous)   return hglib.fromunicode(utext)     def isDirty(self): @@ -109,7 +111,7 @@
  def __init__(self, parent=None, **opts):   QLineEdit.__init__(self, parent)   self.opts = opts - self.curvalue = None + self.curvalue = False   self.setEchoMode(QLineEdit.Password)     def focusInEvent(self, e): @@ -121,7 +123,7 @@
  def setValue(self, curvalue):   self.curvalue = curvalue   if curvalue: - self.setText(curvalue) + self.setText(hglib.tounicode(curvalue))   else:   self.setText('')   @@ -501,7 +503,7 @@
  'select another hgrc file'   combo = self.confcombo   if self.isDirty(): - ret = qctlib.CustomPrompt(_('Confirm Switch'), + ret = qtlib.CustomPrompt(_('Confirm Switch'),   _('Switch after saving changes?'), self,   (_('&Save'), _('&Discard'), _('&Cancel')),   default=2, esc=2).run() @@ -544,7 +546,6 @@
  for info, widgets in self.pages.values():   for w in widgets:   if w.isDirty(): - print w.opts['cpath']   return True   return False   @@ -574,7 +575,6 @@
  frame.setLayout(form)   self.stack.addWidget(frame)   - # supplied opts keys: cpath, tooltip, descwidget, defaults   for row, (label, cpath, values, tooltip) in enumerate(info):   opts = {'label':label, 'cpath':cpath, 'tooltip':tooltip,   'descwidget':self.desctext, 'settings':self.settings} @@ -603,7 +603,7 @@
  section, key = cpath.split('.', 1)   return self.ini[section][key]   except KeyError: - return None + return False     def loadIniFile(self, rcpath):   for fn in rcpath: