missed translations fix, travis fix, updates

This commit is contained in:
ingvar1995 2017-04-11 21:38:00 +03:00
parent e4998cd5b5
commit 972a073cb9
10 changed files with 61 additions and 112 deletions

View File

@ -1,14 +1,14 @@
language: python language: python
python: python:
- "3.4" - "3.5"
- "3.6"
before_install: before_install:
- sudo apt-get update - sudo apt-get update
- sudo apt-get install -y checkinstall build-essential - sudo apt-get install -y checkinstall build-essential
- sudo apt-get install portaudio19-dev - sudo apt-get install portaudio19-dev
- sudo apt-get install libconfig-dev libvpx-dev check -qq - sudo apt-get install libconfig-dev libvpx-dev check -qq
- sudo apt-get install python3-pyqt5
install: install:
- pip install PySide --no-index --find-links https://parkin.github.io/python-wheelhouse/;
- python ~/virtualenv/python${TRAVIS_PYTHON_VERSION}/bin/pyside_postinstall.py -install
- pip install pyaudio - pip install pyaudio
before_script: before_script:
# OPUS # OPUS

View File

@ -11,7 +11,7 @@ version = program_version + '.0'
MODULES = [] MODULES = []
if system() in ('Windows', 'Darwin'): if system() in ('Windows', 'Darwin'):
MODULES = ['PyAudio', 'PySide'] MODULES = ['PyAudio', 'PyQt5']
else: else:
try: try:
import pyaudio import pyaudio
@ -58,7 +58,8 @@ setup(name='Toxygen',
include_package_data=True, include_package_data=True,
classifiers=[ classifiers=[
'Programming Language :: Python :: 3 :: Only', 'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
], ],
entry_points={ entry_points={
'console_scripts': ['toxygen=toxygen.main:main'], 'console_scripts': ['toxygen=toxygen.main:main'],

View File

@ -120,8 +120,7 @@ class AudioMessageRecorder(widgets.CenteredWidget):
self.record = QtWidgets.QPushButton(self) self.record = QtWidgets.QPushButton(self)
self.record.setGeometry(QtCore.QRect(20, 100, 150, 150)) self.record.setGeometry(QtCore.QRect(20, 100, 150, 150))
self.record.setText(QtWidgets.QApplication.translate("MenuWindow", "Start recording", None, self.record.setText(QtWidgets.QApplication.translate("MenuWindow", "Start recording"))
QtWidgets.QApplication.UnicodeUTF8))
self.record.clicked.connect(self.start_or_stop_recording) self.record.clicked.connect(self.start_or_stop_recording)
self.recording = False self.recording = False
self.friend_num = friend_number self.friend_num = friend_number
@ -129,8 +128,7 @@ class AudioMessageRecorder(widgets.CenteredWidget):
def start_or_stop_recording(self): def start_or_stop_recording(self):
if not self.recording: if not self.recording:
self.recording = True self.recording = True
self.record.setText(QtWidgets.QApplication.translate("MenuWindow", "Stop recording", None, self.record.setText(QtWidgets.QApplication.translate("MenuWindow", "Stop recording"))
QtWidgets.QApplication.UnicodeUTF8))
else: else:
self.close() self.close()

View File

@ -534,8 +534,7 @@ class InlineImageItem(QtWidgets.QScrollArea):
elif event.button() == QtCore.Qt.RightButton: # save inline elif event.button() == QtCore.Qt.RightButton: # save inline
directory = QtWidgets.QFileDialog.getExistingDirectory(self, directory = QtWidgets.QFileDialog.getExistingDirectory(self,
QtWidgets.QApplication.translate("MainWindow", QtWidgets.QApplication.translate("MainWindow",
'Choose folder', None, 'Choose folder'),
QtWidgets.QApplication.UnicodeUTF8),
curr_directory(), curr_directory(),
QtWidgets.QFileDialog.ShowDirsOnly | QtWidgets.QFileDialog.DontUseNativeDialog) QtWidgets.QFileDialog.ShowDirsOnly | QtWidgets.QFileDialog.DontUseNativeDialog)
if directory: if directory:

View File

@ -494,8 +494,7 @@ class MainWindow(QtWidgets.QMainWindow, Singleton):
msgBox.setWindowTitle( msgBox.setWindowTitle(
QtWidgets.QApplication.translate("MainWindow", "Cannot lock app")) QtWidgets.QApplication.translate("MainWindow", "Cannot lock app"))
msgBox.setText( msgBox.setText(
QtWidgets.QApplication.translate("MainWindow", 'Error. Profile password is not set.', None, QtWidgets.QApplication.translate("MainWindow", 'Error. Profile password is not set.'))
QtWidgets.QApplication.UnicodeUTF8))
msgBox.exec_() msgBox.exec_()
def show_menu(self): def show_menu(self):

View File

@ -331,51 +331,39 @@ class WelcomeScreen(CenteredWidget):
self.text.setOpenExternalLinks(True) self.text.setOpenExternalLinks(True)
self.checkbox = QtWidgets.QCheckBox(self) self.checkbox = QtWidgets.QCheckBox(self)
self.checkbox.setGeometry(QtCore.QRect(5, 170, 240, 30)) self.checkbox.setGeometry(QtCore.QRect(5, 170, 240, 30))
self.checkbox.setText(QtWidgets.QApplication.translate('WelcomeScreen', "Don't show again", self.checkbox.setText(QtWidgets.QApplication.translate('WelcomeScreen', "Don't show again"))
None, QtWidgets.QApplication.UnicodeUTF8)) self.setWindowTitle(QtWidgets.QApplication.translate('WelcomeScreen', 'Tip of the day'))
self.setWindowTitle(QtWidgets.QApplication.translate('WelcomeScreen', 'Tip of the day',
None, QtWidgets.QApplication.UnicodeUTF8))
import random import random
num = random.randint(0, 10) num = random.randint(0, 10)
if num == 0: if num == 0:
text = QtWidgets.QApplication.translate('WelcomeScreen', 'Press Esc if you want hide app to tray.', text = QtWidgets.QApplication.translate('WelcomeScreen', 'Press Esc if you want hide app to tray.')
None, QtWidgets.QApplication.UnicodeUTF8)
elif num == 1: elif num == 1:
text = QtWidgets.QApplication.translate('WelcomeScreen', text = QtWidgets.QApplication.translate('WelcomeScreen',
'Right click on screenshot button hides app to tray during screenshot.', 'Right click on screenshot button hides app to tray during screenshot.')
None, QtWidgets.QApplication.UnicodeUTF8)
elif num == 2: elif num == 2:
text = QtWidgets.QApplication.translate('WelcomeScreen', text = QtWidgets.QApplication.translate('WelcomeScreen',
'You can use Tox over Tor. For more info read <a href="https://wiki.tox.chat/users/tox_over_tor_tot">this post</a>', 'You can use Tox over Tor. For more info read <a href="https://wiki.tox.chat/users/tox_over_tor_tot">this post</a>')
None, QtWidgets.QApplication.UnicodeUTF8)
elif num == 3: elif num == 3:
text = QtWidgets.QApplication.translate('WelcomeScreen', text = QtWidgets.QApplication.translate('WelcomeScreen',
'Use Settings -> Interface to customize interface.', 'Use Settings -> Interface to customize interface.')
None, QtWidgets.QApplication.UnicodeUTF8)
elif num == 4: elif num == 4:
text = QtWidgets.QApplication.translate('WelcomeScreen', text = QtWidgets.QApplication.translate('WelcomeScreen',
'Set profile password via Profile -> Settings. Password allows Toxygen encrypt your history and settings.', 'Set profile password via Profile -> Settings. Password allows Toxygen encrypt your history and settings.')
None, QtWidgets.QApplication.UnicodeUTF8)
elif num == 5: elif num == 5:
text = QtWidgets.QApplication.translate('WelcomeScreen', text = QtWidgets.QApplication.translate('WelcomeScreen',
'Since v0.1.3 Toxygen supports plugins. <a href="https://github.com/xveduk/toxygen/blob/master/docs/plugins.md">Read more</a>', 'Since v0.1.3 Toxygen supports plugins. <a href="https://github.com/xveduk/toxygen/blob/master/docs/plugins.md">Read more</a>')
None, QtWidgets.QApplication.UnicodeUTF8)
elif num in (6, 7): elif num in (6, 7):
text = QtWidgets.QApplication.translate('WelcomeScreen', text = QtWidgets.QApplication.translate('WelcomeScreen',
'Toxygen supports faux offline messages and file transfers. Send message or file to offline friend and he will get it later.', 'Toxygen supports faux offline messages and file transfers. Send message or file to offline friend and he will get it later.')
None, QtWidgets.QApplication.UnicodeUTF8)
elif num == 8: elif num == 8:
text = QtWidgets.QApplication.translate('WelcomeScreen', text = QtWidgets.QApplication.translate('WelcomeScreen',
'Delete single message in chat: make right click on spinner or message time and choose "Delete" in menu', 'Delete single message in chat: make right click on spinner or message time and choose "Delete" in menu')
None, QtWidgets.QApplication.UnicodeUTF8)
elif num == 9: elif num == 9:
text = QtWidgets.QApplication.translate('WelcomeScreen', text = QtWidgets.QApplication.translate('WelcomeScreen',
'Use right click on inline image to save it', 'Use right click on inline image to save it')
None, QtWidgets.QApplication.UnicodeUTF8)
else: else:
text = QtWidgets.QApplication.translate('WelcomeScreen', text = QtWidgets.QApplication.translate('WelcomeScreen',
'Set new NoSpam to avoid spam friend requests: Profile -> Settings -> Set new NoSpam.', 'Set new NoSpam to avoid spam friend requests: Profile -> Settings -> Set new NoSpam.')
None, QtWidgets.QApplication.UnicodeUTF8)
self.text.setHtml(text) self.text.setHtml(text)
self.checkbox.stateChanged.connect(self.not_show) self.checkbox.stateChanged.connect(self.not_show)
QtCore.QTimer.singleShot(1000, self.show) QtCore.QTimer.singleShot(1000, self.show)
@ -455,8 +443,7 @@ class SearchScreen(QtWidgets.QWidget):
self.retranslateUi() self.retranslateUi()
def retranslateUi(self): def retranslateUi(self):
self.search_text.setPlaceholderText(QtWidgets.QApplication.translate("MainWindow", "Search", None, self.search_text.setPlaceholderText(QtWidgets.QApplication.translate("MainWindow", "Search"))
QtWidgets.QApplication.UnicodeUTF8))
def show(self): def show(self):
super().show() super().show()
@ -514,13 +501,9 @@ class SearchScreen(QtWidgets.QWidget):
def not_found(text): def not_found(text):
mbox = QtWidgets.QMessageBox() mbox = QtWidgets.QMessageBox()
mbox_text = QtWidgets.QApplication.translate("MainWindow", mbox_text = QtWidgets.QApplication.translate("MainWindow",
'Text "{}" was not found', 'Text "{}" was not found')
None,
QtWidgets.QApplication.UnicodeUTF8)
mbox.setText(mbox_text.format(text)) mbox.setText(mbox_text.format(text))
mbox.setWindowTitle(QtWidgets.QApplication.translate("MainWindow", mbox.setWindowTitle(QtWidgets.QApplication.translate("MainWindow",
'Not found', 'Not found'))
None,
QtWidgets.QApplication.UnicodeUTF8))
mbox.exec_() mbox.exec_()

View File

@ -141,12 +141,12 @@ class ProfileSettings(CenteredWidget):
self.profilepass.setFont(font) self.profilepass.setFont(font)
self.password = LineEdit(self) self.password = LineEdit(self)
self.password.setGeometry(QtCore.QRect(40, 380, 300, 30)) self.password.setGeometry(QtCore.QRect(40, 380, 300, 30))
self.password.setEchoMode(QtWidgets.QLineEdit.EchoMode.Password) self.password.setEchoMode(QtWidgets.QLineEdit.Password)
self.leave_blank = QtWidgets.QLabel(self) self.leave_blank = QtWidgets.QLabel(self)
self.leave_blank.setGeometry(QtCore.QRect(350, 380, 300, 30)) self.leave_blank.setGeometry(QtCore.QRect(350, 380, 300, 30))
self.confirm_password = LineEdit(self) self.confirm_password = LineEdit(self)
self.confirm_password.setGeometry(QtCore.QRect(40, 420, 300, 30)) self.confirm_password.setGeometry(QtCore.QRect(40, 420, 300, 30))
self.confirm_password.setEchoMode(QtWidgets.QLineEdit.EchoMode.Password) self.confirm_password.setEchoMode(QtWidgets.QLineEdit.Password)
self.set_password = QtWidgets.QPushButton(self) self.set_password = QtWidgets.QPushButton(self)
self.set_password.setGeometry(QtCore.QRect(40, 470, 300, 30)) self.set_password.setGeometry(QtCore.QRect(40, 470, 300, 30))
self.set_password.clicked.connect(self.new_password) self.set_password.clicked.connect(self.new_password)
@ -202,12 +202,10 @@ class ProfileSettings(CenteredWidget):
Settings.set_auto_profile(ProfileHelper.get_path(), Settings.get_instance().name) Settings.set_auto_profile(ProfileHelper.get_path(), Settings.get_instance().name)
self.auto = not self.auto self.auto = not self.auto
if self.auto: if self.auto:
self.default.setText(QtWidgets.QApplication.translate("ProfileSettingsForm", "Mark as not default profile", None, self.default.setText(QtWidgets.QApplication.translate("ProfileSettingsForm", "Mark as not default profile"))
QtWidgets.QApplication.UnicodeUTF8))
else: else:
self.default.setText( self.default.setText(
QtWidgets.QApplication.translate("ProfileSettingsForm", "Mark as default profile", None, QtWidgets.QApplication.translate("ProfileSettingsForm", "Mark as default profile"))
QtWidgets.QApplication.UnicodeUTF8))
def new_password(self): def new_password(self):
if self.password.text() == self.confirm_password.text(): if self.password.text() == self.confirm_password.text():
@ -217,12 +215,10 @@ class ProfileSettings(CenteredWidget):
self.close() self.close()
else: else:
self.not_match.setText( self.not_match.setText(
QtWidgets.QApplication.translate("ProfileSettingsForm", "Password must be at least 8 symbols", None, QtWidgets.QApplication.translate("ProfileSettingsForm", "Password must be at least 8 symbols"))
QtWidgets.QApplication.UnicodeUTF8))
self.not_match.setVisible(True) self.not_match.setVisible(True)
else: else:
self.not_match.setText(QtWidgets.QApplication.translate("ProfileSettingsForm", "Passwords do not match", None, self.not_match.setText(QtWidgets.QApplication.translate("ProfileSettingsForm", "Passwords do not match"))
QtWidgets.QApplication.UnicodeUTF8))
self.not_match.setVisible(True) self.not_match.setVisible(True)
def copy(self): def copy(self):
@ -686,21 +682,19 @@ class InterfaceSettings(CenteredWidget):
def new_font(self): def new_font(self):
settings = Settings.get_instance() settings = Settings.get_instance()
font, ok = QtGui.QFontDialog.getFont(QtGui.QFont(settings['font'], 10), self) font, ok = QtWidgets.QFontDialog.getFont(QtGui.QFont(settings['font'], 10), self)
if ok: if ok:
settings['font'] = font.family() settings['font'] = font.family()
settings.save() settings.save()
msgBox = QtWidgets.QMessageBox() msgBox = QtWidgets.QMessageBox()
text = QtWidgets.QApplication.translate("interfaceForm", 'Restart app to apply settings', None, text = QtWidgets.QApplication.translate("interfaceForm", 'Restart app to apply settings')
QtWidgets.QApplication.UnicodeUTF8) msgBox.setWindowTitle(QtWidgets.QApplication.translate("interfaceForm", 'Restart required'))
msgBox.setWindowTitle(QtWidgets.QApplication.translate("interfaceForm", 'Restart required', None,
QtWidgets.QApplication.UnicodeUTF8))
msgBox.setText(text) msgBox.setText(text)
msgBox.exec_() msgBox.exec_()
def select_color(self): def select_color(self):
settings = Settings.get_instance() settings = Settings.get_instance()
col = QtGui.QColorDialog.getColor(settings['unread_color']) col = QtWidgets.QColorDialog.getColor(QtGui.QColor(settings['unread_color']))
if col.isValid(): if col.isValid():
name = col.name() name = col.name()

View File

@ -1,8 +1,5 @@
from widgets import CenteredWidget, LineEdit from widgets import CenteredWidget, LineEdit
try: from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5 import QtCore, QtGui
except ImportError:
from PyQt4 import QtCore, QtGui
class PasswordArea(LineEdit): class PasswordArea(LineEdit):
@ -10,7 +7,7 @@ class PasswordArea(LineEdit):
def __init__(self, parent): def __init__(self, parent):
super(PasswordArea, self).__init__(parent) super(PasswordArea, self).__init__(parent)
self.parent = parent self.parent = parent
self.setEchoMode(QtWidgets.QLineEdit.EchoMode.Password) self.setEchoMode(QtWidgets.QLineEdit.Password)
def keyPressEvent(self, event): def keyPressEvent(self, event):
if event.key() == QtCore.Qt.Key_Return: if event.key() == QtCore.Qt.Key_Return:
@ -116,10 +113,10 @@ class SetProfilePasswordScreen(CenteredWidget):
self.setMaximumSize(QtCore.QSize(700, 200)) self.setMaximumSize(QtCore.QSize(700, 200))
self.password = LineEdit(self) self.password = LineEdit(self)
self.password.setGeometry(QtCore.QRect(40, 10, 300, 30)) self.password.setGeometry(QtCore.QRect(40, 10, 300, 30))
self.password.setEchoMode(QtWidgets.QLineEdit.EchoMode.Password) self.password.setEchoMode(QtWidgets.QLineEdit.Password)
self.confirm_password = LineEdit(self) self.confirm_password = LineEdit(self)
self.confirm_password.setGeometry(QtCore.QRect(40, 50, 300, 30)) self.confirm_password.setGeometry(QtCore.QRect(40, 50, 300, 30))
self.confirm_password.setEchoMode(QtWidgets.QLineEdit.EchoMode.Password) self.confirm_password.setEchoMode(QtWidgets.QLineEdit.Password)
self.set_password = QtWidgets.QPushButton(self) self.set_password = QtWidgets.QPushButton(self)
self.set_password.setGeometry(QtCore.QRect(40, 100, 300, 30)) self.set_password.setGeometry(QtCore.QRect(40, 100, 300, 30))
self.set_password.clicked.connect(self.new_password) self.set_password.clicked.connect(self.new_password)
@ -132,21 +129,16 @@ class SetProfilePasswordScreen(CenteredWidget):
self.warning.setStyleSheet('QLabel { color: #BC1C1C; }') self.warning.setStyleSheet('QLabel { color: #BC1C1C; }')
def retranslateUi(self): def retranslateUi(self):
self.setWindowTitle(QtWidgets.QApplication.translate("PasswordScreen", "Profile password", None, self.setWindowTitle(QtWidgets.QApplication.translate("PasswordScreen", "Profile password"))
QtWidgets.QApplication.UnicodeUTF8))
self.password.setPlaceholderText( self.password.setPlaceholderText(
QtWidgets.QApplication.translate("PasswordScreen", "Password (at least 8 symbols)", None, QtWidgets.QApplication.translate("PasswordScreen", "Password (at least 8 symbols)"))
QtWidgets.QApplication.UnicodeUTF8))
self.confirm_password.setPlaceholderText( self.confirm_password.setPlaceholderText(
QtWidgets.QApplication.translate("PasswordScreen", "Confirm password", None, QtWidgets.QApplication.translate("PasswordScreen", "Confirm password"))
QtWidgets.QApplication.UnicodeUTF8))
self.set_password.setText( self.set_password.setText(
QtWidgets.QApplication.translate("PasswordScreen", "Set password")) QtWidgets.QApplication.translate("PasswordScreen", "Set password"))
self.not_match.setText(QtWidgets.QApplication.translate("PasswordScreen", "Passwords do not match", None, self.not_match.setText(QtWidgets.QApplication.translate("PasswordScreen", "Passwords do not match"))
QtWidgets.QApplication.UnicodeUTF8))
self.warning.setText( self.warning.setText(
QtWidgets.QApplication.translate("PasswordScreen", "There is no way to recover lost passwords", None, QtWidgets.QApplication.translate("PasswordScreen", "There is no way to recover lost passwords"))
QtWidgets.QApplication.UnicodeUTF8))
def new_password(self): def new_password(self):
if self.password.text() == self.confirm_password.text(): if self.password.text() == self.confirm_password.text():
@ -155,10 +147,8 @@ class SetProfilePasswordScreen(CenteredWidget):
self.close() self.close()
else: else:
self.not_match.setText( self.not_match.setText(
QtWidgets.QApplication.translate("PasswordScreen", "Password must be at least 8 symbols", None, QtWidgets.QApplication.translate("PasswordScreen", "Password must be at least 8 symbols"))
QtWidgets.QApplication.UnicodeUTF8))
self.not_match.setVisible(True) self.not_match.setVisible(True)
else: else:
self.not_match.setText(QtWidgets.QApplication.translate("PasswordScreen", "Passwords do not match", None, self.not_match.setText(QtWidgets.QApplication.translate("PasswordScreen", "Passwords do not match"))
QtWidgets.QApplication.UnicodeUTF8))
self.not_match.setVisible(True) self.not_match.setVisible(True)

View File

@ -96,8 +96,7 @@ class Profile(basecontact.BaseContact, Singleton):
tmp = self.name tmp = self.name
super(Profile, self).set_name(value.encode('utf-8')) super(Profile, self).set_name(value.encode('utf-8'))
self._tox.self_set_name(self._name.encode('utf-8')) self._tox.self_set_name(self._name.encode('utf-8'))
message = QtWidgets.QApplication.translate("MainWindow", 'User {} is now known as {}', None, message = QtWidgets.QApplication.translate("MainWindow", 'User {} is now known as {}')
QtWidgets.QApplication.UnicodeUTF8)
message = message.format(tmp, value) message = message.format(tmp, value)
for friend in self._contacts: for friend in self._contacts:
friend.append_message(InfoMessage(message, time.time())) friend.append_message(InfoMessage(message, time.time()))
@ -663,12 +662,10 @@ class Profile(basecontact.BaseContact, Singleton):
friend = self._contacts[num] friend = self._contacts[num]
name = friend.name name = friend.name
dialog = QtWidgets.QApplication.translate('MainWindow', dialog = QtWidgets.QApplication.translate('MainWindow',
"Enter new alias for friend {} or leave empty to use friend's name:", "Enter new alias for friend {} or leave empty to use friend's name:")
None, QtWidgets.QApplication.UnicodeUTF8)
dialog = dialog.format(name) dialog = dialog.format(name)
title = QtWidgets.QApplication.translate('MainWindow', title = QtWidgets.QApplication.translate('MainWindow',
'Set alias', 'Set alias')
None, QtWidgets.QApplication.UnicodeUTF8)
text, ok = QtGui.QInputDialog.getText(None, text, ok = QtGui.QInputDialog.getText(None,
title, title,
dialog, dialog,
@ -1204,11 +1201,9 @@ class Profile(basecontact.BaseContact, Singleton):
self._call(num, audio, video) self._call(num, audio, video)
self._screen.active_call() self._screen.active_call()
if video: if video:
text = QtWidgets.QApplication.translate("incoming_call", "Outgoing video call", None, text = QtWidgets.QApplication.translate("incoming_call", "Outgoing video call")
QtWidgets.QApplication.UnicodeUTF8)
else: else:
text = QtWidgets.QApplication.translate("incoming_call", "Outgoing audio call", None, text = QtWidgets.QApplication.translate("incoming_call", "Outgoing audio call")
QtWidgets.QApplication.UnicodeUTF8)
self.get_curr_friend().append_message(InfoMessage(text, time.time())) self.get_curr_friend().append_message(InfoMessage(text, time.time()))
self.create_message_item(text, time.time(), '', MESSAGE_TYPE['INFO_MESSAGE']) self.create_message_item(text, time.time(), '', MESSAGE_TYPE['INFO_MESSAGE'])
self._messages.scrollToBottom() self._messages.scrollToBottom()
@ -1223,11 +1218,9 @@ class Profile(basecontact.BaseContact, Singleton):
return return
friend = self.get_friend_by_number(friend_number) friend = self.get_friend_by_number(friend_number)
if video: if video:
text = QtWidgets.QApplication.translate("incoming_call", "Incoming video call", None, text = QtWidgets.QApplication.translate("incoming_call", "Incoming video call")
QtWidgets.QApplication.UnicodeUTF8)
else: else:
text = QtWidgets.QApplication.translate("incoming_call", "Incoming audio call", None, text = QtWidgets.QApplication.translate("incoming_call", "Incoming audio call")
QtWidgets.QApplication.UnicodeUTF8)
friend.append_message(InfoMessage(text, time.time())) friend.append_message(InfoMessage(text, time.time()))
self._incoming_calls.add(friend_number) self._incoming_calls.add(friend_number)
if friend_number == self.get_active_number(): if friend_number == self.get_active_number():

View File

@ -85,29 +85,21 @@ def create_menu(menu):
text = action.text() text = action.text()
if 'Link Location' in text: if 'Link Location' in text:
text = text.replace('Copy &Link Location', text = text.replace('Copy &Link Location',
QtWidgets.QApplication.translate("MainWindow", "Copy link location", None, QtWidgets.QApplication.translate("MainWindow", "Copy link location"))
QtWidgets.QApplication.UnicodeUTF8))
elif '&Copy' in text: elif '&Copy' in text:
text = text.replace('&Copy', QtWidgets.QApplication.translate("MainWindow", "Copy", None, text = text.replace('&Copy', QtWidgets.QApplication.translate("MainWindow", "Copy"))
QtWidgets.QApplication.UnicodeUTF8))
elif 'All' in text: elif 'All' in text:
text = text.replace('Select All', QtWidgets.QApplication.translate("MainWindow", "Select all", None, text = text.replace('Select All', QtWidgets.QApplication.translate("MainWindow", "Select all"))
QtWidgets.QApplication.UnicodeUTF8))
elif 'Delete' in text: elif 'Delete' in text:
text = text.replace('Delete', QtWidgets.QApplication.translate("MainWindow", "Delete", None, text = text.replace('Delete', QtWidgets.QApplication.translate("MainWindow", "Delete"))
QtWidgets.QApplication.UnicodeUTF8))
elif '&Paste' in text: elif '&Paste' in text:
text = text.replace('&Paste', QtWidgets.QApplication.translate("MainWindow", "Paste", None, text = text.replace('&Paste', QtWidgets.QApplication.translate("MainWindow", "Paste"))
QtWidgets.QApplication.UnicodeUTF8))
elif 'Cu&t' in text: elif 'Cu&t' in text:
text = text.replace('Cu&t', QtWidgets.QApplication.translate("MainWindow", "Cut", None, text = text.replace('Cu&t', QtWidgets.QApplication.translate("MainWindow", "Cut"))
QtWidgets.QApplication.UnicodeUTF8))
elif '&Undo' in text: elif '&Undo' in text:
text = text.replace('&Undo', QtWidgets.QApplication.translate("MainWindow", "Undo", None, text = text.replace('&Undo', QtWidgets.QApplication.translate("MainWindow", "Undo"))
QtWidgets.QApplication.UnicodeUTF8))
elif '&Redo' in text: elif '&Redo' in text:
text = text.replace('&Redo', QtWidgets.QApplication.translate("MainWindow", "Redo", None, text = text.replace('&Redo', QtWidgets.QApplication.translate("MainWindow", "Redo"))
QtWidgets.QApplication.UnicodeUTF8))
else: else:
menu.removeAction(action) menu.removeAction(action)
continue continue