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'):
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
def update_transfer_data(self, file_number, status, inline=None):
@ -388,7 +388,7 @@ class Profile(Contact, Singleton):
if value is not None:
self._active_friend = value
friend = self._friends[value]
self._friends[self._active_friend].set_messages(False)
self._friends[value].set_messages(False)
self._screen.messageEdit.clear()
self._messages.clear()
friend.load_corr()
@ -587,7 +587,6 @@ class Profile(Contact, Singleton):
else:
self._messages.insertItem(0, elem)
self._messages.setItemWidget(elem, item)
self._messages.repaint()
def create_file_transfer_item(self, tm, append=True):
data = list(tm.get_data())
@ -600,7 +599,6 @@ class Profile(Contact, Singleton):
else:
self._messages.insertItem(0, elem)
self._messages.setItemWidget(elem, item)
self._messages.repaint()
return item
def create_inline_item(self, data, append=True):
@ -612,7 +610,6 @@ class Profile(Contact, Singleton):
else:
self._messages.insertItem(0, elem)
self._messages.setItemWidget(elem, item)
self._messages.repaint()
# -----------------------------------------------------------------------------------------------------------------
# Work with friends (remove, set alias, get public key)
@ -621,8 +618,17 @@ class Profile(Contact, Singleton):
def set_alias(self, num):
friend = self._friends[num]
name = friend.name.encode('utf-8')
dialog = "Enter new alias for friend " + name.decode('utf-8') + " or leave empty to use friend's name:"
text, ok = QtGui.QInputDialog.getText(None, 'Set alias', dialog)
dialog = QtGui.QApplication.translate('MainWindow',
"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:
settings = Settings.get_instance()
aliases = settings['friends_aliases']
@ -889,8 +895,7 @@ class Profile(Contact, Singleton):
inline = InlineImage(transfer.get_data())
self.get_friend_by_number(friend_number).update_transfer_data(file_number,
FILE_TRANSFER_MESSAGE_STATUS['FINISHED'],
inline
)
inline)
self.set_active(self._active_friend)
else:
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>
</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>
<translation></translation>
</message>
<message>
<location filename="profile.py" line="702"/>
<location filename="profile.py" line="715"/>
<source>Friend request</source>
<translation></translation>
</message>
@ -155,6 +155,11 @@
<source>Remove friend</source>
<translation></translation>
</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>
<name>NetworkSettings</name>

View File

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

Binary file not shown.

View File

@ -105,14 +105,14 @@
<translation>О программе</translation>
</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>
<translation>Пользователь {} хочет добавить Вас в список контактов. Сообщение:
{}</translation>
</message>
<message>
<location filename="profile.py" line="702"/>
<location filename="profile.py" line="715"/>
<source>Friend request</source>
<translation>Запрос на добавление в друзья</translation>
</message>
@ -156,6 +156,11 @@
<source>Remove friend</source>
<translation>Удалить друга</translation>
</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>
<name>NetworkSettings</name>