Changeset d77ffc629000…
Parent e65766f45f7e…
by
Changes to 2 files · Browse files at d77ffc629000 Showing diff from parent e65766f45f7e Diff from another changeset...
@@ -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,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_()
|
Loading...