fixed repaint bug, translations update

This commit is contained in:
ingvar1995 2016-04-14 20:45:29 +03:00
parent 23a682cbdf
commit 7d7efa6acd
6 changed files with 85 additions and 52 deletions

View File

@ -201,7 +201,7 @@ class Friend(Contact):
""" """
if hasattr(self, '_message_getter'): if hasattr(self, '_message_getter'):
del self._message_getter del self._message_getter
self._corr = filter(lambda x: x.get_type() == 2, self._corr) self._corr = filter(lambda x: x.get_type() == 2 and x.get_status() in (2, 4), self._corr)
self._unsaved_messages = 0 self._unsaved_messages = 0
def update_transfer_data(self, file_number, status, inline=None): def update_transfer_data(self, file_number, status, inline=None):
@ -388,7 +388,7 @@ class Profile(Contact, Singleton):
if value is not None: if value is not None:
self._active_friend = value self._active_friend = value
friend = self._friends[value] friend = self._friends[value]
self._friends[self._active_friend].set_messages(False) self._friends[value].set_messages(False)
self._screen.messageEdit.clear() self._screen.messageEdit.clear()
self._messages.clear() self._messages.clear()
friend.load_corr() friend.load_corr()
@ -587,7 +587,6 @@ class Profile(Contact, Singleton):
else: else:
self._messages.insertItem(0, elem) self._messages.insertItem(0, elem)
self._messages.setItemWidget(elem, item) self._messages.setItemWidget(elem, item)
self._messages.repaint()
def create_file_transfer_item(self, tm, append=True): def create_file_transfer_item(self, tm, append=True):
data = list(tm.get_data()) data = list(tm.get_data())
@ -600,7 +599,6 @@ class Profile(Contact, Singleton):
else: else:
self._messages.insertItem(0, elem) self._messages.insertItem(0, elem)
self._messages.setItemWidget(elem, item) self._messages.setItemWidget(elem, item)
self._messages.repaint()
return item return item
def create_inline_item(self, data, append=True): def create_inline_item(self, data, append=True):
@ -612,7 +610,6 @@ class Profile(Contact, Singleton):
else: else:
self._messages.insertItem(0, elem) self._messages.insertItem(0, elem)
self._messages.setItemWidget(elem, item) self._messages.setItemWidget(elem, item)
self._messages.repaint()
# ----------------------------------------------------------------------------------------------------------------- # -----------------------------------------------------------------------------------------------------------------
# Work with friends (remove, set alias, get public key) # Work with friends (remove, set alias, get public key)
@ -621,8 +618,17 @@ class Profile(Contact, Singleton):
def set_alias(self, num): def set_alias(self, num):
friend = self._friends[num] friend = self._friends[num]
name = friend.name.encode('utf-8') name = friend.name.encode('utf-8')
dialog = "Enter new alias for friend " + name.decode('utf-8') + " or leave empty to use friend's name:" dialog = QtGui.QApplication.translate('MainWindow',
text, ok = QtGui.QInputDialog.getText(None, 'Set alias', dialog) "Enter new alias for friend {} or leave empty to use friend's name:",
None, QtGui.QApplication.UnicodeUTF8)
dialog = dialog.format(name.decode('utf-8'))
title = QtGui.QApplication.translate('MainWindow',
'Set alias',
None, QtGui.QApplication.UnicodeUTF8)
text, ok = QtGui.QInputDialog.getText(None,
title,
dialog)
if ok: if ok:
settings = Settings.get_instance() settings = Settings.get_instance()
aliases = settings['friends_aliases'] aliases = settings['friends_aliases']
@ -889,8 +895,7 @@ class Profile(Contact, Singleton):
inline = InlineImage(transfer.get_data()) inline = InlineImage(transfer.get_data())
self.get_friend_by_number(friend_number).update_transfer_data(file_number, self.get_friend_by_number(friend_number).update_transfer_data(file_number,
FILE_TRANSFER_MESSAGE_STATUS['FINISHED'], FILE_TRANSFER_MESSAGE_STATUS['FINISHED'],
inline inline)
)
self.set_active(self._active_friend) self.set_active(self._active_friend)
else: else:
self.get_friend_by_number(friend_number).update_transfer_data(file_number, FILE_TRANSFER_MESSAGE_STATUS['FINISHED']) self.get_friend_by_number(friend_number).update_transfer_data(file_number, FILE_TRANSFER_MESSAGE_STATUS['FINISHED'])

Binary file not shown.

View File

@ -105,13 +105,13 @@
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="700"/> <location filename="profile.py" line="713"/>
<source>User {} wants to add you to contact list. Message: <source>User {} wants to add you to contact list. Message:
{}</source> {}</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="702"/> <location filename="profile.py" line="715"/>
<source>Friend request</source> <source>Friend request</source>
<translation></translation> <translation></translation>
</message> </message>
@ -155,6 +155,11 @@
<source>Remove friend</source> <source>Remove friend</source>
<translation></translation> <translation></translation>
</message> </message>
<message>
<location filename="profile.py" line="624"/>
<source>Enter new alias for friend {} or leave empty to use friend&apos;s name:</source>
<translation>Enter new alias for friend {} or leave empty to use friend&apos;s name:</translation>
</message>
</context> </context>
<context> <context>
<name>NetworkSettings</name> <name>NetworkSettings</name>

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS> <!DOCTYPE TS><TS version="1.1" language="fr">
<TS version="2.0" language="fr">
<context> <context>
<name>AddContact</name> <name>AddContact</name>
<message> <message>
@ -52,7 +51,7 @@
<translation>Port :</translation> <translation>Port :</translation>
</message> </message>
<message> <message>
<location filename="mainscreen.py" line="140"/> <location filename="mainscreen.py" line="87"/>
<source>Online contacts</source> <source>Online contacts</source>
<translation>Contacts connectés</translation> <translation>Contacts connectés</translation>
</message> </message>
@ -60,102 +59,106 @@
<context> <context>
<name>MainWindow</name> <name>MainWindow</name>
<message> <message>
<location filename="mainscreen.py" line="86"/> <location filename="mainscreen.py" line="92"/>
<source>Profile</source> <source>Profile</source>
<translation>Profile</translation> <translation>Profile</translation>
</message> </message>
<message> <message>
<location filename="mainscreen.py" line="92"/> <location filename="mainscreen.py" line="98"/>
<source>Settings</source> <source>Settings</source>
<translation>Paramêtres</translation> <translation>Paramêtres</translation>
</message> </message>
<message> <message>
<location filename="mainscreen.py" line="275"/> <location filename="mainscreen.py" line="280"/>
<source>About</source> <source>About</source>
<translation>À Propos</translation> <translation>À Propos</translation>
</message> </message>
<message> <message>
<location filename="mainscreen.py" line="85"/> <location filename="mainscreen.py" line="91"/>
<source>Add contact</source> <source>Add contact</source>
<translation>Rajouter un contact</translation> <translation>Rajouter un contact</translation>
</message> </message>
<message> <message>
<location filename="mainscreen.py" line="87"/> <location filename="mainscreen.py" line="93"/>
<source>Privacy</source> <source>Privacy</source>
<translation>Confidentialité</translation> <translation>Confidentialité</translation>
</message> </message>
<message> <message>
<location filename="mainscreen.py" line="88"/> <location filename="mainscreen.py" line="94"/>
<source>Interface</source> <source>Interface</source>
<translation>Interface</translation> <translation>Interface</translation>
</message> </message>
<message> <message>
<location filename="mainscreen.py" line="89"/> <location filename="mainscreen.py" line="95"/>
<source>Notifications</source> <source>Notifications</source>
<translation>Notifications</translation> <translation>Notifications</translation>
</message> </message>
<message> <message>
<location filename="mainscreen.py" line="90"/> <location filename="mainscreen.py" line="96"/>
<source>Network</source> <source>Network</source>
<translation>Réseau</translation> <translation>Réseau</translation>
</message> </message>
<message> <message>
<location filename="mainscreen.py" line="91"/> <location filename="mainscreen.py" line="97"/>
<source>About program</source> <source>About program</source>
<translation>À propos du programme</translation> <translation>À propos du programme</translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="686"/> <location filename="profile.py" line="713"/>
<source>User {} wants to add you to contact list. Message: <source>User {} wants to add you to contact list. Message:
{}</source> {}</source>
<translation>L&apos;Utilisateur {} veut vout rajouter à sa liste de contacts. Message : {}</translation> <translation>L&apos;Utilisateur {} veut vout rajouter à sa liste de contacts. Message : {}</translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="688"/> <location filename="profile.py" line="715"/>
<source>Friend request</source> <source>Friend request</source>
<translatorcomment>D&apos;un ami ? De l&apos;ami ?</translatorcomment>
<translation>Demande d&apos;amis</translation> <translation>Demande d&apos;amis</translation>
</message> </message>
<message> <message>
<location filename="mainscreen.py" line="276"/> <location filename="mainscreen.py" line="281"/>
<source>Toxygen is Tox client written on Python 2.7. Version: </source> <source>Toxygen is Tox client written on Python 2.7. Version: </source>
<translation>Toxygen est un client Tox écris en Python 2.7. Version : </translation> <translation>Toxygen est un client Tox écris en Python 2.7. Version : </translation>
</message> </message>
<message> <message>
<location filename="mainscreen.py" line="314"/> <location filename="mainscreen.py" line="319"/>
<source>Choose file</source> <source>Choose file</source>
<translation>Choisir un fichier</translation> <translation>Choisir un fichier</translation>
</message> </message>
<message> <message>
<location filename="mainscreen.py" line="333"/> <location filename="mainscreen.py" line="338"/>
<source>Disallow auto accept</source> <source>Disallow auto accept</source>
<translation>Désactiver l&apos;auto-réception</translation> <translation>Désactiver l&apos;auto-réception</translation>
</message> </message>
<message> <message>
<location filename="mainscreen.py" line="334"/> <location filename="mainscreen.py" line="339"/>
<source>Allow auto accept</source> <source>Allow auto accept</source>
<translation>Activer l&apos;auto-réception</translation> <translation>Activer l&apos;auto-réception</translation>
</message> </message>
<message> <message>
<location filename="mainscreen.py" line="336"/> <location filename="mainscreen.py" line="341"/>
<source>Set alias</source> <source>Set alias</source>
<translation>Définir un alias</translation> <translation>Définir un alias</translation>
</message> </message>
<message> <message>
<location filename="mainscreen.py" line="337"/> <location filename="mainscreen.py" line="342"/>
<source>Clear history</source> <source>Clear history</source>
<translation>Vider l&apos;historique</translation> <translation>Vider l&apos;historique</translation>
</message> </message>
<message> <message>
<location filename="mainscreen.py" line="338"/> <location filename="mainscreen.py" line="343"/>
<source>Copy public key</source> <source>Copy public key</source>
<translation>Copier la clé publique</translation> <translation>Copier la clé publique</translation>
</message> </message>
<message> <message>
<location filename="mainscreen.py" line="340"/> <location filename="mainscreen.py" line="345"/>
<source>Remove friend</source> <source>Remove friend</source>
<translation>Retirer un ami</translation> <translation>Retirer un ami</translation>
</message> </message>
<message>
<location filename="profile.py" line="624"/>
<source>Enter new alias for friend {} or leave empty to use friend&apos;s name:</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>NetworkSettings</name> <name>NetworkSettings</name>
@ -211,17 +214,17 @@
<context> <context>
<name>interfaceForm</name> <name>interfaceForm</name>
<message> <message>
<location filename="menu.py" line="402"/> <location filename="menu.py" line="420"/>
<source>Interface settings</source> <source>Interface settings</source>
<translation>Paramêtres de l&apos;interface</translation> <translation>Paramêtres de l&apos;interface</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="403"/> <location filename="menu.py" line="421"/>
<source>Theme:</source> <source>Theme:</source>
<translation>Thème :</translation> <translation>Thème :</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="404"/> <location filename="menu.py" line="422"/>
<source>Language:</source> <source>Language:</source>
<translation>Langue :</translation> <translation>Langue :</translation>
</message> </message>
@ -269,7 +272,7 @@
<translation>toxygen</translation> <translation>toxygen</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="70"/> <location filename="main.py" line="80"/>
<source>Looks like other instance of Toxygen uses this profile! Continue?</source> <source>Looks like other instance of Toxygen uses this profile! Continue?</source>
<translation>Il semble qu&apos;une autre instance de Toxygen utilise ce profil ! Continuer ?</translation> <translation>Il semble qu&apos;une autre instance de Toxygen utilise ce profil ! Continuer ?</translation>
</message> </message>
@ -277,22 +280,22 @@
<context> <context>
<name>notificationsForm</name> <name>notificationsForm</name>
<message> <message>
<location filename="menu.py" line="342"/> <location filename="menu.py" line="361"/>
<source>Notification settings</source> <source>Notification settings</source>
<translation>Paramêtres de notification</translation> <translation>Paramêtres de notification</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="343"/> <location filename="menu.py" line="362"/>
<source>Enable notifications</source> <source>Enable notifications</source>
<translation>Activer les notifications</translation> <translation>Activer les notifications</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="344"/> <location filename="menu.py" line="363"/>
<source>Enable call&apos;s sound</source> <source>Enable call&apos;s sound</source>
<translation>Activer les sons d&apos;appel</translation> <translation>Activer les sons d&apos;appel</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="345"/> <location filename="menu.py" line="364"/>
<source>Enable sound notifications</source> <source>Enable sound notifications</source>
<translation>Activer les sons de notifications</translation> <translation>Activer les sons de notifications</translation>
</message> </message>
@ -300,45 +303,60 @@
<context> <context>
<name>privacySettings</name> <name>privacySettings</name>
<message> <message>
<location filename="menu.py" line="289"/> <location filename="menu.py" line="294"/>
<source>Privacy settings</source> <source>Privacy settings</source>
<translation>Paramêtres de confidentialité</translation> <translation>Paramêtres de confidentialité</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="290"/> <location filename="menu.py" line="295"/>
<source>Save chat history</source> <source>Save chat history</source>
<translation>Sauvegarder l&apos;historique du chat</translation> <translation>Sauvegarder l&apos;historique du chat</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="291"/> <location filename="menu.py" line="296"/>
<source>Allow file auto accept</source> <source>Allow file auto accept</source>
<translation>Autoriser les fichier automatiquement</translation> <translation>Autoriser les fichier automatiquement</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="292"/> <location filename="menu.py" line="297"/>
<source>Send typing notifications</source> <source>Send typing notifications</source>
<translation>Notifier la frappe</translation> <translation>Notifier la frappe</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="293"/> <location filename="menu.py" line="298"/>
<source>Auto accept default path:</source> <source>Auto accept default path:</source>
<translation>Chemin d&apos;accès des fichiers acceptés automatiquement :</translation> <translation>Chemin d&apos;accès des fichiers acceptés automatiquement :</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="294"/> <location filename="menu.py" line="299"/>
<source>Change</source> <source>Change</source>
<translation>Modifier</translation> <translation>Modifier</translation>
</message> </message>
<message>
<location filename="menu.py" line="300"/>
<source>Allow inlines</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="menu.py" line="310"/>
<source>Chat history</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="menu.py" line="313"/>
<source>History will be cleaned! Continue?</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>tray</name> <name>tray</name>
<message> <message>
<location filename="main.py" line="85"/> <location filename="main.py" line="106"/>
<source>Open Toxygen</source> <source>Open Toxygen</source>
<translation>Ouvrir Toxygen</translation> <translation>Ouvrir Toxygen</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="86"/> <location filename="main.py" line="107"/>
<source>Exit</source> <source>Exit</source>
<translation>Quitter</translation> <translation>Quitter</translation>
</message> </message>

Binary file not shown.

View File

@ -105,14 +105,14 @@
<translation>О программе</translation> <translation>О программе</translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="700"/> <location filename="profile.py" line="713"/>
<source>User {} wants to add you to contact list. Message: <source>User {} wants to add you to contact list. Message:
{}</source> {}</source>
<translation>Пользователь {} хочет добавить Вас в список контактов. Сообщение: <translation>Пользователь {} хочет добавить Вас в список контактов. Сообщение:
{}</translation> {}</translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="702"/> <location filename="profile.py" line="715"/>
<source>Friend request</source> <source>Friend request</source>
<translation>Запрос на добавление в друзья</translation> <translation>Запрос на добавление в друзья</translation>
</message> </message>
@ -156,6 +156,11 @@
<source>Remove friend</source> <source>Remove friend</source>
<translation>Удалить друга</translation> <translation>Удалить друга</translation>
</message> </message>
<message>
<location filename="profile.py" line="624"/>
<source>Enter new alias for friend {} or leave empty to use friend&apos;s name:</source>
<translation>Введите новый псевдоним для друга {} или оставьте пустым для использования его имени:</translation>
</message>
</context> </context>
<context> <context>
<name>NetworkSettings</name> <name>NetworkSettings</name>