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

cmdui, thread: use hglib.tounicode() instead of build-in unicode()

Changeset d77ffc629000

Parent e65766f45f7e

by Yuki KODAMA

Changes to 2 files · Browse files at d77ffc629000 Showing diff from parent e65766f45f7e Diff from another changeset...

 
9
10
11
 
12
13
14
 
112
113
114
115
116
 
117
118
119
 
152
153
154
155
 
156
157
158
159
160
 
161
162
163
 
9
10
11
12
13
14
15
 
113
114
115
 
 
116
117
118
119
 
152
153
154
 
155
156
157
158
159
 
160
161
162
163
@@ -9,6 +9,7 @@
 from PyQt4.QtGui import QDialog, QDialogButtonBox, QLabel, QProgressBar  from PyQt4.QtGui import QTextEdit, QHBoxLayout, QGridLayout, QMessageBox   +from tortoisehg.util import hglib  from tortoisehg.hgqt.i18n import _, localgettext  from tortoisehg.hgqt import qtlib, thread   @@ -112,8 +113,7 @@
  self.close_btn.setFocus()     def append_output(self, msg, style=''): - if isinstance(msg, str): - msg = unicode(msg, 'mbcs') + msg = hglib.tounicode(msg)   msg = msg.replace('\n', '<br />')   self.log_text.insertHtml('<pre style="%s">%s</pre>' % (style, msg))   @@ -152,12 +152,12 @@
  count = '%d / %d' % (pos, total)   if unit:   count += ' ' + unit - self.prog_label.setText(unicode(count, 'mbcs')) + self.prog_label.setText(hglib.tounicode(count))   if item:   status = '%s: %s' % (topic, item)   else:   status = local._('Status: %s') % topic - self.status_label.setText(unicode(status, 'mbcs')) + self.status_label.setText(hglib.tounicode(status))   self.inprogress = True     if not self.inprogress or counting:
 
171
172
173
174
175
 
176
177
178
 
180
181
182
183
 
184
185
186
 
171
172
173
 
 
174
175
176
177
 
179
180
181
 
182
183
184
185
@@ -171,8 +171,7 @@
    def interact_handler(self, wrapper):   prompt, password, choices, default = wrapper.data - if isinstance(prompt, str): - prompt = unicode(prompt, 'mbcs') + prompt = hglib.tounicode(prompt)   if choices:   dlg = QMessageBox(QMessageBox.Question,   _('TortoiseHg Prompt'), prompt, @@ -180,7 +179,7 @@
  dlg.setDefaultButton(QMessageBox.Cancel)   rmap = {}   for index, choice in enumerate(choices): - button = dlg.addButton(unicode(choice, 'mbcs'), + button = dlg.addButton(hglib.tounicode(choice),   QMessageBox.ActionRole)   rmap[id(button)] = index   dlg.exec_()