Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

thgconfig: fix issue 'Apply' button never enable even if iniparse loaded

this bug was instroduced in <4d53aac5f184> in 'default' branch.
I don't know why 'hasattr' doesn't work. Instead of this, I choose more
explicitly way; add 'readonly' flag as a member variable of ConfigDialog.

Changeset 0be2e3b94fd9

Parent 6649b4674f01

by Yuki KODAMA

Changes to one file · Browse files at 0be2e3b94fd9 Showing diff from parent 6649b4674f01 Diff from another changeset...

 
515
516
517
 
518
519
520
521
522
 
523
524
525
 
691
692
693
694
 
695
696
697
 
1019
1020
1021
1022
1023
1024
1025
 
1046
1047
1048
1049
 
1050
1051
1052
 
515
516
517
518
519
520
521
522
523
524
525
526
527
 
693
694
695
 
696
697
698
699
 
1021
1022
1023
 
1024
1025
1026
 
1047
1048
1049
 
1050
1051
1052
1053
@@ -515,11 +515,13 @@
  try:   import iniparse   iniparse.INIConfig + self.readonly = False   except ImportError:   dialog.error_dialog(self, _('Iniparse package not found'),   _('Please install iniparse package') + '\n' +   _('Settings are only shown, no changing is possible'))   print 'Please install http://code.google.com/p/iniparse/' + self.readonly = True     # Catch close events   self.connect('response', self.should_live) @@ -691,7 +693,7 @@
    def dirty_event(self, *args):   if not self.dirty: - self._btn_apply.set_sensitive(not hasattr(self.ini, '_readonly')) + self._btn_apply.set_sensitive(not self.readonly)   self.dirty = True     def _add_path(self, *args): @@ -1019,7 +1021,6 @@
  from mercurial import config   cfg = config.config()   cfg.read(fn) - cfg._readonly = True   return cfg     def record_new_value(self, cpath, newvalue, keephistory=True): @@ -1046,7 +1047,7 @@
  self.history.mrul(cpath).add(newvalue)     def _apply_clicked(self, *args): - if hasattr(self.ini, '_readonly'): + if self.readonly:   #dialog? Read only access, please install ...   return   # Reload history, since it may have been modified externally