Fix about dialog with PyQT4 by turning off translation

Fix #312
This commit is contained in:
Julien Duponchelle
2015-05-04 12:04:30 +02:00
parent 756f1dd218
commit 553e3b02f5
50 changed files with 176066 additions and 176356 deletions

View File

@@ -81,7 +81,9 @@ def patch_file_qt4_5(target):
print("Patch {} for Qt4 and Qt5 support".format(target))
with open(target) as f:
for line in f.readlines():
out += re.sub(r"^from PyQt[45] ", "from gns3.qt ", line)
line = re.sub(r"^from PyQt[45] ", "import gns3.qt\nfrom gns3.qt ", line)
line = re.sub(r"_translate = QtCore\.QCoreApplication\.translate", "_translate = gns3.qt.translate", line)
out += line
with open(target, 'w') as f:
f.write(out)