20 Commits

Author SHA1 Message Date
2ad78bc56d translation update and bug fixes 2016-06-29 15:39:44 +03:00
ff196d8d92 docs update 2016-06-28 21:47:49 +03:00
7a77b56560 bug fixes with messages saving 2016-06-28 13:51:11 +03:00
b982df70ea messages update - deleting, unsent messages saving, bug fixes 2016-06-28 12:44:27 +03:00
a56693547c new smiley pack + fixes 2016-06-27 19:28:43 +03:00
699fe59706 smileys - last dups 2016-06-26 18:20:11 +03:00
e78bc846b8 smileys fix 2016-06-26 18:02:05 +03:00
fc2b53d4a5 Merge branch 'python3' into develop 2016-06-25 22:29:43 +03:00
82184b3df1 bug with status fixed 2016-06-25 15:40:01 +03:00
5cfa484a67 name && status bug fixes 2016-06-24 15:00:13 +03:00
27a5735dc1 bug fixes 2016-06-23 22:50:17 +03:00
a714c1045d profile loading/creation update, bug fixes 2016-06-23 15:04:36 +03:00
a4da3a7afa docs update 2016-06-23 12:46:48 +03:00
190877f5b9 aliases 2016-06-23 12:21:26 +03:00
55f13cbfd1 audio, smileys fixes 2016-06-23 11:18:18 +03:00
b9cbf809b5 windows bug fixes 2016-06-22 16:09:44 +03:00
5a0843d98b plugins fixes, improvements 2016-06-22 14:35:22 +03:00
fb74ea4455 inlines fix 2016-06-22 11:48:00 +03:00
42aa102d1d encrypt save support, smileys fix, bug fixes 2016-06-21 23:43:43 +03:00
dd53c6a842 first commit 2016-06-21 14:58:11 +03:00
91 changed files with 662 additions and 509 deletions

View File

@ -1,5 +1,5 @@
# Toxygen # Toxygen
Toxygen is cross-platform [Tox](https://tox.chat/) client written on Python Toxygen is cross-platform [Tox](https://tox.chat/) client written in Python3
[![Release](https://img.shields.io/github/release/xveduk/toxygen.svg?style=flat)](https://github.com/xveduk/toxygen/releases/latest) [![Release](https://img.shields.io/github/release/xveduk/toxygen.svg?style=flat)](https://github.com/xveduk/toxygen/releases/latest)
[![Open issues](https://img.shields.io/github/issues/xveduk/toxygen.svg?style=flat)](https://github.com/xveduk/toxygen/issues) [![Open issues](https://img.shields.io/github/issues/xveduk/toxygen.svg?style=flat)](https://github.com/xveduk/toxygen/issues)
@ -15,10 +15,16 @@ Toxygen is cross-platform [Tox](https://tox.chat/) client written on Python
- [x] 1v1 messages - [x] 1v1 messages
- [x] File transfers - [x] File transfers
- [x] Audio - [x] Audio
- [x] Plugins support
- [x] Chat history - [x] Chat history
- [x] Emoticons
- [x] Stickers
- [x] Screenshots - [x] Screenshots
- [x] Name lookups (toxme.io support) - [x] Name lookups (toxme.io support)
- [x] Save file encryption
- [x] Profile import and export - [x] Profile import and export
- [x] Faux offline messaging
- [x] Faux offline file transfers
- [x] Inline images - [x] Inline images
- [x] Message splitting - [x] Message splitting
- [x] Proxy support - [x] Proxy support
@ -31,13 +37,10 @@ Toxygen is cross-platform [Tox](https://tox.chat/) client written on Python
- [x] Typing notifications - [x] Typing notifications
- [x] Changing nospam - [x] Changing nospam
- [x] File resuming - [x] File resuming
- [x] Save file encryption
- [x] Plugins support
- [x] Read receipts - [x] Read receipts
- [x] Faux offline messaging
- [ ] Video - [ ] Video
- [ ] Group chats
- [ ] Desktop sharing - [ ] Desktop sharing
- [ ] Group chats
###Downloads ###Downloads
[Releases](https://github.com/xveduk/toxygen/releases) [Releases](https://github.com/xveduk/toxygen/releases)

View File

@ -3,14 +3,8 @@
You can compile Toxygen using [PyInstaller](http://www.pyinstaller.org/) You can compile Toxygen using [PyInstaller](http://www.pyinstaller.org/)
Install PyInstaller: Install PyInstaller:
``pip install pyinstaller`` ``pip3 install pyinstaller``
On Linux:
``pyinstaller --windowed main.py``
On Windows:
``pyinstaller --windowed --icon images/icon.ico main.py`` ``pyinstaller --windowed --icon images/icon.ico main.py``
Don't forget to copy /images/, /sounds/, /translations/, /styles/, to /dist/main/ Don't forget to copy /images/, /sounds/, /translations/, /styles/, /smileys/, /stickers/ (and /libs/libtox.dll on Windows) to /dist/main/

View File

@ -1,5 +1,3 @@
#Issues #Issues
Help us find all bugs in Toxygen! Please provide following info: Help us find all bugs in Toxygen! Please provide following info:
@ -15,8 +13,8 @@ Want to see new feature in Toxygen? [Ask for it!](https://github.com/xveduk/toxy
Developer? Feel free to open pull request. Our dev team is small so we glad to get help. Developer? Feel free to open pull request. Our dev team is small so we glad to get help.
Don't know what to do? Improve UI, fix [issues](https://github.com/xveduk/toxygen/issues) or implement features from our TODO list. Don't know what to do? Improve UI, fix [issues](https://github.com/xveduk/toxygen/issues) or implement features from our TODO list.
You can find our TODO's in code and [here](/README.md). Also you can implement plugins for Toxygen. You can find our TODO's in code, issues list and [here](/README.md). Also you can implement [plugins](/docs/plugins.md) for Toxygen.
#Translations #Translations
Help us translate Toxygen! Translate can be created using pyside-lupdate and QT Linguist. Help us translate Toxygen! Translation can be created using pyside-lupdate (``pyside-lupdate toxygen.pro``) and QT Linguist.

View File

@ -7,9 +7,9 @@
### Windows ### Windows
1. [Download and install latest Python 2.7](https://www.python.org/downloads/windows/) 1. [Download and install latest Python 3.4](https://www.python.org/downloads/windows/)
2. [Install PySide](https://pypi.python.org/pypi/PySide/1.2.4) (recommended) or [PyQt4](https://riverbankcomputing.com/software/pyqt/download) 2. [Install PySide](https://pypi.python.org/pypi/PySide/1.2.4) (recommended) or [PyQt4](https://riverbankcomputing.com/software/pyqt/download)
3. Install PyAudio: ``python -m pip install pyaudio`` 3. Install PyAudio: ``pip3 install pyaudio``
4. [Download toxygen](https://github.com/xveduk/toxygen/archive/master.zip) 4. [Download toxygen](https://github.com/xveduk/toxygen/archive/master.zip)
5. Unpack archive 5. Unpack archive
6. Download latest libtox.dll build, download latest libsodium.a build, put it into \src\libs\ 6. Download latest libtox.dll build, download latest libsodium.a build, put it into \src\libs\
@ -28,21 +28,21 @@
Dependencies: Dependencies:
1. Install Python2.7: 1. Install latest Python3.4:
``sudo apt-get install python2.7`` ``sudo apt-get install python3``
2. [Install PySide](https://wiki.qt.io/PySide_Binaries_Linux) (recommended) or [PyQt4](https://riverbankcomputing.com/software/pyqt/download) 2. [Install PySide](https://wiki.qt.io/PySide_Binaries_Linux) (recommended) or [PyQt4](https://riverbankcomputing.com/software/pyqt/download)
3. Install [toxcore](https://github.com/irungentoo/toxcore/blob/master/INSTALL.md) with toxav support in your system (install in /usr/lib/) 3. Install [toxcore](https://github.com/irungentoo/toxcore/blob/master/INSTALL.md) with toxav support in your system (install in /usr/lib/)
4. Install PyAudio: 4. Install PyAudio:
```bash ```bash
sudo apt-get install portaudio19-dev sudo apt-get install portaudio19-dev
sudo pip install pyaudio sudo apt-get install python3-pyaudio
``` ```
Toxygen: Toxygen:
1. [Download toxygen](https://github.com/xveduk/toxygen/archive/master.zip) 1. [Download toxygen](https://github.com/xveduk/toxygen/archive/master.zip)
2. Unpack archive 2. Unpack archive
3. Run app: 3. Run app:
``python main.py`` ``python3 main.py``
## Compile Toxygen ## Compile Toxygen
Check [compile.md](/docs/compile.md) for more info Check [compile.md](/docs/compile.md) for more info

View File

@ -1,6 +1,6 @@
#Plugins API #Plugins API
In Toxygen plugin is single python module (.py file) and directory with data associated with it. In Toxygen plugin is single python (supported Python 3.0 - 3.4) module (.py file) and directory with data associated with it.
Every module must contain one class derived from PluginSuperClass defined in [plugin_super_class.py](/src/plugins/plugin_super_class.py). Instance of this class will be created by PluginLoader class (defined in [plugin_support.py](/src/plugin_support.py) ). This class can enable/disable plugins and send data to it. Every module must contain one class derived from PluginSuperClass defined in [plugin_super_class.py](/src/plugins/plugin_super_class.py). Instance of this class will be created by PluginLoader class (defined in [plugin_support.py](/src/plugin_support.py) ). This class can enable/disable plugins and send data to it.
Every plugin has it's own full name and unique short name (1-5 symbols). Main app can get it using special methods. Every plugin has it's own full name and unique short name (1-5 symbols). Main app can get it using special methods.
@ -37,11 +37,11 @@ Other methods:
About import: About import:
import statement will not work in case you import module that wasn't previously imported by main program and user use precompiled binary. It's recommended to use imp module and dynamic import instead. import statement will not work in case you import module that wasn't previously imported by main program and user use precompiled binary. It's recommended to use dynamic import instead.
About GUI: About GUI:
It's strictly recommended to support both PySide and PyQt4 in GUI. It's strictly recommended to support both PySide and PyQt4 in GUI. Plugin can not have GUI at all.
Exceptions: Exceptions:

View File

@ -1,6 +1,6 @@
#Plugins #Plugins
Toxygen is the first [Tox](https://tox.chat/) client with plugins support. Plugin is Python module (.py file) and directory with plugin's data which provide some additional functionality. Toxygen is the first [Tox](https://tox.chat/) client with plugins support. Plugin is Python 3.4 module (.py file) and directory with plugin's data which provide some additional functionality.
#How to write plugin #How to write plugin
@ -10,9 +10,11 @@ Check [Plugin API](/docs/plugin_api.md) for more info
Toxygen comes without preinstalled plugins. Toxygen comes without preinstalled plugins.
1. Put plugin and directory with it's data into /src/plugins/ 1. Put plugin and directory with its data into /src/plugins/
2. Restart Toxygen 2. Restart Toxygen
##Note: /src/plugins/ should contain plugin_super_class.py and __init__.py
#Plugins list #Plugins list
WARNING: It is unsecure to install plugin not from this list! WARNING: It is unsecure to install plugin not from this list!

View File

@ -1,6 +1,6 @@
#Smileys #Smileys
Toxygen support smileys. Smiley is small picture which replaces some combination of symbols. If you want to create your own smiley pack, create directory in src/smileys/. This directory must contain images with smileys and config.json. Example of config.json: Toxygen support smileys. Smiley is small picture which replaces some symbol or combination of symbols. If you want to create your own smiley pack, create directory in src/smileys/. This directory must contain images with smileys and config.json. Example of config.json:
{":)": "one.png", ":(": "two.png"} {":)": "one.png", ":(": "two.png"}

View File

@ -65,7 +65,7 @@ class IncomingCallWidget(widgets.CenteredWidget):
QtCore.QThread.__init__(self) QtCore.QThread.__init__(self)
def run(self): def run(self):
class AudioFile(object): class AudioFile:
chunk = 1024 chunk = 1024
def __init__(self, fl): def __init__(self, fl):

View File

@ -1,7 +1,7 @@
import random import random
class Node(object): class Node:
def __init__(self, ip, port, tox_key, rand): def __init__(self, ip, port, tox_key, rand):
self._ip, self._port, self._tox_key, self.rand = ip, port, tox_key, rand self._ip, self._port, self._tox_key, self.rand = ip, port, tox_key, rand
@ -75,13 +75,9 @@ def node_generator():
"5625A62618CB4FCA70E147A71B29695F38CC65FF0CBD68AD46254585BE564802", "5625A62618CB4FCA70E147A71B29695F38CC65FF0CBD68AD46254585BE564802",
"31910C0497D347FF160D6F3A6C0E317BAFA71E8E03BC4CBB2A185C9D4FB8B31E" "31910C0497D347FF160D6F3A6C0E317BAFA71E8E03BC4CBB2A185C9D4FB8B31E"
] ]
for i in xrange(len(ips)): for i in range(len(ips)):
nodes.append(Node(ips[i], ports[i], ids[i], random.randint(0, 1000000))) nodes.append(Node(ips[i], ports[i], ids[i], random.randint(0, 1000000)))
arr = sorted(nodes, key=lambda x: x.rand)[:4] arr = sorted(nodes, key=lambda x: x.rand)[:4]
for elem in arr: for elem in arr:
yield elem.get_data() yield elem.get_data()
if __name__ == "__main__":
for elem in node_generator():
print str(elem)

View File

@ -43,7 +43,7 @@ def self_connection_status(tox_link):
Current user changed connection status (offline, UDP, TCP) Current user changed connection status (offline, UDP, TCP)
""" """
def wrapped(tox, connection, user_data): def wrapped(tox, connection, user_data):
print 'Connection status: ', str(connection) print('Connection status: ', str(connection))
profile = Profile.get_instance() profile = Profile.get_instance()
if profile.status is None: if profile.status is None:
status = tox_link.self_get_status() status = tox_link.self_get_status()
@ -62,7 +62,7 @@ def friend_status(tox, friend_num, new_status, user_data):
""" """
Check friend's status (none, busy, away) Check friend's status (none, busy, away)
""" """
print "Friend's #{} status changed! New status: {}".format(friend_num, new_status) print("Friend's #{} status changed! New status: {}".format(friend_num, new_status))
profile = Profile.get_instance() profile = Profile.get_instance()
friend = profile.get_friend_by_number(friend_num) friend = profile.get_friend_by_number(friend_num)
if friend.status is None and Settings.get_instance()['sound_notifications'] and profile.status != TOX_USER_STATUS['BUSY']: if friend.status is None and Settings.get_instance()['sound_notifications'] and profile.status != TOX_USER_STATUS['BUSY']:
@ -76,7 +76,7 @@ def friend_connection_status(tox, friend_num, new_status, user_data):
""" """
Check friend's connection status (offline, udp, tcp) Check friend's connection status (offline, udp, tcp)
""" """
print "Friend #{} connection status: {}".format(friend_num, new_status) print("Friend #{} connection status: {}".format(friend_num, new_status))
profile = Profile.get_instance() profile = Profile.get_instance()
friend = profile.get_friend_by_number(friend_num) friend = profile.get_friend_by_number(friend_num)
if new_status == TOX_CONNECTION['NONE']: if new_status == TOX_CONNECTION['NONE']:
@ -94,7 +94,7 @@ def friend_name(tox, friend_num, name, size, user_data):
Friend changed his name Friend changed his name
""" """
profile = Profile.get_instance() profile = Profile.get_instance()
print 'New name: ', friend_num, name print('New name: ', friend_num, name)
invoke_in_main_thread(profile.new_name, friend_num, name) invoke_in_main_thread(profile.new_name, friend_num, name)
@ -106,7 +106,7 @@ def friend_status_message(tox, friend_num, status_message, size, user_data):
profile = Profile.get_instance() profile = Profile.get_instance()
friend = profile.get_friend_by_number(friend_num) friend = profile.get_friend_by_number(friend_num)
invoke_in_main_thread(friend.set_status_message, status_message) invoke_in_main_thread(friend.set_status_message, status_message)
print 'User #{} has new status: {}'.format(friend_num, status_message) print('User #{} has new status: {}'.format(friend_num, status_message))
invoke_in_main_thread(profile.send_messages, friend_num) invoke_in_main_thread(profile.send_messages, friend_num)
if profile.get_active_number() == friend_num: if profile.get_active_number() == friend_num:
invoke_in_main_thread(profile.set_active) invoke_in_main_thread(profile.set_active)
@ -119,11 +119,12 @@ def friend_message(window, tray):
def wrapped(tox, friend_number, message_type, message, size, user_data): def wrapped(tox, friend_number, message_type, message, size, user_data):
profile = Profile.get_instance() profile = Profile.get_instance()
settings = Settings.get_instance() settings = Settings.get_instance()
message = str(message, 'utf-8')
invoke_in_main_thread(profile.new_message, friend_number, message_type, message) invoke_in_main_thread(profile.new_message, friend_number, message_type, message)
if not window.isActiveWindow(): if not window.isActiveWindow():
friend = profile.get_friend_by_number(friend_number) friend = profile.get_friend_by_number(friend_number)
if settings['notifications'] and profile.status != TOX_USER_STATUS['BUSY']: if settings['notifications'] and profile.status != TOX_USER_STATUS['BUSY']:
invoke_in_main_thread(tray_notification, friend.name, message.decode('utf8'), tray, window) invoke_in_main_thread(tray_notification, friend.name, message, tray, window)
if settings['sound_notifications'] and profile.status != TOX_USER_STATUS['BUSY']: if settings['sound_notifications'] and profile.status != TOX_USER_STATUS['BUSY']:
sound_notification(SOUND_NOTIFICATION['MESSAGE']) sound_notification(SOUND_NOTIFICATION['MESSAGE'])
invoke_in_main_thread(tray.setIcon, QtGui.QIcon(curr_directory() + '/images/icon_new_messages.png')) invoke_in_main_thread(tray.setIcon, QtGui.QIcon(curr_directory() + '/images/icon_new_messages.png'))
@ -134,12 +135,12 @@ def friend_request(tox, public_key, message, message_size, user_data):
""" """
Called when user get new friend request Called when user get new friend request
""" """
print 'Friend request' print('Friend request')
profile = Profile.get_instance() profile = Profile.get_instance()
key = ''.join(chr(x) for x in public_key[:TOX_PUBLIC_KEY_SIZE]) key = ''.join(chr(x) for x in public_key[:TOX_PUBLIC_KEY_SIZE])
tox_id = bin_to_string(key, TOX_PUBLIC_KEY_SIZE) tox_id = bin_to_string(key, TOX_PUBLIC_KEY_SIZE)
if tox_id not in Settings.get_instance()['blocked']: if tox_id not in Settings.get_instance()['blocked']:
invoke_in_main_thread(profile.process_friend_request, tox_id, message.decode('utf-8')) invoke_in_main_thread(profile.process_friend_request, tox_id, str(message, 'utf-8'))
def friend_typing(tox, friend_number, typing, user_data): def friend_typing(tox, friend_number, typing, user_data):
@ -165,11 +166,11 @@ def tox_file_recv(window, tray):
profile = Profile.get_instance() profile = Profile.get_instance()
settings = Settings.get_instance() settings = Settings.get_instance()
if file_type == TOX_FILE_KIND['DATA']: if file_type == TOX_FILE_KIND['DATA']:
print 'file' print('File')
try: try:
file_name = unicode(file_name[:file_name_size].decode('utf-8')) file_name = str(file_name[:file_name_size], 'utf-8')
except: except:
file_name = u'toxygen_file' file_name = 'toxygen_file'
invoke_in_main_thread(profile.incoming_file_transfer, invoke_in_main_thread(profile.incoming_file_transfer,
friend_number, friend_number,
file_number, file_number,
@ -184,7 +185,7 @@ def tox_file_recv(window, tray):
sound_notification(SOUND_NOTIFICATION['FILE_TRANSFER']) sound_notification(SOUND_NOTIFICATION['FILE_TRANSFER'])
invoke_in_main_thread(tray.setIcon, QtGui.QIcon(curr_directory() + '/images/icon_new_messages.png')) invoke_in_main_thread(tray.setIcon, QtGui.QIcon(curr_directory() + '/images/icon_new_messages.png'))
else: # AVATAR else: # AVATAR
print 'Avatar' print ('Avatar')
invoke_in_main_thread(profile.incoming_avatar, invoke_in_main_thread(profile.incoming_avatar,
friend_number, friend_number,
file_number, file_number,
@ -260,7 +261,7 @@ def call_state(toxav, friend_number, mask, user_data):
""" """
New call state New call state
""" """
print friend_number, mask print(friend_number, mask)
if mask == TOXAV_FRIEND_CALL_STATE['FINISHED'] or mask == TOXAV_FRIEND_CALL_STATE['ERROR']: if mask == TOXAV_FRIEND_CALL_STATE['FINISHED'] or mask == TOXAV_FRIEND_CALL_STATE['ERROR']:
invoke_in_main_thread(Profile.get_instance().stop_call, friend_number, True) invoke_in_main_thread(Profile.get_instance().stop_call, friend_number, True)
else: else:
@ -271,7 +272,7 @@ def call(toxav, friend_number, audio, video, user_data):
""" """
Incoming call from friend Incoming call from friend
""" """
print friend_number, audio, video print(friend_number, audio, video)
invoke_in_main_thread(Profile.get_instance().incoming_call, audio, video, friend_number) invoke_in_main_thread(Profile.get_instance().incoming_call, audio, video, friend_number)
@ -279,9 +280,9 @@ def callback_audio(toxav, friend_number, samples, audio_samples_per_channel, aud
""" """
New audio chunk New audio chunk
""" """
# print audio_samples_per_channel, audio_channels_count, rate # print(audio_samples_per_channel, audio_channels_count, rate)
Profile.get_instance().call.chunk( Profile.get_instance().call.chunk(
''.join(chr(x) for x in samples[:audio_samples_per_channel * 2 * audio_channels_count]), bytes(samples[:audio_samples_per_channel * 2 * audio_channels_count]),
audio_channels_count, audio_channels_count,
rate) rate)

View File

@ -13,7 +13,7 @@ CALL_TYPE = {
} }
class AV(object): class AV:
def __init__(self, toxav): def __init__(self, toxav):
self._toxav = toxav self._toxav = toxav
@ -30,7 +30,7 @@ class AV(object):
self._audio_rate = 8000 self._audio_rate = 8000
self._audio_channels = 1 self._audio_channels = 1
self._audio_duration = 60 self._audio_duration = 60
self._audio_sample_count = self._audio_rate * self._audio_channels * self._audio_duration / 1000 self._audio_sample_count = self._audio_rate * self._audio_channels * self._audio_duration // 1000
def __contains__(self, friend_number): def __contains__(self, friend_number):
return friend_number in self._calls return friend_number in self._calls

View File

@ -7,7 +7,7 @@ except ImportError:
from toxcore_enums_and_consts import TOX_PUBLIC_KEY_SIZE from toxcore_enums_and_consts import TOX_PUBLIC_KEY_SIZE
class Contact(object): class Contact:
""" """
Class encapsulating TOX contact Class encapsulating TOX contact
Properties: name (alias of contact or name), status_message, status (connection status) Properties: name (alias of contact or name), status_message, status (connection status)
@ -36,7 +36,7 @@ class Contact(object):
return self._name return self._name
def set_name(self, value): def set_name(self, value):
self._name = value.decode('utf-8') self._name = str(value, 'utf-8')
self._widget.name.setText(self._name) self._widget.name.setText(self._name)
self._widget.name.repaint() self._widget.name.repaint()
@ -50,7 +50,7 @@ class Contact(object):
return self._status_message return self._status_message
def set_status_message(self, value): def set_status_message(self, value):
self._status_message = value.decode('utf-8') self._status_message = str(value, 'utf-8')
self._widget.status_message.setText(self._status_message) self._widget.status_message.setText(self._status_message)
self._widget.status_message.repaint() self._widget.status_message.repaint()

View File

@ -121,7 +121,7 @@ class SendTransfer(FileTransfer):
super(SendTransfer, self).__init__(path, tox, friend_number, size) super(SendTransfer, self).__init__(path, tox, friend_number, size)
self.state = TOX_FILE_TRANSFER_STATE['OUTGOING_NOT_STARTED'] self.state = TOX_FILE_TRANSFER_STATE['OUTGOING_NOT_STARTED']
self._file_number = tox.file_send(friend_number, kind, size, file_id, self._file_number = tox.file_send(friend_number, kind, size, file_id,
basename(path).encode('utf-8') if path else '') bytes(basename(path), 'utf-8') if path else b'')
def send_chunk(self, position, size): def send_chunk(self, position, size):
""" """
@ -167,7 +167,8 @@ class SendFromBuffer(FileTransfer):
super(SendFromBuffer, self).__init__(None, tox, friend_number, len(data)) super(SendFromBuffer, self).__init__(None, tox, friend_number, len(data))
self.state = TOX_FILE_TRANSFER_STATE['OUTGOING_NOT_STARTED'] self.state = TOX_FILE_TRANSFER_STATE['OUTGOING_NOT_STARTED']
self._data = data self._data = data
self._file_number = tox.file_send(friend_number, TOX_FILE_KIND['DATA'], len(data), None, file_name) self._file_number = tox.file_send(friend_number, TOX_FILE_KIND['DATA'],
len(data), None, bytes(file_name, 'utf-8'))
def get_data(self): def get_data(self):
return self._data return self._data
@ -229,7 +230,7 @@ class ReceiveTransfer(FileTransfer):
data = bytearray(data) data = bytearray(data)
if self._file_size < position: if self._file_size < position:
self._file.seek(0, 2) self._file.seek(0, 2)
self._file.write('\0' * (position - self._file_size)) self._file.write(b'\0' * (position - self._file_size))
self._file.seek(position) self._file.seek(position)
self._file.write(data) self._file.write(data)
l = len(data) l = len(data)
@ -246,7 +247,7 @@ class ReceiveToBuffer(FileTransfer):
def __init__(self, tox, friend_number, size, file_number): def __init__(self, tox, friend_number, size, file_number):
super(ReceiveToBuffer, self).__init__(None, tox, friend_number, size, file_number) super(ReceiveToBuffer, self).__init__(None, tox, friend_number, size, file_number)
self._data = '' self._data = bytes()
self._data_size = 0 self._data_size = 0
def get_data(self): def get_data(self):
@ -257,12 +258,11 @@ class ReceiveToBuffer(FileTransfer):
self._creation_time = time() self._creation_time = time()
if data is None: if data is None:
self.state = TOX_FILE_TRANSFER_STATE['FINISHED'] self.state = TOX_FILE_TRANSFER_STATE['FINISHED']
self.signal()
else: else:
data = ''.join(chr(x) for x in data) data = bytes(data)
l = len(data) l = len(data)
if self._data_size < position: if self._data_size < position:
self._data += ('\0' * (position - self._data_size)) self._data += (b'\0' * (position - self._data_size))
self._data = self._data[:position] + data + self._data[position + l:] self._data = self._data[:position] + data + self._data[position + l:]
if position + l > self._data_size: if position + l > self._data_size:
self._data_size = position + l self._data_size = position + l
@ -281,20 +281,23 @@ class ReceiveAvatar(ReceiveTransfer):
super(ReceiveAvatar, self).__init__(path + '.tmp', tox, friend_number, size, file_number) super(ReceiveAvatar, self).__init__(path + '.tmp', tox, friend_number, size, file_number)
if size > self.MAX_AVATAR_SIZE: if size > self.MAX_AVATAR_SIZE:
self.send_control(TOX_FILE_CONTROL['CANCEL']) self.send_control(TOX_FILE_CONTROL['CANCEL'])
self._file.close()
remove(path + '.tmp') remove(path + '.tmp')
elif not size: elif not size:
self.send_control(TOX_FILE_CONTROL['CANCEL']) self.send_control(TOX_FILE_CONTROL['CANCEL'])
self._file.close() self._file.close()
if exists(path): if exists(path):
remove(path) remove(path)
self._file.close()
remove(path + '.tmp') remove(path + '.tmp')
elif exists(path): elif exists(path):
hash = self.get_file_id() hash = self.get_file_id()
with open(path) as fl: with open(path, 'rb') as fl:
data = fl.read() data = fl.read()
existing_hash = Tox.hash(data) existing_hash = Tox.hash(data)
if hash == existing_hash: if hash == existing_hash:
self.send_control(TOX_FILE_CONTROL['CANCEL']) self.send_control(TOX_FILE_CONTROL['CANCEL'])
self._file.close()
remove(path + '.tmp') remove(path + '.tmp')
else: else:
self.send_control(TOX_FILE_CONTROL['RESUME']) self.send_control(TOX_FILE_CONTROL['RESUME'])
@ -309,5 +312,3 @@ class ReceiveAvatar(ReceiveTransfer):
chdir(dirname(avatar_path)) chdir(dirname(avatar_path))
remove(avatar_path) remove(avatar_path)
rename(self._path, avatar_path) rename(self._path, avatar_path)

View File

@ -2,6 +2,7 @@ import contact
from messages import * from messages import *
from history import * from history import *
import util import util
import file_transfers as ft
class Friend(contact.Contact): class Friend(contact.Contact):
@ -55,12 +56,12 @@ class Friend(contact.Contact):
""" """
if (first_time and self._history_loaded) or (not hasattr(self, '_message_getter')): if (first_time and self._history_loaded) or (not hasattr(self, '_message_getter')):
return return
data = self._message_getter.get(PAGE_SIZE) data = list(self._message_getter.get(PAGE_SIZE))
if data is not None and len(data): if data is not None and len(data):
data.reverse() data.reverse()
else: else:
return return
data = map(lambda tupl: TextMessage(*tupl), data) data = list(map(lambda tupl: TextMessage(*tupl), data))
self._corr = data + self._corr self._corr = data + self._corr
self._history_loaded = True self._history_loaded = True
@ -69,10 +70,8 @@ class Friend(contact.Contact):
Get data to save in db Get data to save in db
:return: list of unsaved messages or [] :return: list of unsaved messages or []
""" """
if hasattr(self, '_message_getter'): messages = list(filter(lambda x: x.get_type() <= 1, self._corr))
del self._message_getter return list(map(lambda x: x.get_data(), messages[-self._unsaved_messages:])) if self._unsaved_messages else []
messages = filter(lambda x: x.get_type() <= 1, self._corr)
return map(lambda x: x.get_data(), messages[-self._unsaved_messages:]) if self._unsaved_messages else []
def get_corr(self): def get_corr(self):
return self._corr[:] return self._corr[:]
@ -86,35 +85,56 @@ class Friend(contact.Contact):
self._unsaved_messages += 1 self._unsaved_messages += 1
def get_last_message_text(self): def get_last_message_text(self):
messages = filter(lambda x: x.get_type() <= 1 and x.get_owner() != MESSAGE_OWNER['FRIEND'], self._corr) messages = list(filter(lambda x: x.get_type() <= 1 and x.get_owner() != MESSAGE_OWNER['FRIEND'], self._corr))
if messages: if messages:
return messages[-1].get_data()[0] return messages[-1].get_data()[0]
else: else:
return '' return ''
def unsent_messages(self): def get_unsent_messages(self):
""" """
:return list of unsent messages :return list of unsent messages
""" """
messages = filter(lambda x: x.get_owner() == MESSAGE_OWNER['NOT_SENT'], self._corr) messages = filter(lambda x: x.get_owner() == MESSAGE_OWNER['NOT_SENT'], self._corr)
return messages return list(messages)
def get_unsent_messages_for_saving(self):
"""
:return list of unsent messages for saving
"""
messages = filter(lambda x: x.get_type() <= 1 and x.get_owner() == MESSAGE_OWNER['NOT_SENT'], self._corr)
return list(map(lambda x: x.get_data(), messages))
def delete_message(self, time):
elem = list(filter(lambda x: type(x) is TextMessage and x.get_data()[2] == time, self._corr))[0]
tmp = list(filter(lambda x: x.get_type() <= 1, self._corr))
if elem in tmp[-self._unsaved_messages:]:
self._unsaved_messages -= 1
self._corr.remove(elem)
def mark_as_sent(self): def mark_as_sent(self):
try: try:
message = filter(lambda x: x.get_owner() == MESSAGE_OWNER['NOT_SENT'], self._corr)[0] message = list(filter(lambda x: x.get_owner() == MESSAGE_OWNER['NOT_SENT'], self._corr))[0]
message.mark_as_sent() message.mark_as_sent()
except Exception as ex: except Exception as ex:
util.log('Mark as sent ex: ' + str(ex)) util.log('Mark as sent ex: ' + str(ex))
def clear_corr(self): def clear_corr(self, save_unsent=False):
""" """
Clear messages list Clear messages list
""" """
if hasattr(self, '_message_getter'): if hasattr(self, '_message_getter'):
del self._message_getter del self._message_getter
# don't delete data about active file transfer # don't delete data about active file transfer
self._corr = filter(lambda x: x.get_type() in (2, 3) and x.get_status() >= 2, self._corr) if not save_unsent:
self._corr = list(filter(lambda x: x.get_type() in (2, 3) and
x.get_status() in ft.ACTIVE_FILE_TRANSFERS, self._corr))
self._unsaved_messages = 0 self._unsaved_messages = 0
else:
self._corr = list(filter(lambda x: (x.get_type() in (2, 3) and x.get_status() in ft.ACTIVE_FILE_TRANSFERS)
or (x.get_type() <= 1 and x.get_owner() == MESSAGE_OWNER['NOT_SENT']),
self._corr))
self._unsaved_messages = len(self.get_unsent_messages())
def get_curr_text(self): def get_curr_text(self):
return self._curr_text return self._curr_text
@ -133,8 +153,8 @@ class Friend(contact.Contact):
Update status of active transfer and load inline if needed Update status of active transfer and load inline if needed
""" """
try: try:
tr = filter(lambda x: x.get_type() == MESSAGE_TYPE['FILE_TRANSFER'] and x.is_active(file_number), tr = list(filter(lambda x: x.get_type() == MESSAGE_TYPE['FILE_TRANSFER'] and x.is_active(file_number),
self._corr)[0] self._corr))[0]
tr.set_status(status) tr.set_status(status)
i = self._corr.index(tr) i = self._corr.index(tr)
if inline: # inline was loaded if inline: # inline was loaded
@ -148,10 +168,10 @@ class Friend(contact.Contact):
return messages return messages
def clear_unsent_files(self): def clear_unsent_files(self):
self._corr = filter(lambda x: type(x) is not UnsentFile, self._corr) self._corr = list(filter(lambda x: type(x) is not UnsentFile, self._corr))
def delete_one_unsent_file(self, time): def delete_one_unsent_file(self, time):
self._corr = filter(lambda x: not (type(x) is UnsentFile and x.get_data()[2] == time), self._corr) self._corr = list(filter(lambda x: not (type(x) is UnsentFile and x.get_data()[2] == time), self._corr))
# ----------------------------------------------------------------------------------------------------------------- # -----------------------------------------------------------------------------------------------------------------
# Alias support # Alias support

View File

@ -15,7 +15,7 @@ MESSAGE_OWNER = {
} }
class History(object): class History:
def __init__(self, name): def __init__(self, name):
self._name = name self._name = name
@ -45,7 +45,7 @@ class History(object):
path = settings.ProfileHelper.get_path() + self._name + '.hstr' path = settings.ProfileHelper.get_path() + self._name + '.hstr'
with open(path, 'rb') as fin: with open(path, 'rb') as fin:
data = fin.read() data = fin.read()
data = encr.pass_encrypt(data) data = encr.pass_encrypt(bytes(data))
with open(path, 'wb') as fout: with open(path, 'wb') as fout:
fout.write(data) fout.write(data)
@ -132,6 +132,19 @@ class History(object):
db.close() db.close()
pass pass
def delete_message(self, tox_id, time):
chdir(settings.ProfileHelper.get_path())
db = connect(self._name + '.hstr')
try:
cursor = db.cursor()
cursor.execute('DELETE FROM id' + tox_id + ' WHERE unix_time = ' + str(time) + ';')
db.commit()
except:
db.rollback()
raise
finally:
db.close()
def delete_messages(self, tox_id): def delete_messages(self, tox_id):
chdir(settings.ProfileHelper.get_path()) chdir(settings.ProfileHelper.get_path())
db = connect(self._name + '.hstr') db = connect(self._name + '.hstr')
@ -148,7 +161,7 @@ class History(object):
def messages_getter(self, tox_id): def messages_getter(self, tox_id):
return History.MessageGetter(self._name, tox_id) return History.MessageGetter(self._name, tox_id)
class MessageGetter(object): class MessageGetter:
def __init__(self, name, tox_id): def __init__(self, name, tox_id):
chdir(settings.ProfileHelper.get_path()) chdir(settings.ProfileHelper.get_path())
self._db = connect(name + '.hstr') self._db = connect(name + '.hstr')

View File

@ -1,15 +1,16 @@
from platform import system from platform import system
from ctypes import CDLL from ctypes import CDLL
import util
class LibToxCore(object): class LibToxCore:
def __init__(self): def __init__(self):
if system() == 'Linux': if system() == 'Linux':
# libtoxcore and libsodium must be installed in your os # libtoxcore and libsodium must be installed in your os
self._libtoxcore = CDLL('libtoxcore.so') self._libtoxcore = CDLL('libtoxcore.so')
elif system() == 'Windows': elif system() == 'Windows':
self._libtoxcore = CDLL('libs/libtox.dll') self._libtoxcore = CDLL(util.curr_directory() + '/libs/libtox.dll')
else: else:
raise OSError('Unknown system.') raise OSError('Unknown system.')
@ -17,7 +18,7 @@ class LibToxCore(object):
return self._libtoxcore.__getattr__(item) return self._libtoxcore.__getattr__(item)
class LibToxAV(object): class LibToxAV:
def __init__(self): def __init__(self):
if system() == 'Linux': if system() == 'Linux':
@ -25,7 +26,7 @@ class LibToxAV(object):
self._libtoxav = CDLL('libtoxav.so') self._libtoxav = CDLL('libtoxav.so')
elif system() == 'Windows': elif system() == 'Windows':
# on Windows av api is in libtox.dll # on Windows av api is in libtox.dll
self._libtoxav = CDLL('libs/libtox.dll') self._libtoxav = CDLL(util.curr_directory() + '/libs/libtox.dll')
else: else:
raise OSError('Unknown system.') raise OSError('Unknown system.')
@ -33,7 +34,7 @@ class LibToxAV(object):
return self._libtoxav.__getattr__(item) return self._libtoxav.__getattr__(item)
class LibToxEncryptSave(object): class LibToxEncryptSave:
def __init__(self): def __init__(self):
if system() == 'Linux': if system() == 'Linux':
@ -41,7 +42,7 @@ class LibToxEncryptSave(object):
self._lib_tox_encrypt_save = CDLL('libtoxencryptsave.so') self._lib_tox_encrypt_save = CDLL('libtoxencryptsave.so')
elif system() == 'Windows': elif system() == 'Windows':
# on Windows profile encryption api is in libtox.dll # on Windows profile encryption api is in libtox.dll
self._lib_tox_encrypt_save = CDLL('libs/libtox.dll') self._lib_tox_encrypt_save = CDLL(util.curr_directory() + '/libs/libtox.dll')
else: else:
raise OSError('Unknown system.') raise OSError('Unknown system.')

View File

@ -7,7 +7,7 @@ import profile
from file_transfers import TOX_FILE_TRANSFER_STATE, PAUSED_FILE_TRANSFERS, DO_NOT_SHOW_ACCEPT_BUTTON, ACTIVE_FILE_TRANSFERS, SHOW_PROGRESS_BAR from file_transfers import TOX_FILE_TRANSFER_STATE, PAUSED_FILE_TRANSFERS, DO_NOT_SHOW_ACCEPT_BUTTON, ACTIVE_FILE_TRANSFERS, SHOW_PROGRESS_BAR
from util import curr_directory, convert_time, curr_time from util import curr_directory, convert_time, curr_time
from widgets import DataLabel, create_menu from widgets import DataLabel, create_menu
import cgi import html as h
import smileys import smileys
import settings import settings
@ -70,7 +70,7 @@ class MessageEdit(QtGui.QTextBrowser):
self.setLineWrapColumnOrWidth(self.lineWrapColumnOrWidth()) self.setLineWrapColumnOrWidth(self.lineWrapColumnOrWidth())
def decoratedText(self, text): def decoratedText(self, text):
text = cgi.escape(text) # replace < and > text = h.escape(text) # replace < and >
exp = QtCore.QRegExp( exp = QtCore.QRegExp(
'(' '('
'(?:\\b)((www\\.)|(http[s]?|ftp)://)' '(?:\\b)((www\\.)|(http[s]?|ftp)://)'
@ -121,14 +121,15 @@ class MessageItem(QtGui.QWidget):
font.setPointSize(10) font.setPointSize(10)
font.setBold(False) font.setBold(False)
self.time.setFont(font) self.time.setFont(font)
self._time = time
if not sent: if not sent:
movie = QtGui.QMovie(curr_directory() + '/images/spinner.gif') movie = QtGui.QMovie(curr_directory() + '/images/spinner.gif')
self.time.setMovie(movie) self.time.setMovie(movie)
movie.start() movie.start()
self.t = time self.t = True
else: else:
self.time.setText(time) self.time.setText(convert_time(time))
self.t = False
self.message = MessageEdit(text, parent.width() - 150, message_type, self) self.message = MessageEdit(text, parent.width() - 150, message_type, self)
if message_type != TOX_MESSAGE_TYPE['NORMAL']: if message_type != TOX_MESSAGE_TYPE['NORMAL']:
@ -138,10 +139,23 @@ class MessageItem(QtGui.QWidget):
self.message.setGeometry(QtCore.QRect(100, 0, parent.width() - 150, self.message.height())) self.message.setGeometry(QtCore.QRect(100, 0, parent.width() - 150, self.message.height()))
self.setFixedHeight(self.message.height()) self.setFixedHeight(self.message.height())
def mouseReleaseEvent(self, event):
if event.button() == QtCore.Qt.RightButton and event.x() > self.time.x():
self.listMenu = QtGui.QMenu()
delete_item = self.listMenu.addAction(QtGui.QApplication.translate("MainWindow", 'Delete message', None, QtGui.QApplication.UnicodeUTF8))
self.connect(delete_item, QtCore.SIGNAL("triggered()"), self.delete)
parent_position = self.time.mapToGlobal(QtCore.QPoint(0, 0))
self.listMenu.move(parent_position)
self.listMenu.show()
def delete(self):
pr = profile.Profile.get_instance()
pr.delete_message(self._time)
def mark_as_sent(self): def mark_as_sent(self):
if hasattr(self, 't'): if self.t:
self.time.setText(self.t) self.time.setText(convert_time(self._time))
del self.t self.t = False
return True return True
return False return False
@ -303,14 +317,14 @@ class FileTransferItem(QtGui.QListWidget):
self.file_name.setGeometry(QtCore.QRect(210, 7, width - 420, 20)) self.file_name.setGeometry(QtCore.QRect(210, 7, width - 420, 20))
font.setPointSize(12) font.setPointSize(12)
self.file_name.setFont(font) self.file_name.setFont(font)
file_size = size / 1024 file_size = size // 1024
if not file_size: if not file_size:
file_size = '{}B'.format(size) file_size = '{}B'.format(size)
elif file_size >= 1024: elif file_size >= 1024:
file_size = '{}MB'.format(file_size / 1024) file_size = '{}MB'.format(file_size // 1024)
else: else:
file_size = '{}KB'.format(file_size) file_size = '{}KB'.format(file_size)
file_data = u'{} {}'.format(file_size, file_name) file_data = '{} {}'.format(file_size, file_name)
self.file_name.setText(file_data) self.file_name.setText(file_data)
self.file_name.setToolTip(file_name) self.file_name.setToolTip(file_name)
self.saved_name = file_name self.saved_name = file_name
@ -435,7 +449,7 @@ class InlineImageItem(QtGui.QScrollArea):
self.setWidget(self._image_label) self.setWidget(self._image_label)
self._image_label.setScaledContents(False) self._image_label.setScaledContents(False)
self._pixmap = QtGui.QPixmap() self._pixmap = QtGui.QPixmap()
self._pixmap.loadFromData(QtCore.QByteArray(data), "PNG") self._pixmap.loadFromData(data, 'PNG')
self._max_size = width - 30 self._max_size = width - 30
self._resize_needed = not (self._pixmap.width() <= self._max_size) self._resize_needed = not (self._pixmap.width() <= self._max_size)
self._full_size = not self._resize_needed self._full_size = not self._resize_needed

View File

@ -83,7 +83,7 @@ class LoginScreen(CenteredWidget):
def create_profile(self): def create_profile(self):
self.type = 1 self.type = 1
self.name = self.new_name.toPlainText() self.name = self.new_name.text()
self.close() self.close()
def load_ex_profile(self): def load_ex_profile(self):

View File

@ -11,14 +11,13 @@ from profile import tox_factory
from callbacks import init_callbacks from callbacks import init_callbacks
from util import curr_directory from util import curr_directory
import styles.style import styles.style
import locale
import toxencryptsave import toxencryptsave
from passwordscreen import PasswordScreen from passwordscreen import PasswordScreen
import profile import profile
from plugin_support import PluginLoader from plugin_support import PluginLoader
class Toxygen(object): class Toxygen:
def __init__(self, path_or_uri=None): def __init__(self, path_or_uri=None):
super(Toxygen, self).__init__() super(Toxygen, self).__init__()
@ -62,8 +61,8 @@ class Toxygen(object):
encrypt_save = toxencryptsave.LibToxEncryptSave() encrypt_save = toxencryptsave.LibToxEncryptSave()
if self.path is not None: if self.path is not None:
path = os.path.dirname(self.path.encode(locale.getpreferredencoding())) + '/' path = os.path.dirname(self.path) + '/'
name = os.path.basename(self.path.encode(locale.getpreferredencoding()))[:-4] name = os.path.basename(self.path)[:-4]
data = ProfileHelper(path, name).open_profile() data = ProfileHelper(path, name).open_profile()
if encrypt_save.is_data_encrypted(data): if encrypt_save.is_data_encrypted(data):
data = self.enter_pass(data) data = self.enter_pass(data)
@ -94,10 +93,11 @@ class Toxygen(object):
if not _login.t: if not _login.t:
return return
elif _login.t == 1: # create new profile elif _login.t == 1: # create new profile
_login.name = _login.name.strip()
name = _login.name if _login.name else 'toxygen_user' name = _login.name if _login.name else 'toxygen_user'
self.tox = tox_factory() self.tox = tox_factory()
self.tox.self_set_name(_login.name if _login.name else 'Toxygen User') self.tox.self_set_name(bytes(_login.name, 'utf-8') if _login.name else b'Toxygen User')
self.tox.self_set_status_message('Toxing on Toxygen') self.tox.self_set_status_message(b'Toxing on Toxygen')
ProfileHelper(Settings.get_default_path(), name).save_profile(self.tox.get_savedata()) ProfileHelper(Settings.get_default_path(), name).save_profile(self.tox.get_savedata())
path = Settings.get_default_path() path = Settings.get_default_path()
settings = Settings(name) settings = Settings(name)
@ -112,7 +112,6 @@ class Toxygen(object):
self.tox = tox_factory(data, settings) self.tox = tox_factory(data, settings)
else: else:
path, name = auto_profile path, name = auto_profile
path = path.encode(locale.getpreferredencoding())
data = ProfileHelper(path, name).open_profile() data = ProfileHelper(path, name).open_profile()
if encrypt_save.is_data_encrypted(data): if encrypt_save.is_data_encrypted(data):
data = self.enter_pass(data) data = self.enter_pass(data)
@ -283,7 +282,7 @@ class Toxygen(object):
self.tox.bootstrap(*data) self.tox.bootstrap(*data)
except: except:
pass pass
for _ in xrange(10): for _ in range(10):
if self.stop: if self.stop:
return return
self.msleep(1000) self.msleep(1000)
@ -322,7 +321,7 @@ class Toxygen(object):
self.toxav.iterate() self.toxav.iterate()
self.msleep(self.toxav.iteration_interval()) self.msleep(self.toxav.iteration_interval())
class Login(object): class Login:
def __init__(self, arr): def __init__(self, arr):
self.arr = arr self.arr = arr

View File

@ -499,7 +499,7 @@ class MainWindow(QtGui.QMainWindow):
s = Settings.get_instance() s = Settings.get_instance()
note = s['notes'][friend.tox_id] if friend.tox_id in s['notes'] else '' note = s['notes'][friend.tox_id] if friend.tox_id in s['notes'] else ''
user = QtGui.QApplication.translate("MainWindow", 'Notes about user', None, QtGui.QApplication.UnicodeUTF8) user = QtGui.QApplication.translate("MainWindow", 'Notes about user', None, QtGui.QApplication.UnicodeUTF8)
user = u'{} {}'.format(user, friend.name) user = '{} {}'.format(user, friend.name)
def save_note(text): def save_note(text):
if friend.tox_id in s['notes']: if friend.tox_id in s['notes']:

View File

@ -99,7 +99,6 @@ class ScreenShotWindow(QtGui.QWidget):
if self.rubberband.isVisible(): if self.rubberband.isVisible():
self.rubberband.hide() self.rubberband.hide()
rect = self.rubberband.geometry() rect = self.rubberband.geometry()
print rect
if rect.width() and rect.height(): if rect.width() and rect.height():
p = QtGui.QPixmap.grabWindow(QtGui.QApplication.desktop().winId(), p = QtGui.QPixmap.grabWindow(QtGui.QApplication.desktop().winId(),
rect.x() + 4, rect.x() + 4,
@ -110,7 +109,7 @@ class ScreenShotWindow(QtGui.QWidget):
buffer = QtCore.QBuffer(byte_array) buffer = QtCore.QBuffer(byte_array)
buffer.open(QtCore.QIODevice.WriteOnly) buffer.open(QtCore.QIODevice.WriteOnly)
p.save(buffer, 'PNG') p.save(buffer, 'PNG')
Profile.get_instance().send_screenshot(str(byte_array.data())) Profile.get_instance().send_screenshot(bytes(byte_array.data()))
self.close() self.close()
def keyPressEvent(self, event): def keyPressEvent(self, event):
@ -132,12 +131,14 @@ class SmileyWindow(QtGui.QWidget):
inst = smileys.SmileyLoader.get_instance() inst = smileys.SmileyLoader.get_instance()
self.data = inst.get_smileys() self.data = inst.get_smileys()
count = len(self.data) count = len(self.data)
if not count:
self.close()
self.page_size = int(pow(count / 8, 0.5) + 1) * 8 # smileys per page self.page_size = int(pow(count / 8, 0.5) + 1) * 8 # smileys per page
if count % self.page_size == 0: if count % self.page_size == 0:
self.page_count = count / self.page_size self.page_count = count // self.page_size
else: else:
self.page_count = int(count / float(self.page_size) + 0.5) self.page_count = round(count / self.page_size + 0.5)
self.page = 0 self.page = -1
self.radio = [] self.radio = []
self.parent = parent self.parent = parent
for i in range(self.page_count): # buttons with smileys for i in range(self.page_count): # buttons with smileys
@ -145,13 +146,13 @@ class SmileyWindow(QtGui.QWidget):
elem.setGeometry(QtCore.QRect(i * 20 + 5, 180, 20, 20)) elem.setGeometry(QtCore.QRect(i * 20 + 5, 180, 20, 20))
elem.clicked.connect(lambda i=i: self.checked(i)) elem.clicked.connect(lambda i=i: self.checked(i))
self.radio.append(elem) self.radio.append(elem)
width = max(self.page_count * 20 + 30, (self.page_size + 5) * 8 / 10) width = max(self.page_count * 20 + 30, (self.page_size + 5) * 8 // 10)
self.setMaximumSize(width, 200) self.setMaximumSize(width, 200)
self.setMinimumSize(width, 200) self.setMinimumSize(width, 200)
self.buttons = [] self.buttons = []
for i in range(self.page_size): # pages - radio buttons for i in range(self.page_size): # pages - radio buttons
b = QtGui.QPushButton(self) b = QtGui.QPushButton(self)
b.setGeometry(QtCore.QRect((i / 8) * 20 + 5, (i % 8) * 20, 20, 20)) b.setGeometry(QtCore.QRect((i // 8) * 20 + 5, (i % 8) * 20, 20, 20))
b.clicked.connect(lambda i=i: self.clicked(i)) b.clicked.connect(lambda i=i: self.clicked(i))
self.buttons.append(b) self.buttons.append(b)
self.checked(0) self.checked(0)

View File

@ -258,7 +258,7 @@ class ProfileSettings(CenteredWidget):
def closeEvent(self, event): def closeEvent(self, event):
profile = Profile.get_instance() profile = Profile.get_instance()
profile.set_name(self.nick.text().encode('utf-8')) profile.set_name(self.nick.text())
profile.set_status_message(self.status_message.text().encode('utf-8')) profile.set_status_message(self.status_message.text().encode('utf-8'))
profile.set_status(self.status.currentIndex()) profile.set_status(self.status.currentIndex())
@ -306,7 +306,7 @@ class NetworkSettings(CenteredWidget):
self.udp.setChecked(settings['udp_enabled']) self.udp.setChecked(settings['udp_enabled'])
self.proxy.setChecked(settings['proxy_type']) self.proxy.setChecked(settings['proxy_type'])
self.proxyip.setText(settings['proxy_host']) self.proxyip.setText(settings['proxy_host'])
self.proxyport.setText(unicode(settings['proxy_port'])) self.proxyport.setText(str(settings['proxy_port']))
self.http.setChecked(settings['proxy_type'] == 1) self.http.setChecked(settings['proxy_type'] == 1)
self.warning = QtGui.QLabel(self) self.warning = QtGui.QLabel(self)
self.warning.setGeometry(QtCore.QRect(5, 270, 290, 60)) self.warning.setGeometry(QtCore.QRect(5, 270, 290, 60))
@ -360,45 +360,51 @@ class PrivacySettings(CenteredWidget):
def initUI(self): def initUI(self):
self.setObjectName("privacySettings") self.setObjectName("privacySettings")
self.resize(350, 550) self.resize(370, 600)
self.setMinimumSize(QtCore.QSize(350, 550)) self.setMinimumSize(QtCore.QSize(370, 600))
self.setMaximumSize(QtCore.QSize(350, 550)) self.setMaximumSize(QtCore.QSize(370, 600))
self.saveHistory = QtGui.QCheckBox(self) self.saveHistory = QtGui.QCheckBox(self)
self.saveHistory.setGeometry(QtCore.QRect(10, 20, 291, 22)) self.saveHistory.setGeometry(QtCore.QRect(10, 20, 350, 22))
self.saveUnsentOnly = QtGui.QCheckBox(self)
self.saveUnsentOnly.setGeometry(QtCore.QRect(10, 60, 350, 22))
self.fileautoaccept = QtGui.QCheckBox(self) self.fileautoaccept = QtGui.QCheckBox(self)
self.fileautoaccept.setGeometry(QtCore.QRect(10, 60, 271, 22)) self.fileautoaccept.setGeometry(QtCore.QRect(10, 100, 350, 22))
self.typingNotifications = QtGui.QCheckBox(self) self.typingNotifications = QtGui.QCheckBox(self)
self.typingNotifications.setGeometry(QtCore.QRect(10, 100, 350, 30)) self.typingNotifications.setGeometry(QtCore.QRect(10, 140, 350, 30))
self.inlines = QtGui.QCheckBox(self) self.inlines = QtGui.QCheckBox(self)
self.inlines.setGeometry(QtCore.QRect(10, 140, 350, 30)) self.inlines.setGeometry(QtCore.QRect(10, 180, 350, 30))
self.auto_path = QtGui.QLabel(self) self.auto_path = QtGui.QLabel(self)
self.auto_path.setGeometry(QtCore.QRect(10, 190, 350, 30)) self.auto_path.setGeometry(QtCore.QRect(10, 230, 350, 30))
self.path = QtGui.QPlainTextEdit(self) self.path = QtGui.QPlainTextEdit(self)
self.path.setGeometry(QtCore.QRect(10, 225, 330, 45)) self.path.setGeometry(QtCore.QRect(10, 265, 330, 45))
self.change_path = QtGui.QPushButton(self) self.change_path = QtGui.QPushButton(self)
self.change_path.setGeometry(QtCore.QRect(10, 280, 330, 30)) self.change_path.setGeometry(QtCore.QRect(10, 320, 350, 30))
settings = Settings.get_instance() settings = Settings.get_instance()
self.typingNotifications.setChecked(settings['typing_notifications']) self.typingNotifications.setChecked(settings['typing_notifications'])
self.fileautoaccept.setChecked(settings['allow_auto_accept']) self.fileautoaccept.setChecked(settings['allow_auto_accept'])
self.saveHistory.setChecked(settings['save_history']) self.saveHistory.setChecked(settings['save_history'])
self.inlines.setChecked(settings['allow_inline']) self.inlines.setChecked(settings['allow_inline'])
self.saveUnsentOnly.setChecked(settings['save_unsent_only'])
self.saveUnsentOnly.setEnabled(settings['save_history'])
self.saveHistory.stateChanged.connect(self.update)
self.path.setPlainText(settings['auto_accept_path'] or curr_directory()) self.path.setPlainText(settings['auto_accept_path'] or curr_directory())
self.change_path.clicked.connect(self.new_path) self.change_path.clicked.connect(self.new_path)
self.block_user_label = QtGui.QLabel(self) self.block_user_label = QtGui.QLabel(self)
self.block_user_label.setGeometry(QtCore.QRect(10, 320, 330, 30)) self.block_user_label.setGeometry(QtCore.QRect(10, 360, 350, 30))
self.block_id = QtGui.QPlainTextEdit(self) self.block_id = QtGui.QPlainTextEdit(self)
self.block_id.setGeometry(QtCore.QRect(10, 350, 330, 30)) self.block_id.setGeometry(QtCore.QRect(10, 390, 350, 30))
self.block = QtGui.QPushButton(self) self.block = QtGui.QPushButton(self)
self.block.setGeometry(QtCore.QRect(10, 390, 330, 30)) self.block.setGeometry(QtCore.QRect(10, 430, 350, 30))
self.block.clicked.connect(lambda: Profile.get_instance().block_user(self.block_id.toPlainText()) or self.close()) self.block.clicked.connect(lambda: Profile.get_instance().block_user(self.block_id.toPlainText()) or self.close())
self.blocked_users_label = QtGui.QLabel(self) self.blocked_users_label = QtGui.QLabel(self)
self.blocked_users_label.setGeometry(QtCore.QRect(10, 430, 330, 30)) self.blocked_users_label.setGeometry(QtCore.QRect(10, 470, 350, 30))
self.comboBox = QtGui.QComboBox(self) self.comboBox = QtGui.QComboBox(self)
self.comboBox.setGeometry(QtCore.QRect(10, 460, 330, 30)) self.comboBox.setGeometry(QtCore.QRect(10, 500, 350, 30))
self.comboBox.addItems(settings['blocked']) self.comboBox.addItems(settings['blocked'])
self.unblock = QtGui.QPushButton(self) self.unblock = QtGui.QPushButton(self)
self.unblock.setGeometry(QtCore.QRect(10, 500, 330, 30)) self.unblock.setGeometry(QtCore.QRect(10, 540, 350, 30))
self.unblock.clicked.connect(lambda: self.unblock_user()) self.unblock.clicked.connect(lambda: self.unblock_user())
self.retranslateUi() self.retranslateUi()
QtCore.QMetaObject.connectSlotsByName(self) QtCore.QMetaObject.connectSlotsByName(self)
@ -415,6 +421,12 @@ class PrivacySettings(CenteredWidget):
self.blocked_users_label.setText(QtGui.QApplication.translate("privacySettings", "Blocked users:", None, QtGui.QApplication.UnicodeUTF8)) self.blocked_users_label.setText(QtGui.QApplication.translate("privacySettings", "Blocked users:", None, QtGui.QApplication.UnicodeUTF8))
self.unblock.setText(QtGui.QApplication.translate("privacySettings", "Unblock", None, QtGui.QApplication.UnicodeUTF8)) self.unblock.setText(QtGui.QApplication.translate("privacySettings", "Unblock", None, QtGui.QApplication.UnicodeUTF8))
self.block.setText(QtGui.QApplication.translate("privacySettings", "Block user", None, QtGui.QApplication.UnicodeUTF8)) self.block.setText(QtGui.QApplication.translate("privacySettings", "Block user", None, QtGui.QApplication.UnicodeUTF8))
self.saveUnsentOnly.setText(QtGui.QApplication.translate("privacySettings", "Save unsent messages only", None, QtGui.QApplication.UnicodeUTF8))
def update(self, new_state):
self.saveUnsentOnly.setEnabled(new_state)
if not new_state:
self.saveUnsentOnly.setChecked(False)
def unblock_user(self): def unblock_user(self):
if not self.comboBox.count(): if not self.comboBox.count():
@ -429,6 +441,7 @@ class PrivacySettings(CenteredWidget):
settings = Settings.get_instance() settings = Settings.get_instance()
settings['typing_notifications'] = self.typingNotifications.isChecked() settings['typing_notifications'] = self.typingNotifications.isChecked()
settings['allow_auto_accept'] = self.fileautoaccept.isChecked() settings['allow_auto_accept'] = self.fileautoaccept.isChecked()
if settings['save_history'] and not self.saveHistory.isChecked(): # clear history if settings['save_history'] and not self.saveHistory.isChecked(): # clear history
reply = QtGui.QMessageBox.question(None, reply = QtGui.QMessageBox.question(None,
QtGui.QApplication.translate("privacySettings", QtGui.QApplication.translate("privacySettings",
@ -444,6 +457,21 @@ class PrivacySettings(CenteredWidget):
settings['save_history'] = self.saveHistory.isChecked() settings['save_history'] = self.saveHistory.isChecked()
else: else:
settings['save_history'] = self.saveHistory.isChecked() settings['save_history'] = self.saveHistory.isChecked()
if self.saveUnsentOnly.isChecked() and not settings['save_unsent_only']:
reply = QtGui.QMessageBox.question(None,
QtGui.QApplication.translate("privacySettings",
'Chat history',
None, QtGui.QApplication.UnicodeUTF8),
QtGui.QApplication.translate("privacySettings",
'History will be cleaned! Continue?',
None, QtGui.QApplication.UnicodeUTF8),
QtGui.QMessageBox.Yes,
QtGui.QMessageBox.No)
if reply == QtGui.QMessageBox.Yes:
Profile.get_instance().clear_history(None, True)
settings['save_unsent_only'] = self.saveUnsentOnly.isChecked()
else:
settings['save_unsent_only'] = self.saveUnsentOnly.isChecked()
settings['auto_accept_path'] = self.path.toPlainText() settings['auto_accept_path'] = self.path.toPlainText()
settings['allow_inline'] = self.inlines.isChecked() settings['allow_inline'] = self.inlines.isChecked()
settings.save() settings.save()
@ -650,13 +678,13 @@ class AudioSettings(CenteredWidget):
p = pyaudio.PyAudio() p = pyaudio.PyAudio()
settings = Settings.get_instance() settings = Settings.get_instance()
self.in_indexes, self.out_indexes = [], [] self.in_indexes, self.out_indexes = [], []
for i in xrange(p.get_device_count()): for i in range(p.get_device_count()):
device = p.get_device_info_by_index(i) device = p.get_device_info_by_index(i)
if device["maxInputChannels"]: if device["maxInputChannels"]:
self.input.addItem(unicode(device["name"])) self.input.addItem(str(device["name"]))
self.in_indexes.append(i) self.in_indexes.append(i)
if device["maxOutputChannels"]: if device["maxOutputChannels"]:
self.output.addItem(unicode(device["name"])) self.output.addItem(str(device["name"]))
self.out_indexes.append(i) self.out_indexes.append(i)
self.input.setCurrentIndex(self.in_indexes.index(settings.audio['input'])) self.input.setCurrentIndex(self.in_indexes.index(settings.audio['input']))
self.output.setCurrentIndex(self.out_indexes.index(settings.audio['output'])) self.output.setCurrentIndex(self.out_indexes.index(settings.audio['output']))
@ -728,7 +756,7 @@ class PluginsSettings(CenteredWidget):
def update_list(self): def update_list(self):
self.comboBox.clear() self.comboBox.clear()
data = self.pl_loader.get_plugins_list() data = self.pl_loader.get_plugins_list()
self.comboBox.addItems(map(lambda x: x[0], data)) self.comboBox.addItems(list(map(lambda x: x[0], data)))
self.data = data self.data = data
def show_data(self): def show_data(self):

View File

@ -9,7 +9,7 @@ MESSAGE_TYPE = {
} }
class Message(object): class Message:
def __init__(self, message_type, owner, time): def __init__(self, message_type, owner, time):
self._time = time self._time = time

View File

@ -35,7 +35,7 @@ def tray_notification(title, text, tray, window):
tray.connect(tray, QtCore.SIGNAL("messageClicked()"), message_clicked) tray.connect(tray, QtCore.SIGNAL("messageClicked()"), message_clicked)
class AudioFile(object): class AudioFile:
chunk = 1024 chunk = 1024
def __init__(self, fl): def __init__(self, fl):

View File

@ -57,8 +57,9 @@ class PasswordScreen(CenteredWidget):
try: try:
self._encrypt.set_password(self.password.text()) self._encrypt.set_password(self.password.text())
new_data = self._encrypt.pass_decrypt(self._data[0]) new_data = self._encrypt.pass_decrypt(self._data[0])
except Exception: except Exception as ex:
self.warning.setVisible(True) self.warning.setVisible(True)
print('Decryption error:', ex)
else: else:
self._data[0] = new_data self._data[0] = new_data
self.close() self.close()

View File

@ -1,15 +1,17 @@
import util import util
import profile import profile
import os import os
import imp import importlib
import inspect import inspect
import plugins.plugin_super_class as pl import plugins.plugin_super_class as pl
import toxencryptsave import toxencryptsave
import sys
class PluginLoader(util.Singleton): class PluginLoader(util.Singleton):
def __init__(self, tox, settings): def __init__(self, tox, settings):
super().__init__()
self._profile = profile.Profile.get_instance() self._profile = profile.Profile.get_instance()
self._settings = settings self._settings = settings
self._plugins = {} # dict. key - plugin unique short name, value - tuple (plugin instance, is active) self._plugins = {} # dict. key - plugin unique short name, value - tuple (plugin instance, is active)
@ -32,13 +34,15 @@ class PluginLoader(util.Singleton):
if not os.path.exists(path): if not os.path.exists(path):
util.log('Plugin dir not found') util.log('Plugin dir not found')
return return
else:
sys.path.append(path)
files = [f for f in os.listdir(path) if os.path.isfile(os.path.join(path, f))] files = [f for f in os.listdir(path) if os.path.isfile(os.path.join(path, f))]
for fl in files: for fl in files:
if fl in ('plugin_super_class.py', '__init__.py') or not fl.endswith('.py'): if fl in ('plugin_super_class.py', '__init__.py') or not fl.endswith('.py'):
continue continue
name = fl[:-3] # module name without .py name = fl[:-3] # module name without .py
try: try:
module = imp.load_source('plugins.' + name, path + fl) # import plugin module = importlib.import_module(name) # import plugin
except ImportError: except ImportError:
util.log('Import error in module ' + name) util.log('Import error in module ' + name)
continue continue
@ -47,8 +51,8 @@ class PluginLoader(util.Singleton):
continue continue
for elem in dir(module): for elem in dir(module):
obj = getattr(module, elem) obj = getattr(module, elem)
if inspect.isclass(obj) and issubclass(obj, pl.PluginSuperClass): # looking for plugin class in module if inspect.isclass(obj) and hasattr(obj, 'is_plugin') and obj.is_plugin: # looking for plugin class in module
print 'Plugin', elem print('Plugin', elem)
try: # create instance of plugin class try: # create instance of plugin class
inst = obj(self._tox, self._profile, self._settings, self._encr) inst = obj(self._tox, self._profile, self._settings, self._encr)
autostart = inst.get_short_name() in self._settings['plugins'] autostart = inst.get_short_name() in self._settings['plugins']
@ -147,6 +151,6 @@ class PluginLoader(util.Singleton):
""" """
App is closing, stop all plugins App is closing, stop all plugins
""" """
for key in self._plugins.keys(): for key in list(self._plugins.keys()):
self._plugins[key][0].close() self._plugins[key][0].close()
del self._plugins[key] del self._plugins[key]

View File

@ -26,13 +26,14 @@ def log(name, data):
:param data: data for saving in log :param data: data for saving in log
""" """
with open(path_to_data(name) + 'logs.txt', 'a') as fl: with open(path_to_data(name) + 'logs.txt', 'a') as fl:
fl.write(str(data) + '\n') fl.write(bytes(data, 'utf-8') + b'\n')
class PluginSuperClass(object): class PluginSuperClass:
""" """
Superclass for all plugins. Plugin is python module with at least one class derived from PluginSuperClass. Superclass for all plugins. Plugin is python module with at least one class derived from PluginSuperClass.
""" """
is_plugin = True
def __init__(self, name, short_name, tox=None, profile=None, settings=None, encrypt_save=None): def __init__(self, name, short_name, tox=None, profile=None, settings=None, encrypt_save=None):
""" """
@ -159,9 +160,9 @@ class PluginSuperClass(object):
""" """
This method loads settings of plugin and returns raw data This method loads settings of plugin and returns raw data
""" """
with open(path_to_data(self._short_name) + 'settings.json') as fl: with open(path_to_data(self._short_name) + 'settings.json', 'rb') as fl:
data = fl.read() data = fl.read()
return data return str(data, 'utf-8')
def save_settings(self, data): def save_settings(self, data):
""" """
@ -169,7 +170,7 @@ class PluginSuperClass(object):
:param data: string with data :param data: string with data
""" """
with open(path_to_data(self._short_name) + 'settings.json', 'wb') as fl: with open(path_to_data(self._short_name) + 'settings.json', 'wb') as fl:
fl.write(data) fl.write(bytes(data, 'utf-8'))
# ----------------------------------------------------------------------------------------------------------------- # -----------------------------------------------------------------------------------------------------------------
# Callbacks # Callbacks
@ -212,8 +213,10 @@ class PluginSuperClass(object):
data = '' data = ''
try: try:
return self._tox.friend_send_lossless_packet(friend_number, return self._tox.friend_send_lossless_packet(friend_number,
bytes([ord(x) for x in
chr(len(self._short_name) + LOSSLESS_FIRST_BYTE) + chr(len(self._short_name) + LOSSLESS_FIRST_BYTE) +
self._short_name + str(data)) self._short_name + str(data)
]))
except: except:
return False return False
@ -228,7 +231,9 @@ class PluginSuperClass(object):
data = '' data = ''
try: try:
return self._tox.friend_send_lossy_packet(friend_number, return self._tox.friend_send_lossy_packet(friend_number,
bytes([ord(x) for x in
chr(len(self._short_name) + LOSSY_FIRST_BYTE) + chr(len(self._short_name) + LOSSY_FIRST_BYTE) +
self._short_name + str(data)) self._short_name + str(data)
]))
except: except:
return False return False

View File

@ -7,7 +7,7 @@ from friend import *
from settings import * from settings import *
from toxcore_enums_and_consts import * from toxcore_enums_and_consts import *
from ctypes import * from ctypes import *
from util import curr_time, log, Singleton, curr_directory, convert_time from util import log, Singleton, curr_directory
from tox_dns import tox_dns from tox_dns import tox_dns
from history import * from history import *
from file_transfers import * from file_transfers import *
@ -26,10 +26,12 @@ class Profile(contact.Contact, Singleton):
:param tox: tox instance :param tox: tox instance
:param screen: ref to main screen :param screen: ref to main screen
""" """
super(Profile, self).__init__(tox.self_get_name(), contact.Contact.__init__(self,
tox.self_get_name(),
tox.self_get_status_message(), tox.self_get_status_message(),
screen.user_info, screen.user_info,
tox.self_get_address()) tox.self_get_address())
Singleton.__init__(self)
self._screen = screen self._screen = screen
self._messages = screen.messages self._messages = screen.messages
self._tox = tox self._tox = tox
@ -45,10 +47,8 @@ class Profile(contact.Contact, Singleton):
self._friends, self._active_friend = [], -1 self._friends, self._active_friend = [], -1
for i in data: # creates list of friends for i in data: # creates list of friends
tox_id = tox.friend_get_public_key(i) tox_id = tox.friend_get_public_key(i)
if not self._history.friend_exists_in_db(tox_id):
self._history.add_friend_to_db(tox_id)
try: try:
alias = filter(lambda x: x[0] == tox_id, aliases)[0][1] alias = list(filter(lambda x: x[0] == tox_id, aliases))[0][1]
except: except:
alias = '' alias = ''
item = self.create_friend_item() item = self.create_friend_item()
@ -77,17 +77,18 @@ class Profile(contact.Contact, Singleton):
self._tox.self_set_status(status) self._tox.self_set_status(status)
def set_name(self, value): def set_name(self, value):
if self.name == value:
return
tmp = self.name tmp = self.name
super(Profile, self).set_name(value) 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'))
if tmp != value:
message = QtGui.QApplication.translate("MainWindow", 'User {} is now known as {}', None, message = QtGui.QApplication.translate("MainWindow", 'User {} is now known as {}', None,
QtGui.QApplication.UnicodeUTF8) QtGui.QApplication.UnicodeUTF8)
message = message.format(tmp, value) message = message.format(tmp, value)
for friend in self._friends: for friend in self._friends:
friend.append_message(InfoMessage(message, time.time())) friend.append_message(InfoMessage(message, time.time()))
if self._active_friend + 1: if self._active_friend + 1:
self.create_message_item(message, curr_time(), '', MESSAGE_TYPE['INFO_MESSAGE']) self.create_message_item(message, time.time(), '', MESSAGE_TYPE['INFO_MESSAGE'])
self._messages.scrollToBottom() self._messages.scrollToBottom()
def set_status_message(self, value): def set_status_message(self, value):
@ -131,7 +132,7 @@ class Profile(contact.Contact, Singleton):
self.filtration(self._show_online, self._filter_string) self.filtration(self._show_online, self._filter_string)
def get_friend_by_number(self, num): def get_friend_by_number(self, num):
return filter(lambda x: x.number == num, self._friends)[0] return list(filter(lambda x: x.number == num, self._friends))[0]
def get_friend(self, num): def get_friend(self, num):
return self._friends[num] return self._friends[num]
@ -178,7 +179,7 @@ class Profile(contact.Contact, Singleton):
if message.get_type() <= 1: if message.get_type() <= 1:
data = message.get_data() data = message.get_data()
self.create_message_item(data[0], self.create_message_item(data[0],
convert_time(data[2]), data[2],
data[1], data[1],
data[3]) data[3])
elif message.get_type() == MESSAGE_TYPE['FILE_TRANSFER']: elif message.get_type() == MESSAGE_TYPE['FILE_TRANSFER']:
@ -192,13 +193,13 @@ class Profile(contact.Contact, Singleton):
ft.set_state_changed_handler(item.update) ft.set_state_changed_handler(item.update)
ft.signal() ft.signal()
except: except:
print 'Incoming not started transfer - no info found' print('Incoming not started transfer - no info found')
elif message.get_type() == MESSAGE_TYPE['INLINE']: # inline elif message.get_type() == MESSAGE_TYPE['INLINE']: # inline
self.create_inline_item(message.get_data()) self.create_inline_item(message.get_data())
else: # info message else: # info message
data = message.get_data() data = message.get_data()
self.create_message_item(data[0], self.create_message_item(data[0],
convert_time(data[2]), data[2],
'', '',
data[3]) data[3])
self._messages.scrollToBottom() self._messages.scrollToBottom()
@ -222,8 +223,9 @@ class Profile(contact.Contact, Singleton):
self._screen.account_avatar.setScaledContents(False) self._screen.account_avatar.setScaledContents(False)
self._screen.account_avatar.setPixmap(pixmap.scaled(64, 64, QtCore.Qt.KeepAspectRatio)) self._screen.account_avatar.setPixmap(pixmap.scaled(64, 64, QtCore.Qt.KeepAspectRatio))
self._screen.account_avatar.repaint() # comment? self._screen.account_avatar.repaint() # comment?
except: # no friend found. ignore except Exception as ex: # no friend found. ignore
log('Incorrect friend value: ' + str(value)) log('Friend value: ' + str(value))
log('Error: ' + str(ex))
raise raise
active_friend = property(get_active, set_active) active_friend = property(get_active, set_active)
@ -244,14 +246,14 @@ class Profile(contact.Contact, Singleton):
friend = self.get_friend_by_number(number) friend = self.get_friend_by_number(number)
tmp = friend.name tmp = friend.name
friend.set_name(name) friend.set_name(name)
name = name.decode('utf-8') name = str(name, 'utf-8')
if friend.name == name and tmp != name: if friend.name == name and tmp != name:
message = QtGui.QApplication.translate("MainWindow", 'User {} is now known as {}', None, QtGui.QApplication.UnicodeUTF8) message = QtGui.QApplication.translate("MainWindow", 'User {} is now known as {}', None, QtGui.QApplication.UnicodeUTF8)
message = message.format(tmp, name) message = message.format(tmp, name)
friend.append_message(InfoMessage(message, time.time())) friend.append_message(InfoMessage(message, time.time()))
friend.actions = True friend.actions = True
if number == self.get_active_number(): if number == self.get_active_number():
self.create_message_item(message, curr_time(), '', MESSAGE_TYPE['INFO_MESSAGE']) self.create_message_item(message, time.time(), '', MESSAGE_TYPE['INFO_MESSAGE'])
self._messages.scrollToBottom() self._messages.scrollToBottom()
self.set_active(None) self.set_active(None)
@ -277,7 +279,7 @@ class Profile(contact.Contact, Singleton):
if friend_number == self.get_active_number(): if friend_number == self.get_active_number():
self.update() self.update()
except Exception as ex: except Exception as ex:
print 'Exception in file sending: ' + str(ex) print('Exception in file sending: ' + str(ex))
def friend_exit(self, friend_number): def friend_exit(self, friend_number):
""" """
@ -324,10 +326,11 @@ class Profile(contact.Contact, Singleton):
""" """
friend = self.get_friend_by_number(friend_number) friend = self.get_friend_by_number(friend_number)
friend.load_corr() friend.load_corr()
messages = friend.unsent_messages() messages = friend.get_unsent_messages()
try: try:
for message in messages: for message in messages:
self.split_and_send(friend_number, message.get_data()[-1], message.get_data()[0].encode('utf-8')) self.split_and_send(friend_number, message.get_data()[-1], message.get_data()[0].encode('utf-8'))
friend.inc_receipts()
except: except:
pass pass
@ -362,15 +365,16 @@ class Profile(contact.Contact, Singleton):
:param message: text of message :param message: text of message
""" """
if friend_num == self.get_active_number(): # add message to list if friend_num == self.get_active_number(): # add message to list
self.create_message_item(message.decode('utf-8'), curr_time(), MESSAGE_OWNER['FRIEND'], message_type) t = time.time()
self.create_message_item(message, t, MESSAGE_OWNER['FRIEND'], message_type)
self._messages.scrollToBottom() self._messages.scrollToBottom()
self._friends[self._active_friend].append_message( self._friends[self._active_friend].append_message(
TextMessage(message.decode('utf-8'), MESSAGE_OWNER['FRIEND'], time.time(), message_type)) TextMessage(message, MESSAGE_OWNER['FRIEND'], t, message_type))
else: else:
friend = self.get_friend_by_number(friend_num) friend = self.get_friend_by_number(friend_num)
friend.inc_messages() friend.inc_messages()
friend.append_message( friend.append_message(
TextMessage(message.decode('utf-8'), MESSAGE_OWNER['FRIEND'], time.time(), message_type)) TextMessage(message, MESSAGE_OWNER['FRIEND'], time.time(), message_type))
if not friend.visibility: if not friend.visibility:
self.update_filtration() self.update_filtration()
@ -392,10 +396,17 @@ class Profile(contact.Contact, Singleton):
friend.inc_receipts() friend.inc_receipts()
if friend.status is not None: if friend.status is not None:
self.split_and_send(friend.number, message_type, text.encode('utf-8')) self.split_and_send(friend.number, message_type, text.encode('utf-8'))
self.create_message_item(text, curr_time(), MESSAGE_OWNER['NOT_SENT'], message_type) t = time.time()
self.create_message_item(text, t, MESSAGE_OWNER['NOT_SENT'], message_type)
self._screen.messageEdit.clear() self._screen.messageEdit.clear()
self._messages.scrollToBottom() self._messages.scrollToBottom()
friend.append_message(TextMessage(text, MESSAGE_OWNER['NOT_SENT'], time.time(), message_type)) friend.append_message(TextMessage(text, MESSAGE_OWNER['NOT_SENT'], t, message_type))
def delete_message(self, time):
friend = self._friends[self._active_friend]
friend.delete_message(time)
self._history.delete_message(friend.tox_id, time)
self.update()
# ----------------------------------------------------------------------------------------------------------------- # -----------------------------------------------------------------------------------------------------------------
# History support # History support
@ -405,35 +416,39 @@ class Profile(contact.Contact, Singleton):
""" """
Save history to db Save history to db
""" """
s = Settings.get_instance()
if hasattr(self, '_history'): if hasattr(self, '_history'):
if Settings.get_instance()['save_history']: if s['save_history']:
for friend in self._friends: for friend in self._friends:
messages = friend.get_corr_for_saving()
if not self._history.friend_exists_in_db(friend.tox_id): if not self._history.friend_exists_in_db(friend.tox_id):
self._history.add_friend_to_db(friend.tox_id) self._history.add_friend_to_db(friend.tox_id)
if not s['save_unsent_only']:
messages = friend.get_corr_for_saving()
else:
messages = friend.get_unsent_messages_for_saving()
self._history.delete_messages(friend.tox_id)
self._history.save_messages_to_db(friend.tox_id, messages) self._history.save_messages_to_db(friend.tox_id, messages)
unsent_messages = friend.unsent_messages() unsent_messages = friend.get_unsent_messages()
unsent_time = unsent_messages[0].get_data()[2] if len(unsent_messages) else time.time() + 1 unsent_time = unsent_messages[0].get_data()[2] if len(unsent_messages) else time.time() + 1
self._history.update_messages(friend.tox_id, unsent_time) self._history.update_messages(friend.tox_id, unsent_time)
self._history.save() self._history.save()
del self._history del self._history
def clear_history(self, num=None): def clear_history(self, num=None, save_unsent=False):
""" """
Clear chat history Clear chat history
""" """
if num is not None: if num is not None:
friend = self._friends[num] friend = self._friends[num]
friend.clear_corr() friend.clear_corr(save_unsent)
if self._history.friend_exists_in_db(friend.tox_id): if self._history.friend_exists_in_db(friend.tox_id):
self._history.delete_messages(friend.tox_id) self._history.delete_messages(friend.tox_id)
self._history.delete_friend_from_db(friend.tox_id) self._history.delete_friend_from_db(friend.tox_id)
else: # clear all history else: # clear all history
for number in xrange(len(self._friends)): for number in range(len(self._friends)):
self.clear_history(number) self.clear_history(number, save_unsent)
if num is None or num == self.get_active_number(): if num is None or num == self.get_active_number():
self._messages.clear() self.update()
self._messages.repaint()
def load_history(self): def load_history(self):
""" """
@ -450,7 +465,7 @@ class Profile(contact.Contact, Singleton):
if message.get_type() <= 1: # text message if message.get_type() <= 1: # text message
data = message.get_data() data = message.get_data()
self.create_message_item(data[0], self.create_message_item(data[0],
convert_time(data[2]), data[2],
data[1], data[1],
data[3], data[3],
False) False)
@ -465,13 +480,13 @@ class Profile(contact.Contact, Singleton):
ft.set_state_changed_handler(item.update) ft.set_state_changed_handler(item.update)
ft.signal() ft.signal()
except: except:
print 'Incoming not started transfer - no info found' print('Incoming not started transfer - no info found')
elif message.get_type() == MESSAGE_TYPE['INLINE']: # inline elif message.get_type() == MESSAGE_TYPE['INLINE']: # inline
self.create_inline_item(message.get_data()) self.create_inline_item(message.get_data())
else: # info message else: # info message
data = message.get_data() data = message.get_data()
self.create_message_item(data[0], self.create_message_item(data[0],
convert_time(data[2]), data[2],
'', '',
data[3]) data[3])
@ -558,11 +573,11 @@ class Profile(contact.Contact, Singleton):
Set new alias for friend Set new alias for friend
""" """
friend = self._friends[num] friend = self._friends[num]
name = friend.name.encode('utf-8') name = friend.name
dialog = QtGui.QApplication.translate('MainWindow', dialog = QtGui.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, QtGui.QApplication.UnicodeUTF8) None, QtGui.QApplication.UnicodeUTF8)
dialog = dialog.format(name.decode('utf-8')) dialog = dialog.format(name)
title = QtGui.QApplication.translate('MainWindow', title = QtGui.QApplication.translate('MainWindow',
'Set alias', 'Set alias',
None, QtGui.QApplication.UnicodeUTF8) None, QtGui.QApplication.UnicodeUTF8)
@ -570,28 +585,29 @@ class Profile(contact.Contact, Singleton):
title, title,
dialog, dialog,
QtGui.QLineEdit.Normal, QtGui.QLineEdit.Normal,
name.decode('utf-8')) name)
if ok: if ok:
settings = Settings.get_instance() settings = Settings.get_instance()
aliases = settings['friends_aliases'] aliases = settings['friends_aliases']
if text: if text:
friend.name = text.encode('utf-8') friend.name = bytes(text, 'utf-8')
try: try:
index = map(lambda x: x[0], aliases).index(friend.tox_id) index = list(map(lambda x: x[0], aliases)).index(friend.tox_id)
aliases[index] = (friend.tox_id, text) aliases[index] = (friend.tox_id, text)
except: except:
aliases.append((friend.tox_id, text)) aliases.append((friend.tox_id, text))
friend.set_alias(text) friend.set_alias(text)
else: # use default name else: # use default name
friend.name = self._tox.friend_get_name(friend.number).encode('utf-8') friend.name = bytes(self._tox.friend_get_name(friend.number), 'utf-8')
friend.set_alias('') friend.set_alias('')
try: try:
index = map(lambda x: x[0], aliases).index(friend.tox_id) index = list(map(lambda x: x[0], aliases)).index(friend.tox_id)
del aliases[index] del aliases[index]
except: except:
pass pass
settings.save() settings.save()
self.set_active() if num == self.get_active_number():
self.update()
def friend_public_key(self, num): def friend_public_key(self, num):
return self._friends[num].tox_id return self._friends[num].tox_id
@ -604,7 +620,7 @@ class Profile(contact.Contact, Singleton):
friend = self._friends[num] friend = self._friends[num]
settings = Settings.get_instance() settings = Settings.get_instance()
try: try:
index = map(lambda x: x[0], settings['friends_aliases']).index(friend.tox_id) index = list(map(lambda x: x[0], settings['friends_aliases'])).index(friend.tox_id)
del settings['friends_aliases'][index] del settings['friends_aliases'][index]
except: except:
pass pass
@ -755,6 +771,8 @@ class Profile(contact.Contact, Singleton):
if hasattr(self, '_call'): if hasattr(self, '_call'):
self._call.stop() self._call.stop()
del self._call del self._call
for i in range(len(self._friends)):
del self._friends[0]
# ----------------------------------------------------------------------------------------------------------------- # -----------------------------------------------------------------------------------------------------------------
# File transfers support # File transfers support
@ -905,7 +923,7 @@ class Profile(contact.Contact, Singleton):
self.send_inline(data, 'toxygen_inline.png') self.send_inline(data, 'toxygen_inline.png')
def send_sticker(self, path): def send_sticker(self, path):
with open(path) as fl: with open(path, 'rb') as fl:
data = fl.read() data = fl.read()
self.send_inline(data, 'sticker.png') self.send_inline(data, 'sticker.png')
@ -948,7 +966,7 @@ class Profile(contact.Contact, Singleton):
self.update() self.update()
return return
elif friend.status is None and is_resend: elif friend.status is None and is_resend:
print 'Error in sending' print('Error in sending')
raise RuntimeError() raise RuntimeError()
st = SendTransfer(path, self._tox, friend_number) st = SendTransfer(path, self._tox, friend_number)
self._file_transfers[(friend_number, st.get_file_number())] = st self._file_transfers[(friend_number, st.get_file_number())] = st
@ -976,6 +994,7 @@ class Profile(contact.Contact, Singleton):
self.get_friend_by_number(friend_number).load_avatar() self.get_friend_by_number(friend_number).load_avatar()
self.set_active(None) self.set_active(None)
elif type(transfer) is ReceiveToBuffer: # inline image elif type(transfer) is ReceiveToBuffer: # inline image
print('inline')
inline = InlineImage(transfer.get_data()) inline = InlineImage(transfer.get_data())
i = self.get_friend_by_number(friend_number).update_transfer_data(file_number, i = self.get_friend_by_number(friend_number).update_transfer_data(file_number,
TOX_FILE_TRANSFER_STATE['FINISHED'], TOX_FILE_TRANSFER_STATE['FINISHED'],
@ -1005,6 +1024,7 @@ class Profile(contact.Contact, Singleton):
if type(transfer) is not SendAvatar: if type(transfer) is not SendAvatar:
if type(transfer) is SendFromBuffer and Settings.get_instance()['allow_inline']: # inline if type(transfer) is SendFromBuffer and Settings.get_instance()['allow_inline']: # inline
inline = InlineImage(transfer.get_data()) inline = InlineImage(transfer.get_data())
print('inline')
i = self.get_friend_by_number(friend_number).update_transfer_data(file_number, i = self.get_friend_by_number(friend_number).update_transfer_data(file_number,
TOX_FILE_TRANSFER_STATE[ TOX_FILE_TRANSFER_STATE[
'FINISHED'], 'FINISHED'],
@ -1082,7 +1102,7 @@ class Profile(contact.Contact, Singleton):
text = QtGui.QApplication.translate("incoming_call", "Outgoing audio call", None, text = QtGui.QApplication.translate("incoming_call", "Outgoing audio call", None,
QtGui.QApplication.UnicodeUTF8) QtGui.QApplication.UnicodeUTF8)
self._friends[self._active_friend].append_message(InfoMessage(text, time.time())) self._friends[self._active_friend].append_message(InfoMessage(text, time.time()))
self.create_message_item(text, curr_time(), '', MESSAGE_TYPE['INFO_MESSAGE']) self.create_message_item(text, time.time(), '', MESSAGE_TYPE['INFO_MESSAGE'])
self._messages.scrollToBottom() self._messages.scrollToBottom()
elif num in self._call: # finish or cancel call if you call with active friend elif num in self._call: # finish or cancel call if you call with active friend
self.stop_call(num, False) self.stop_call(num, False)
@ -1102,7 +1122,7 @@ class Profile(contact.Contact, Singleton):
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():
self._screen.incoming_call() self._screen.incoming_call()
self.create_message_item(text, curr_time(), '', MESSAGE_TYPE['INFO_MESSAGE']) self.create_message_item(text, time.time(), '', MESSAGE_TYPE['INFO_MESSAGE'])
self._messages.scrollToBottom() self._messages.scrollToBottom()
else: else:
friend.actions = True friend.actions = True
@ -1136,7 +1156,7 @@ class Profile(contact.Contact, Singleton):
friend = self.get_friend_by_number(friend_number) friend = self.get_friend_by_number(friend_number)
friend.append_message(InfoMessage(text, time.time())) friend.append_message(InfoMessage(text, time.time()))
if friend_number == self.get_active_number(): if friend_number == self.get_active_number():
self.create_message_item(text, curr_time(), '', MESSAGE_TYPE['INFO_MESSAGE']) self.create_message_item(text, time.time(), '', MESSAGE_TYPE['INFO_MESSAGE'])
self._messages.scrollToBottom() self._messages.scrollToBottom()
@ -1151,7 +1171,7 @@ def tox_factory(data=None, settings=None):
tox_options = Tox.options_new() tox_options = Tox.options_new()
tox_options.contents.udp_enabled = settings['udp_enabled'] tox_options.contents.udp_enabled = settings['udp_enabled']
tox_options.contents.proxy_type = settings['proxy_type'] tox_options.contents.proxy_type = settings['proxy_type']
tox_options.contents.proxy_host = settings['proxy_host'] tox_options.contents.proxy_host = bytes(settings['proxy_host'], 'UTF-8')
tox_options.contents.proxy_port = settings['proxy_port'] tox_options.contents.proxy_port = settings['proxy_port']
tox_options.contents.start_port = settings['start_port'] tox_options.contents.start_port = settings['start_port']
tox_options.contents.end_port = settings['end_port'] tox_options.contents.end_port = settings['end_port']

View File

@ -8,13 +8,14 @@ from toxencryptsave import LibToxEncryptSave
import smileys import smileys
class Settings(Singleton, dict): class Settings(dict, Singleton):
""" """
Settings of current profile + global app settings Settings of current profile + global app settings
""" """
def __init__(self, name): def __init__(self, name):
self.path = ProfileHelper.get_path() + unicode(name) + '.json' Singleton.__init__(self)
self.path = ProfileHelper.get_path() + str(name) + '.json'
self.name = name self.name = name
if os.path.isfile(self.path): if os.path.isfile(self.path):
with open(self.path, 'rb') as fl: with open(self.path, 'rb') as fl:
@ -23,7 +24,7 @@ class Settings(Singleton, dict):
try: try:
if inst.is_data_encrypted(data): if inst.is_data_encrypted(data):
data = inst.pass_decrypt(data) data = inst.pass_decrypt(data)
info = json.loads(data) info = json.loads(str(data, 'utf-8'))
except Exception as ex: except Exception as ex:
info = Settings.get_default_settings() info = Settings.get_default_settings()
log('Parsing settings error: ' + str(ex)) log('Parsing settings error: ' + str(ex))
@ -45,7 +46,7 @@ class Settings(Singleton, dict):
data = fl.read() data = fl.read()
auto = json.loads(data) auto = json.loads(data)
if 'path' in auto and 'name' in auto: if 'path' in auto and 'name' in auto:
return unicode(auto['path']), unicode(auto['name']) return str(auto['path']), str(auto['name'])
return '', '' return '', ''
@staticmethod @staticmethod
@ -54,8 +55,8 @@ class Settings(Singleton, dict):
with open(p) as fl: with open(p) as fl:
data = fl.read() data = fl.read()
data = json.loads(data) data = json.loads(data)
data['path'] = unicode(path.decode(locale.getpreferredencoding())) data['path'] = str(path)
data['name'] = unicode(name) data['name'] = str(name)
with open(p, 'w') as fl: with open(p, 'w') as fl:
fl.write(json.dumps(data)) fl.write(json.dumps(data))
@ -73,7 +74,7 @@ class Settings(Singleton, dict):
@staticmethod @staticmethod
def is_active_profile(path, name): def is_active_profile(path, name):
path = path.decode(locale.getpreferredencoding()) + name + '.tox' path = path + name + '.tox'
settings = Settings.get_default_path() + 'toxygen.json' settings = Settings.get_default_path() + 'toxygen.json'
if os.path.isfile(settings): if os.path.isfile(settings):
with open(settings) as fl: with open(settings) as fl:
@ -121,7 +122,8 @@ class Settings(Singleton, dict):
'x': 400, 'x': 400,
'y': 400, 'y': 400,
'message_font_size': 14, 'message_font_size': 14,
'unread_color': 'red' 'unread_color': 'red',
'save_unsent_only': False
} }
@staticmethod @staticmethod
@ -136,7 +138,7 @@ class Settings(Singleton, dict):
default = Settings.get_default_settings() default = Settings.get_default_settings()
for key in default: for key in default:
if key not in self: if key not in self:
print key print(key)
self[key] = default[key] self[key] = default[key]
self.save() self.save()
@ -144,7 +146,9 @@ class Settings(Singleton, dict):
text = json.dumps(self) text = json.dumps(self)
inst = LibToxEncryptSave.get_instance() inst = LibToxEncryptSave.get_instance()
if inst.has_password(): if inst.has_password():
text = inst.pass_encrypt(text) text = bytes(inst.pass_encrypt(bytes(text, 'utf-8')))
else:
text = bytes(text, 'utf-8')
with open(self.path, 'wb') as fl: with open(self.path, 'wb') as fl:
fl.write(text) fl.write(text)
@ -155,7 +159,7 @@ class Settings(Singleton, dict):
data = fl.read() data = fl.read()
app_settings = json.loads(data) app_settings = json.loads(data)
try: try:
app_settings['active_profile'].remove(unicode(ProfileHelper.get_path() + self.name + '.tox')) app_settings['active_profile'].remove(str(ProfileHelper.get_path() + self.name + '.tox'))
except: except:
pass pass
data = json.dumps(app_settings) data = json.dumps(app_settings)
@ -176,7 +180,7 @@ class Settings(Singleton, dict):
if 'active_profile' not in app_settings: if 'active_profile' not in app_settings:
app_settings['active_profile'] = [] app_settings['active_profile'] = []
profile_path = ProfileHelper.get_path() profile_path = ProfileHelper.get_path()
app_settings['active_profile'].append(unicode(profile_path + str(self.name) + '.tox')) app_settings['active_profile'].append(str(profile_path + str(self.name) + '.tox'))
data = json.dumps(app_settings) data = json.dumps(app_settings)
with open(path, 'w') as fl: with open(path, 'w') as fl:
fl.write(data) fl.write(data)
@ -199,7 +203,7 @@ class ProfileHelper(Singleton):
Class with methods for search, load and save profiles Class with methods for search, load and save profiles
""" """
def __init__(self, path, name): def __init__(self, path, name):
path = path.decode(locale.getpreferredencoding()) Singleton.__init__(self)
self._path = path + name + '.tox' self._path = path + name + '.tox'
self._directory = path self._directory = path
# create /avatars if not exists: # create /avatars if not exists:
@ -224,7 +228,7 @@ class ProfileHelper(Singleton):
data = inst.pass_encrypt(data) data = inst.pass_encrypt(data)
with open(self._path, 'wb') as fl: with open(self._path, 'wb') as fl:
fl.write(data) fl.write(data)
print 'Profile saved successfully' print('Profile saved successfully')
def export_profile(self, new_path): def export_profile(self, new_path):
new_path += os.path.basename(self._path) new_path += os.path.basename(self._path)
@ -232,7 +236,7 @@ class ProfileHelper(Singleton):
data = fin.read() data = fin.read()
with open(new_path, 'wb') as fout: with open(new_path, 'wb') as fout:
fout.write(data) fout.write(data)
print 'Profile exported successfully' print('Profile exported successfully')
@staticmethod @staticmethod
def find_profiles(): def find_profiles():

View File

@ -14,6 +14,7 @@ class SmileyLoader(util.Singleton):
""" """
def __init__(self, settings): def __init__(self, settings):
super().__init__()
self._settings = settings self._settings = settings
self._curr_pack = None # current pack name self._curr_pack = None # current pack name
self._smileys = {} # smileys dict. key - smiley (str), value - path to image (str) self._smileys = {} # smileys dict. key - smiley (str), value - path to image (str)
@ -29,22 +30,22 @@ class SmileyLoader(util.Singleton):
self._curr_pack = pack_name self._curr_pack = pack_name
path = self.get_smileys_path() + 'config.json' path = self.get_smileys_path() + 'config.json'
try: try:
with open(path) as fl: with open(path, encoding='utf8') as fl:
self._smileys = json.loads(fl.read()) self._smileys = json.loads(fl.read())
fl.seek(0) fl.seek(0)
tmp = json.loads(fl.read(), object_pairs_hook=OrderedDict) tmp = json.loads(fl.read(), object_pairs_hook=OrderedDict)
print 'Smiley pack {} loaded'.format(pack_name) print('Smiley pack {} loaded'.format(pack_name))
keys, values, self._list = [], [], [] keys, values, self._list = [], [], []
for key, value in tmp.items(): for key, value in tmp.items():
value = self.get_smileys_path() + value value = self.get_smileys_path() + value
if value not in values: if value not in values:
keys.append(key) keys.append(key)
values.append(value) values.append(value)
self._list = zip(keys, values) self._list = list(zip(keys, values))
except Exception as ex: except Exception as ex:
self._smileys = {} self._smileys = {}
self._list = [] self._list = []
print 'Smiley pack {} was not loaded. Error: {}'.format(pack_name, ex) print('Smiley pack {} was not loaded. Error: {}'.format(pack_name, ex))
def get_smileys_path(self): def get_smileys_path(self):
return util.curr_directory() + '/smileys/' + self._curr_pack + '/' return util.curr_directory() + '/smileys/' + self._curr_pack + '/'
@ -54,7 +55,7 @@ class SmileyLoader(util.Singleton):
return [x[1] for x in os.walk(d)][0] return [x[1] for x in os.walk(d)][0]
def get_smileys(self): def get_smileys(self):
return self._list[:] return list(self._list)
def add_smileys_to_text(self, text, edit): def add_smileys_to_text(self, text, edit):
""" """
@ -69,7 +70,7 @@ class SmileyLoader(util.Singleton):
for i in range(len(arr)): for i in range(len(arr)):
if arr[i] in self._smileys: if arr[i] in self._smileys:
file_name = self._smileys[arr[i]] # image name file_name = self._smileys[arr[i]] # image name
arr[i] = u'<img title=\"{}\" src=\"{}\" />'.format(arr[i], file_name) arr[i] = '<img title=\"{}\" src=\"{}\" />'.format(arr[i], file_name)
if file_name.endswith('.gif'): # animated smiley if file_name.endswith('.gif'): # animated smiley
edit.addAnimation(QtCore.QUrl(file_name), self.get_smileys_path() + file_name) edit.addAnimation(QtCore.QUrl(file_name), self.get_smileys_path() + file_name)
return ' '.join(arr) return ' '.join(arr)
@ -85,6 +86,6 @@ def sticker_loader():
for key in keys: for key in keys:
path = d + key + '/' path = d + key + '/'
files = filter(lambda f: f.endswith('.png'), os.listdir(path)) files = filter(lambda f: f.endswith('.png'), os.listdir(path))
files = map(lambda f: unicode(path + f), files) files = map(lambda f: str(path + f), files)
result.extend(files) result.extend(files)
return result return result

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1 @@
{":darthmaul:": "darthmaul.png", ":darthsidious:": "darthsidious.png", ":y-wing:": "y-wing.png", ":samjackson:": "samjackson.png", ":confused:": "confused.png", ":sith:": "sith.png", ":sad:": "sad.png", ":jango:": "jango.png", ":tongue:": "tongue.png", ":wink:": "wink.png", ":chewie:": "chewie.png", ":boba:": "boba.png", ":c3p0:": "c3p0.png", ":stormtrooper:": "stormtrooper.png", ":smile:": "smile.png", ":tape:": "tape.png", ":mad:": "mad.png", ":shocked:": "shocked.png", ":jedi:": "jedi.png", ":jarjarbinks:": "jarjarbinks.png", ":dualsith:": "dualsith.png", ":r2d2:": "r2d2.png", ":grin:": "grin.png", ":x-wing:": "x-wing.png", ":leia:": "leia.png", ":happy:": "happy.png", ":jedi2:": "jedi2.png", ":ackbar:": "ackbar.png", ":deathstar:": "deathstar.png", ":darthvader:": "darthvader.png", ":masteryoda:": "masteryoda.png", ":anim:": "anim.gif"}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1022 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 958 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

File diff suppressed because one or more lines are too long

View File

@ -23,15 +23,15 @@ class ToxOptions(Structure):
def string_to_bin(tox_id): def string_to_bin(tox_id):
return c_char_p(tox_id.decode('hex')) if tox_id is not None else None return c_char_p(bytes.fromhex(tox_id)) if tox_id is not None else None
def bin_to_string(raw_id, length): def bin_to_string(raw_id, length):
res = ''.join('{:02x}'.format(ord(raw_id[i])) for i in xrange(length)) res = ''.join('{:02x}'.format(ord(raw_id[i])) for i in range(length))
return res.upper() return res.upper()
class Tox(object): class Tox:
libtoxcore = LibToxCore() libtoxcore = LibToxCore()
@ -382,7 +382,7 @@ class Tox(object):
if name is None: if name is None:
name = create_string_buffer(self.self_get_name_size()) name = create_string_buffer(self.self_get_name_size())
Tox.libtoxcore.tox_self_get_name(self._tox_pointer, name) Tox.libtoxcore.tox_self_get_name(self._tox_pointer, name)
return name.value.decode('utf8') return str(name.value, 'utf-8')
def self_set_status_message(self, status_message): def self_set_status_message(self, status_message):
""" """
@ -430,7 +430,7 @@ class Tox(object):
if status_message is None: if status_message is None:
status_message = create_string_buffer(self.self_get_status_message_size()) status_message = create_string_buffer(self.self_get_status_message_size())
Tox.libtoxcore.tox_self_get_status_message(self._tox_pointer, status_message) Tox.libtoxcore.tox_self_get_status_message(self._tox_pointer, status_message)
return status_message.value.decode('utf8') return str(status_message.value, 'utf-8')
def self_set_status(self, status): def self_set_status(self, status):
""" """
@ -688,7 +688,7 @@ class Tox(object):
byref(tox_err_friend_query)) byref(tox_err_friend_query))
tox_err_friend_query = tox_err_friend_query.value tox_err_friend_query = tox_err_friend_query.value
if tox_err_friend_query == TOX_ERR_FRIEND_QUERY['OK']: if tox_err_friend_query == TOX_ERR_FRIEND_QUERY['OK']:
return name.value.decode('utf8') return str(name.value, 'utf-8')
elif tox_err_friend_query == TOX_ERR_FRIEND_QUERY['NULL']: elif tox_err_friend_query == TOX_ERR_FRIEND_QUERY['NULL']:
raise ArgumentError('The pointer parameter for storing the query result (name, message) was NULL. Unlike' raise ArgumentError('The pointer parameter for storing the query result (name, message) was NULL. Unlike'
' the `_self_` variants of these functions, which have no effect when a parameter is' ' the `_self_` variants of these functions, which have no effect when a parameter is'
@ -752,7 +752,7 @@ class Tox(object):
byref(tox_err_friend_query)) byref(tox_err_friend_query))
tox_err_friend_query = tox_err_friend_query.value tox_err_friend_query = tox_err_friend_query.value
if tox_err_friend_query == TOX_ERR_FRIEND_QUERY['OK']: if tox_err_friend_query == TOX_ERR_FRIEND_QUERY['OK']:
return status_message.value.decode('utf8') return str(status_message.value, 'utf-8')
elif tox_err_friend_query == TOX_ERR_FRIEND_QUERY['NULL']: elif tox_err_friend_query == TOX_ERR_FRIEND_QUERY['NULL']:
raise ArgumentError('The pointer parameter for storing the query result (name, message) was NULL. Unlike' raise ArgumentError('The pointer parameter for storing the query result (name, message) was NULL. Unlike'
' the `_self_` variants of these functions, which have no effect when a parameter is' ' the `_self_` variants of these functions, which have no effect when a parameter is'
@ -1200,7 +1200,9 @@ class Tox(object):
""" """
tox_err_file_send = c_int() tox_err_file_send = c_int()
result = self.libtoxcore.tox_file_send(self._tox_pointer, c_uint32(friend_number), c_uint32(kind), result = self.libtoxcore.tox_file_send(self._tox_pointer, c_uint32(friend_number), c_uint32(kind),
c_uint64(file_size), string_to_bin(file_id), c_char_p(filename), c_uint64(file_size),
string_to_bin(file_id),
c_char_p(filename),
c_size_t(len(filename)), byref(tox_err_file_send)) c_size_t(len(filename)), byref(tox_err_file_send))
tox_err_file_send = tox_err_file_send.value tox_err_file_send = tox_err_file_send.value
if tox_err_file_send == TOX_ERR_FILE_SEND['OK']: if tox_err_file_send == TOX_ERR_FILE_SEND['OK']:

View File

@ -1,5 +1,5 @@
import json import json
import urllib2 import urllib.request
from util import log from util import log
@ -20,10 +20,10 @@ def tox_dns(email):
def send_request(url, data): def send_request(url, data):
req = urllib2.Request(url) req = urllib.request.Request(url)
req.add_header('Content-Type', 'application/json') req.add_header('Content-Type', 'application/json')
response = urllib2.urlopen(req, json.dumps(data)) response = urllib.request.urlopen(req, bytes(json.dumps(data), 'utf-8'))
res = json.loads(response.read()) res = json.loads(str(response.read(), 'utf-8'))
if not res['c']: if not res['c']:
return res['tox_id'] return res['tox_id']
else: else:

View File

@ -4,7 +4,7 @@ from libtox import LibToxAV
from toxav_enums import * from toxav_enums import *
class ToxAV(object): class ToxAV:
""" """
The ToxAV instance type. Each ToxAV instance can be bound to only one Tox instance, and Tox instance can have only The ToxAV instance type. Each ToxAV instance can be bound to only one Tox instance, and Tox instance can have only
one ToxAV instance. One must make sure to close ToxAV instance prior closing Tox instance otherwise undefined one ToxAV instance. One must make sure to close ToxAV instance prior closing Tox instance otherwise undefined

View File

@ -39,6 +39,7 @@ class LibToxEncryptSave(util.Singleton):
libtoxencryptsave = libtox.LibToxEncryptSave() libtoxencryptsave = libtox.LibToxEncryptSave()
def __init__(self): def __init__(self):
super().__init__()
self._passphrase = None self._passphrase = None
def set_password(self, passphrase): def set_password(self, passphrase):
@ -50,7 +51,7 @@ class LibToxEncryptSave(util.Singleton):
def is_data_encrypted(self, data): def is_data_encrypted(self, data):
func = self.libtoxencryptsave.tox_is_data_encrypted func = self.libtoxencryptsave.tox_is_data_encrypted
func.restype = c_bool func.restype = c_bool
result = func(c_char_p(data)) result = func(c_char_p(bytes(data)))
return result return result
def pass_encrypt(self, data): def pass_encrypt(self, data):
@ -63,7 +64,7 @@ class LibToxEncryptSave(util.Singleton):
tox_err_encryption = c_int() tox_err_encryption = c_int()
self.libtoxencryptsave.tox_pass_encrypt(c_char_p(data), self.libtoxencryptsave.tox_pass_encrypt(c_char_p(data),
c_size_t(len(data)), c_size_t(len(data)),
c_char_p(self._passphrase), c_char_p(bytes(self._passphrase, 'utf-8')),
c_size_t(len(self._passphrase)), c_size_t(len(self._passphrase)),
out, out,
byref(tox_err_encryption)) byref(tox_err_encryption))
@ -86,9 +87,9 @@ class LibToxEncryptSave(util.Singleton):
""" """
out = create_string_buffer(len(data) - TOX_PASS_ENCRYPTION_EXTRA_LENGTH) out = create_string_buffer(len(data) - TOX_PASS_ENCRYPTION_EXTRA_LENGTH)
tox_err_decryption = c_int() tox_err_decryption = c_int()
self.libtoxencryptsave.tox_pass_decrypt(c_char_p(data), self.libtoxencryptsave.tox_pass_decrypt(c_char_p(bytes(data)),
c_size_t(len(data)), c_size_t(len(data)),
c_char_p(self._passphrase), c_char_p(bytes(self._passphrase, 'utf-8')),
c_size_t(len(self._passphrase)), c_size_t(len(self._passphrase)),
out, out,
byref(tox_err_decryption)) byref(tox_err_decryption))

View File

@ -26,7 +26,7 @@
<context> <context>
<name>Callback</name> <name>Callback</name>
<message> <message>
<location filename="callbacks.py" line="182"/> <location filename="callbacks.py" line="183"/>
<source>File from</source> <source>File from</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -129,13 +129,13 @@ can produce IP leak</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="725"/> <location filename="profile.py" line="743"/>
<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="727"/> <location filename="profile.py" line="745"/>
<source>Friend request</source> <source>Friend request</source>
<translation></translation> <translation></translation>
</message> </message>
@ -175,7 +175,7 @@ can produce IP leak</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="565"/> <location filename="profile.py" line="582"/>
<source>Enter new alias for friend {} or leave empty to use friend&apos;s name:</source> <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> <translation>Enter new alias for friend {} or leave empty to use friend&apos;s name:</translation>
</message> </message>
@ -190,7 +190,7 @@ can produce IP leak</source>
<translation type="obsolete">Find contact</translation> <translation type="obsolete">Find contact</translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="697"/> <location filename="profile.py" line="715"/>
<source>Friend added</source> <source>Friend added</source>
<translation>Friend added</translation> <translation>Friend added</translation>
</message> </message>
@ -202,12 +202,12 @@ Version: </source>
Version:</translation> Version:</translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="698"/> <location filename="profile.py" line="716"/>
<source>Friend added without sending friend request</source> <source>Friend added without sending friend request</source>
<translation>Friend added without sending friend request</translation> <translation>Friend added without sending friend request</translation>
</message> </message>
<message> <message>
<location filename="list_items.py" line="464"/> <location filename="list_items.py" line="484"/>
<source>Choose folder</source> <source>Choose folder</source>
<translation>Choose folder</translation> <translation>Choose folder</translation>
</message> </message>
@ -267,55 +267,60 @@ Version:</translation>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="widgets.py" line="84"/> <location filename="widgets.py" line="83"/>
<source>Copy link location</source> <source>Copy link location</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="widgets.py" line="87"/> <location filename="widgets.py" line="86"/>
<source>Copy</source> <source>Copy</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="widgets.py" line="90"/> <location filename="widgets.py" line="89"/>
<source>Select all</source> <source>Select all</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="widgets.py" line="93"/> <location filename="widgets.py" line="92"/>
<source>Delete</source> <source>Delete</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="widgets.py" line="96"/> <location filename="widgets.py" line="95"/>
<source>Paste</source> <source>Paste</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="widgets.py" line="99"/> <location filename="widgets.py" line="98"/>
<source>Cut</source> <source>Cut</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="widgets.py" line="102"/> <location filename="widgets.py" line="101"/>
<source>Undo</source> <source>Undo</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="widgets.py" line="105"/> <location filename="widgets.py" line="104"/>
<source>Redo</source> <source>Redo</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="widgets.py" line="126"/> <location filename="widgets.py" line="125"/>
<source>Save</source> <source>Save</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="250"/> <location filename="profile.py" line="254"/>
<source>User {} is now known as {}</source> <source>User {} is now known as {}</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="list_items.py" line="145"/>
<source>Delete message</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MenuWindow</name> <name>MenuWindow</name>
@ -335,32 +340,32 @@ Version:</translation>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="mainscreen_widgets.py" line="247"/> <location filename="mainscreen_widgets.py" line="248"/>
<source>Send screenshot</source> <source>Send screenshot</source>
<translation type="unfinished">Send screenshot</translation> <translation type="unfinished">Send screenshot</translation>
</message> </message>
<message> <message>
<location filename="mainscreen_widgets.py" line="248"/> <location filename="mainscreen_widgets.py" line="249"/>
<source>Send file</source> <source>Send file</source>
<translation type="unfinished">Send file</translation> <translation type="unfinished">Send file</translation>
</message> </message>
<message> <message>
<location filename="mainscreen_widgets.py" line="249"/> <location filename="mainscreen_widgets.py" line="250"/>
<source>Send audio message</source> <source>Send audio message</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="mainscreen_widgets.py" line="250"/> <location filename="mainscreen_widgets.py" line="251"/>
<source>Send video message</source> <source>Send video message</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="mainscreen_widgets.py" line="251"/> <location filename="mainscreen_widgets.py" line="252"/>
<source>Add smiley</source> <source>Add smiley</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="mainscreen_widgets.py" line="252"/> <location filename="mainscreen_widgets.py" line="253"/>
<source>Send sticker</source> <source>Send sticker</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -381,12 +386,12 @@ Version:</translation>
<context> <context>
<name>PluginWindow</name> <name>PluginWindow</name>
<message> <message>
<location filename="plugins/plugin_super_class.py" line="130"/> <location filename="plugins/plugin_super_class.py" line="132"/>
<source>List of commands for plugin {}</source> <source>List of commands for plugin {}</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="plugins/plugin_super_class.py" line="131"/> <location filename="plugins/plugin_super_class.py" line="133"/>
<source>No commands available</source> <source>No commands available</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -394,42 +399,42 @@ Version:</translation>
<context> <context>
<name>PluginsForm</name> <name>PluginsForm</name>
<message> <message>
<location filename="menu.py" line="697"/> <location filename="menu.py" line="737"/>
<source>Plugins</source> <source>Plugins</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="698"/> <location filename="menu.py" line="738"/>
<source>Open selected plugin</source> <source>Open selected plugin</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="711"/> <location filename="menu.py" line="751"/>
<source>No GUI found for this plugin</source> <source>No GUI found for this plugin</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="727"/> <location filename="menu.py" line="767"/>
<source>No description available</source> <source>No description available</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="743"/> <location filename="menu.py" line="783"/>
<source>Disable plugin</source> <source>Disable plugin</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="745"/> <location filename="menu.py" line="785"/>
<source>Enable plugin</source> <source>Enable plugin</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="735"/> <location filename="menu.py" line="775"/>
<source>No plugins found</source> <source>No plugins found</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="712"/> <location filename="menu.py" line="752"/>
<source>Error</source> <source>Error</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -555,17 +560,17 @@ Version:</translation>
<context> <context>
<name>audioSettingsForm</name> <name>audioSettingsForm</name>
<message> <message>
<location filename="menu.py" line="654"/> <location filename="menu.py" line="694"/>
<source>Audio settings</source> <source>Audio settings</source>
<translation>Audio settings</translation> <translation>Audio settings</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="655"/> <location filename="menu.py" line="695"/>
<source>Input device:</source> <source>Input device:</source>
<translation>Input device:</translation> <translation>Input device:</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="656"/> <location filename="menu.py" line="696"/>
<source>Output device:</source> <source>Output device:</source>
<translation>Output device:</translation> <translation>Output device:</translation>
</message> </message>
@ -573,32 +578,32 @@ Version:</translation>
<context> <context>
<name>incoming_call</name> <name>incoming_call</name>
<message> <message>
<location filename="profile.py" line="1098"/> <location filename="profile.py" line="1120"/>
<source>Incoming video call</source> <source>Incoming video call</source>
<translation>Incoming video call</translation> <translation>Incoming video call</translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="1101"/> <location filename="profile.py" line="1123"/>
<source>Incoming audio call</source> <source>Incoming audio call</source>
<translation>Incoming audio call</translation> <translation>Incoming audio call</translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="1081"/> <location filename="profile.py" line="1103"/>
<source>Outgoing video call</source> <source>Outgoing video call</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="1084"/> <location filename="profile.py" line="1106"/>
<source>Outgoing audio call</source> <source>Outgoing audio call</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="1130"/> <location filename="profile.py" line="1152"/>
<source>Call declined</source> <source>Call declined</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="1132"/> <location filename="profile.py" line="1154"/>
<source>Call finished</source> <source>Call finished</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -606,50 +611,55 @@ Version:</translation>
<context> <context>
<name>interfaceForm</name> <name>interfaceForm</name>
<message> <message>
<location filename="menu.py" line="572"/> <location filename="menu.py" line="602"/>
<source>Interface settings</source> <source>Interface settings</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="573"/> <location filename="menu.py" line="603"/>
<source>Theme:</source> <source>Theme:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="574"/> <location filename="menu.py" line="604"/>
<source>Language:</source> <source>Language:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="575"/> <location filename="menu.py" line="605"/>
<source>Smileys</source> <source>Smileys</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="576"/> <location filename="menu.py" line="606"/>
<source>Smiley pack:</source> <source>Smiley pack:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="577"/> <location filename="menu.py" line="607"/>
<source>Mirror mode</source> <source>Mirror mode</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="578"/> <location filename="menu.py" line="608"/>
<source>Messages font size:</source> <source>Messages font size:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="589"/> <location filename="menu.py" line="629"/>
<source>Restart app to apply settings</source> <source>Restart app to apply settings</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="590"/> <location filename="menu.py" line="630"/>
<source>Restart required</source> <source>Restart required</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="menu.py" line="609"/>
<source>Select unread messages notification color</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>login</name> <name>login</name>
@ -694,7 +704,7 @@ Version:</translation>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="main.py" line="125"/> <location filename="main.py" line="124"/>
<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></translation> <translation></translation>
</message> </message>
@ -707,22 +717,22 @@ Version:</translation>
<context> <context>
<name>notificationsForm</name> <name>notificationsForm</name>
<message> <message>
<location filename="menu.py" line="489"/> <location filename="menu.py" line="517"/>
<source>Notification settings</source> <source>Notification settings</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="490"/> <location filename="menu.py" line="518"/>
<source>Enable notifications</source> <source>Enable notifications</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="491"/> <location filename="menu.py" line="519"/>
<source>Enable call&apos;s sound</source> <source>Enable call&apos;s sound</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="492"/> <location filename="menu.py" line="520"/>
<source>Enable sound notifications</source> <source>Enable sound notifications</source>
<translation></translation> <translation></translation>
</message> </message>
@ -730,72 +740,72 @@ Version:</translation>
<context> <context>
<name>privacySettings</name> <name>privacySettings</name>
<message> <message>
<location filename="menu.py" line="407"/> <location filename="menu.py" line="413"/>
<source>Privacy settings</source> <source>Privacy settings</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="408"/> <location filename="menu.py" line="414"/>
<source>Save chat history</source> <source>Save chat history</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="409"/> <location filename="menu.py" line="415"/>
<source>Allow file auto accept</source> <source>Allow file auto accept</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="410"/> <location filename="menu.py" line="416"/>
<source>Send typing notifications</source> <source>Send typing notifications</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="411"/> <location filename="menu.py" line="417"/>
<source>Auto accept default path:</source> <source>Auto accept default path:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="412"/> <location filename="menu.py" line="418"/>
<source>Change</source> <source>Change</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="413"/> <location filename="menu.py" line="419"/>
<source>Allow inlines</source> <source>Allow inlines</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="436"/> <location filename="menu.py" line="464"/>
<source>Chat history</source> <source>Chat history</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="439"/> <location filename="menu.py" line="467"/>
<source>History will be cleaned! Continue?</source> <source>History will be cleaned! Continue?</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="415"/> <location filename="menu.py" line="421"/>
<source>Blocked users:</source> <source>Blocked users:</source>
<translation>Blocked users:</translation> <translation>Blocked users:</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="416"/> <location filename="menu.py" line="422"/>
<source>Unblock</source> <source>Unblock</source>
<translation>Unblock</translation> <translation>Unblock</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="417"/> <location filename="menu.py" line="423"/>
<source>Block user</source> <source>Block user</source>
<translation>Block user</translation> <translation>Block user</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="423"/> <location filename="menu.py" line="435"/>
<source>Add to friend list</source> <source>Add to friend list</source>
<translation>Add to friend list</translation> <translation>Add to friend list</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="424"/> <location filename="menu.py" line="436"/>
<source>Do you want to add this user to friend list?</source> <source>Do you want to add this user to friend list?</source>
<translation>Do you want to add this user to friend list?</translation> <translation>Do you want to add this user to friend list?</translation>
</message> </message>
@ -805,40 +815,45 @@ Version:</translation>
<translation type="obsolete">Block by TOX ID:</translation> <translation type="obsolete">Block by TOX ID:</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="414"/> <location filename="menu.py" line="420"/>
<source>Block by public key:</source> <source>Block by public key:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="menu.py" line="424"/>
<source>Save unsent messages only</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>tray</name> <name>tray</name>
<message> <message>
<location filename="main.py" line="173"/> <location filename="main.py" line="172"/>
<source>Open Toxygen</source> <source>Open Toxygen</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="main.py" line="182"/> <location filename="main.py" line="181"/>
<source>Exit</source> <source>Exit</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="main.py" line="174"/> <location filename="main.py" line="173"/>
<source>Set status</source> <source>Set status</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="main.py" line="175"/> <location filename="main.py" line="174"/>
<source>Online</source> <source>Online</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="main.py" line="176"/> <location filename="main.py" line="175"/>
<source>Away</source> <source>Away</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="main.py" line="177"/> <location filename="main.py" line="176"/>
<source>Busy</source> <source>Busy</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>

View File

@ -26,7 +26,7 @@
<context> <context>
<name>Callback</name> <name>Callback</name>
<message> <message>
<location filename="callbacks.py" line="182"/> <location filename="callbacks.py" line="183"/>
<source>File from</source> <source>File from</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -129,13 +129,13 @@ can produce IP leak</source>
<translation>À propos du programme</translation> <translation>À propos du programme</translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="725"/> <location filename="profile.py" line="743"/>
<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="727"/> <location filename="profile.py" line="745"/>
<source>Friend request</source> <source>Friend request</source>
<translation>Demande d&apos;amis</translation> <translation>Demande d&apos;amis</translation>
</message> </message>
@ -180,7 +180,7 @@ can produce IP leak</source>
<translation>Retirer un ami</translation> <translation>Retirer un ami</translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="565"/> <location filename="profile.py" line="582"/>
<source>Enter new alias for friend {} or leave empty to use friend&apos;s name:</source> <source>Enter new alias for friend {} or leave empty to use friend&apos;s name:</source>
<translation>Entrez un nouvel alias pour l&apos;ami {} ou laissez vide pour garder son nom de base :</translation> <translation>Entrez un nouvel alias pour l&apos;ami {} ou laissez vide pour garder son nom de base :</translation>
</message> </message>
@ -195,7 +195,7 @@ can produce IP leak</source>
<translation type="obsolete">Trouver le contact</translation> <translation type="obsolete">Trouver le contact</translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="697"/> <location filename="profile.py" line="715"/>
<source>Friend added</source> <source>Friend added</source>
<translation>Ami rajouté</translation> <translation>Ami rajouté</translation>
</message> </message>
@ -207,12 +207,12 @@ Version: </source>
Version :</translation> Version :</translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="698"/> <location filename="profile.py" line="716"/>
<source>Friend added without sending friend request</source> <source>Friend added without sending friend request</source>
<translation>Ami rajouté sans avoir envoyé de demande</translation> <translation>Ami rajouté sans avoir envoyé de demande</translation>
</message> </message>
<message> <message>
<location filename="list_items.py" line="464"/> <location filename="list_items.py" line="484"/>
<source>Choose folder</source> <source>Choose folder</source>
<translation>Choisir le dossier</translation> <translation>Choisir le dossier</translation>
</message> </message>
@ -272,55 +272,60 @@ Version :</translation>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="widgets.py" line="84"/> <location filename="widgets.py" line="83"/>
<source>Copy link location</source> <source>Copy link location</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="widgets.py" line="87"/> <location filename="widgets.py" line="86"/>
<source>Copy</source> <source>Copy</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="widgets.py" line="90"/> <location filename="widgets.py" line="89"/>
<source>Select all</source> <source>Select all</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="widgets.py" line="93"/> <location filename="widgets.py" line="92"/>
<source>Delete</source> <source>Delete</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="widgets.py" line="96"/> <location filename="widgets.py" line="95"/>
<source>Paste</source> <source>Paste</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="widgets.py" line="99"/> <location filename="widgets.py" line="98"/>
<source>Cut</source> <source>Cut</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="widgets.py" line="102"/> <location filename="widgets.py" line="101"/>
<source>Undo</source> <source>Undo</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="widgets.py" line="105"/> <location filename="widgets.py" line="104"/>
<source>Redo</source> <source>Redo</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="widgets.py" line="126"/> <location filename="widgets.py" line="125"/>
<source>Save</source> <source>Save</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="250"/> <location filename="profile.py" line="254"/>
<source>User {} is now known as {}</source> <source>User {} is now known as {}</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="list_items.py" line="145"/>
<source>Delete message</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MenuWindow</name> <name>MenuWindow</name>
@ -340,32 +345,32 @@ Version :</translation>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="mainscreen_widgets.py" line="247"/> <location filename="mainscreen_widgets.py" line="248"/>
<source>Send screenshot</source> <source>Send screenshot</source>
<translation type="unfinished">Envoyer une capture d&apos;écran</translation> <translation type="unfinished">Envoyer une capture d&apos;écran</translation>
</message> </message>
<message> <message>
<location filename="mainscreen_widgets.py" line="248"/> <location filename="mainscreen_widgets.py" line="249"/>
<source>Send file</source> <source>Send file</source>
<translation type="unfinished">Envoyer le fichier</translation> <translation type="unfinished">Envoyer le fichier</translation>
</message> </message>
<message> <message>
<location filename="mainscreen_widgets.py" line="249"/> <location filename="mainscreen_widgets.py" line="250"/>
<source>Send audio message</source> <source>Send audio message</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="mainscreen_widgets.py" line="250"/> <location filename="mainscreen_widgets.py" line="251"/>
<source>Send video message</source> <source>Send video message</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="mainscreen_widgets.py" line="251"/> <location filename="mainscreen_widgets.py" line="252"/>
<source>Add smiley</source> <source>Add smiley</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="mainscreen_widgets.py" line="252"/> <location filename="mainscreen_widgets.py" line="253"/>
<source>Send sticker</source> <source>Send sticker</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -386,12 +391,12 @@ Version :</translation>
<context> <context>
<name>PluginWindow</name> <name>PluginWindow</name>
<message> <message>
<location filename="plugins/plugin_super_class.py" line="130"/> <location filename="plugins/plugin_super_class.py" line="132"/>
<source>List of commands for plugin {}</source> <source>List of commands for plugin {}</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="plugins/plugin_super_class.py" line="131"/> <location filename="plugins/plugin_super_class.py" line="133"/>
<source>No commands available</source> <source>No commands available</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -399,42 +404,42 @@ Version :</translation>
<context> <context>
<name>PluginsForm</name> <name>PluginsForm</name>
<message> <message>
<location filename="menu.py" line="697"/> <location filename="menu.py" line="737"/>
<source>Plugins</source> <source>Plugins</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="698"/> <location filename="menu.py" line="738"/>
<source>Open selected plugin</source> <source>Open selected plugin</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="711"/> <location filename="menu.py" line="751"/>
<source>No GUI found for this plugin</source> <source>No GUI found for this plugin</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="727"/> <location filename="menu.py" line="767"/>
<source>No description available</source> <source>No description available</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="743"/> <location filename="menu.py" line="783"/>
<source>Disable plugin</source> <source>Disable plugin</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="745"/> <location filename="menu.py" line="785"/>
<source>Enable plugin</source> <source>Enable plugin</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="735"/> <location filename="menu.py" line="775"/>
<source>No plugins found</source> <source>No plugins found</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="712"/> <location filename="menu.py" line="752"/>
<source>Error</source> <source>Error</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -560,17 +565,17 @@ Version :</translation>
<context> <context>
<name>audioSettingsForm</name> <name>audioSettingsForm</name>
<message> <message>
<location filename="menu.py" line="654"/> <location filename="menu.py" line="694"/>
<source>Audio settings</source> <source>Audio settings</source>
<translation>Paramètres audio</translation> <translation>Paramètres audio</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="655"/> <location filename="menu.py" line="695"/>
<source>Input device:</source> <source>Input device:</source>
<translation>Péripherique d&apos;entrée :</translation> <translation>Péripherique d&apos;entrée :</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="656"/> <location filename="menu.py" line="696"/>
<source>Output device:</source> <source>Output device:</source>
<translation>Péripherique de sortie :</translation> <translation>Péripherique de sortie :</translation>
</message> </message>
@ -578,32 +583,32 @@ Version :</translation>
<context> <context>
<name>incoming_call</name> <name>incoming_call</name>
<message> <message>
<location filename="profile.py" line="1098"/> <location filename="profile.py" line="1120"/>
<source>Incoming video call</source> <source>Incoming video call</source>
<translation>Appel vidéo entrant</translation> <translation>Appel vidéo entrant</translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="1101"/> <location filename="profile.py" line="1123"/>
<source>Incoming audio call</source> <source>Incoming audio call</source>
<translation>Appel audio entrant</translation> <translation>Appel audio entrant</translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="1081"/> <location filename="profile.py" line="1103"/>
<source>Outgoing video call</source> <source>Outgoing video call</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="1084"/> <location filename="profile.py" line="1106"/>
<source>Outgoing audio call</source> <source>Outgoing audio call</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="1130"/> <location filename="profile.py" line="1152"/>
<source>Call declined</source> <source>Call declined</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="1132"/> <location filename="profile.py" line="1154"/>
<source>Call finished</source> <source>Call finished</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -611,50 +616,55 @@ Version :</translation>
<context> <context>
<name>interfaceForm</name> <name>interfaceForm</name>
<message> <message>
<location filename="menu.py" line="572"/> <location filename="menu.py" line="602"/>
<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="573"/> <location filename="menu.py" line="603"/>
<source>Theme:</source> <source>Theme:</source>
<translation>Thème :</translation> <translation>Thème :</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="574"/> <location filename="menu.py" line="604"/>
<source>Language:</source> <source>Language:</source>
<translation>Langue :</translation> <translation>Langue :</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="575"/> <location filename="menu.py" line="605"/>
<source>Smileys</source> <source>Smileys</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="576"/> <location filename="menu.py" line="606"/>
<source>Smiley pack:</source> <source>Smiley pack:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="577"/> <location filename="menu.py" line="607"/>
<source>Mirror mode</source> <source>Mirror mode</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="578"/> <location filename="menu.py" line="608"/>
<source>Messages font size:</source> <source>Messages font size:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="589"/> <location filename="menu.py" line="629"/>
<source>Restart app to apply settings</source> <source>Restart app to apply settings</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="590"/> <location filename="menu.py" line="630"/>
<source>Restart required</source> <source>Restart required</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="menu.py" line="609"/>
<source>Select unread messages notification color</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>login</name> <name>login</name>
@ -699,7 +709,7 @@ Version :</translation>
<translation>toxygen</translation> <translation>toxygen</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="125"/> <location filename="main.py" line="124"/>
<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>
@ -712,22 +722,22 @@ Version :</translation>
<context> <context>
<name>notificationsForm</name> <name>notificationsForm</name>
<message> <message>
<location filename="menu.py" line="489"/> <location filename="menu.py" line="517"/>
<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="490"/> <location filename="menu.py" line="518"/>
<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="491"/> <location filename="menu.py" line="519"/>
<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="492"/> <location filename="menu.py" line="520"/>
<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>
@ -735,72 +745,72 @@ Version :</translation>
<context> <context>
<name>privacySettings</name> <name>privacySettings</name>
<message> <message>
<location filename="menu.py" line="407"/> <location filename="menu.py" line="413"/>
<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="408"/> <location filename="menu.py" line="414"/>
<source>Save chat history</source> <source>Save chat history</source>
<translation>Sauvegarder l&apos;historique de chat</translation> <translation>Sauvegarder l&apos;historique de chat</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="409"/> <location filename="menu.py" line="415"/>
<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="410"/> <location filename="menu.py" line="416"/>
<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="411"/> <location filename="menu.py" line="417"/>
<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="412"/> <location filename="menu.py" line="418"/>
<source>Change</source> <source>Change</source>
<translation>Modifier</translation> <translation>Modifier</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="413"/> <location filename="menu.py" line="419"/>
<source>Allow inlines</source> <source>Allow inlines</source>
<translation>Activer l&apos;auto-réception</translation> <translation>Activer l&apos;auto-réception</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="436"/> <location filename="menu.py" line="464"/>
<source>Chat history</source> <source>Chat history</source>
<translation>Historique de chat</translation> <translation>Historique de chat</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="439"/> <location filename="menu.py" line="467"/>
<source>History will be cleaned! Continue?</source> <source>History will be cleaned! Continue?</source>
<translation>L&apos;Historique va être nettoyé ! Confirmer ?</translation> <translation>L&apos;Historique va être nettoyé ! Confirmer ?</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="415"/> <location filename="menu.py" line="421"/>
<source>Blocked users:</source> <source>Blocked users:</source>
<translation>Utilisateurs bloqués :</translation> <translation>Utilisateurs bloqués :</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="416"/> <location filename="menu.py" line="422"/>
<source>Unblock</source> <source>Unblock</source>
<translation>Débloquer</translation> <translation>Débloquer</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="417"/> <location filename="menu.py" line="423"/>
<source>Block user</source> <source>Block user</source>
<translation>Bloquer l&apos;utilisateur</translation> <translation>Bloquer l&apos;utilisateur</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="423"/> <location filename="menu.py" line="435"/>
<source>Add to friend list</source> <source>Add to friend list</source>
<translation>Ajouter à la liste des amis</translation> <translation>Ajouter à la liste des amis</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="424"/> <location filename="menu.py" line="436"/>
<source>Do you want to add this user to friend list?</source> <source>Do you want to add this user to friend list?</source>
<translation>Voulez vous rajouter cet utilisateur à votre liste d&apos;amis ?</translation> <translation>Voulez vous rajouter cet utilisateur à votre liste d&apos;amis ?</translation>
</message> </message>
@ -810,40 +820,45 @@ Version :</translation>
<translation type="obsolete">Bloquer l&apos;ID TOX :</translation> <translation type="obsolete">Bloquer l&apos;ID TOX :</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="414"/> <location filename="menu.py" line="420"/>
<source>Block by public key:</source> <source>Block by public key:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="menu.py" line="424"/>
<source>Save unsent messages only</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>tray</name> <name>tray</name>
<message> <message>
<location filename="main.py" line="173"/> <location filename="main.py" line="172"/>
<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="182"/> <location filename="main.py" line="181"/>
<source>Exit</source> <source>Exit</source>
<translation>Quitter</translation> <translation>Quitter</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="174"/> <location filename="main.py" line="173"/>
<source>Set status</source> <source>Set status</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="main.py" line="175"/> <location filename="main.py" line="174"/>
<source>Online</source> <source>Online</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="main.py" line="176"/> <location filename="main.py" line="175"/>
<source>Away</source> <source>Away</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="main.py" line="177"/> <location filename="main.py" line="176"/>
<source>Busy</source> <source>Busy</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>

Binary file not shown.

View File

@ -27,7 +27,7 @@
<context> <context>
<name>Callback</name> <name>Callback</name>
<message> <message>
<location filename="callbacks.py" line="182"/> <location filename="callbacks.py" line="183"/>
<source>File from</source> <source>File from</source>
<translation>Файл от</translation> <translation>Файл от</translation>
</message> </message>
@ -132,14 +132,14 @@ can produce IP leak</source>
<translation>О программе</translation> <translation>О программе</translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="725"/> <location filename="profile.py" line="743"/>
<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="727"/> <location filename="profile.py" line="745"/>
<source>Friend request</source> <source>Friend request</source>
<translation>Запрос на добавление в друзья</translation> <translation>Запрос на добавление в друзья</translation>
</message> </message>
@ -179,7 +179,7 @@ can produce IP leak</source>
<translation>Удалить друга</translation> <translation>Удалить друга</translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="565"/> <location filename="profile.py" line="582"/>
<source>Enter new alias for friend {} or leave empty to use friend&apos;s name:</source> <source>Enter new alias for friend {} or leave empty to use friend&apos;s name:</source>
<translation>Введите новый псевдоним для друга {} или оставьте пустым для использования его имени:</translation> <translation>Введите новый псевдоним для друга {} или оставьте пустым для использования его имени:</translation>
</message> </message>
@ -194,7 +194,7 @@ can produce IP leak</source>
<translation type="obsolete">Найти контакт</translation> <translation type="obsolete">Найти контакт</translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="697"/> <location filename="profile.py" line="715"/>
<source>Friend added</source> <source>Friend added</source>
<translation>Друг добавлен</translation> <translation>Друг добавлен</translation>
</message> </message>
@ -205,12 +205,12 @@ Version: </source>
<translation>Toxygen - клиент для мессенджера Tox, написанный на Python. Версия: </translation> <translation>Toxygen - клиент для мессенджера Tox, написанный на Python. Версия: </translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="698"/> <location filename="profile.py" line="716"/>
<source>Friend added without sending friend request</source> <source>Friend added without sending friend request</source>
<translation>Друг добавлен без отправки запроса на добавление в друзья</translation> <translation>Друг добавлен без отправки запроса на добавление в друзья</translation>
</message> </message>
<message> <message>
<location filename="list_items.py" line="464"/> <location filename="list_items.py" line="484"/>
<source>Choose folder</source> <source>Choose folder</source>
<translation>Выбрать папку</translation> <translation>Выбрать папку</translation>
</message> </message>
@ -270,55 +270,60 @@ Version: </source>
<translation>Заметки о пользователе</translation> <translation>Заметки о пользователе</translation>
</message> </message>
<message> <message>
<location filename="widgets.py" line="84"/> <location filename="widgets.py" line="83"/>
<source>Copy link location</source> <source>Copy link location</source>
<translation>Копировать адрес ссылки</translation> <translation>Копировать адрес ссылки</translation>
</message> </message>
<message> <message>
<location filename="widgets.py" line="87"/> <location filename="widgets.py" line="86"/>
<source>Copy</source> <source>Copy</source>
<translation>Копировать</translation> <translation>Копировать</translation>
</message> </message>
<message> <message>
<location filename="widgets.py" line="90"/> <location filename="widgets.py" line="89"/>
<source>Select all</source> <source>Select all</source>
<translation>Выделить всё</translation> <translation>Выделить всё</translation>
</message> </message>
<message> <message>
<location filename="widgets.py" line="93"/> <location filename="widgets.py" line="92"/>
<source>Delete</source> <source>Delete</source>
<translation>Удалить</translation> <translation>Удалить</translation>
</message> </message>
<message> <message>
<location filename="widgets.py" line="96"/> <location filename="widgets.py" line="95"/>
<source>Paste</source> <source>Paste</source>
<translation>Вставить</translation> <translation>Вставить</translation>
</message> </message>
<message> <message>
<location filename="widgets.py" line="99"/> <location filename="widgets.py" line="98"/>
<source>Cut</source> <source>Cut</source>
<translation>Вырезать</translation> <translation>Вырезать</translation>
</message> </message>
<message> <message>
<location filename="widgets.py" line="102"/> <location filename="widgets.py" line="101"/>
<source>Undo</source> <source>Undo</source>
<translation>Отменить</translation> <translation>Отменить</translation>
</message> </message>
<message> <message>
<location filename="widgets.py" line="105"/> <location filename="widgets.py" line="104"/>
<source>Redo</source> <source>Redo</source>
<translation>Повторить</translation> <translation>Повторить</translation>
</message> </message>
<message> <message>
<location filename="widgets.py" line="126"/> <location filename="widgets.py" line="125"/>
<source>Save</source> <source>Save</source>
<translation>Сохранить</translation> <translation>Сохранить</translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="250"/> <location filename="profile.py" line="254"/>
<source>User {} is now known as {}</source> <source>User {} is now known as {}</source>
<translation>Пользователь {} сейчас известен как {}</translation> <translation>Пользователь {} сейчас известен как {}</translation>
</message> </message>
<message>
<location filename="list_items.py" line="145"/>
<source>Delete message</source>
<translation>Удалить сообщение</translation>
</message>
</context> </context>
<context> <context>
<name>MenuWindow</name> <name>MenuWindow</name>
@ -338,32 +343,32 @@ Version: </source>
<translation>Остановить запись</translation> <translation>Остановить запись</translation>
</message> </message>
<message> <message>
<location filename="mainscreen_widgets.py" line="247"/> <location filename="mainscreen_widgets.py" line="248"/>
<source>Send screenshot</source> <source>Send screenshot</source>
<translation>Отправить снимок экрана</translation> <translation>Отправить снимок экрана</translation>
</message> </message>
<message> <message>
<location filename="mainscreen_widgets.py" line="248"/> <location filename="mainscreen_widgets.py" line="249"/>
<source>Send file</source> <source>Send file</source>
<translation>Отправить файл</translation> <translation>Отправить файл</translation>
</message> </message>
<message> <message>
<location filename="mainscreen_widgets.py" line="249"/> <location filename="mainscreen_widgets.py" line="250"/>
<source>Send audio message</source> <source>Send audio message</source>
<translation>Отправить аудиосообщение</translation> <translation>Отправить аудиосообщение</translation>
</message> </message>
<message> <message>
<location filename="mainscreen_widgets.py" line="250"/> <location filename="mainscreen_widgets.py" line="251"/>
<source>Send video message</source> <source>Send video message</source>
<translation>Отправить видеосообщение</translation> <translation>Отправить видеосообщение</translation>
</message> </message>
<message> <message>
<location filename="mainscreen_widgets.py" line="251"/> <location filename="mainscreen_widgets.py" line="252"/>
<source>Add smiley</source> <source>Add smiley</source>
<translation>Добавить смайлик</translation> <translation>Добавить смайлик</translation>
</message> </message>
<message> <message>
<location filename="mainscreen_widgets.py" line="252"/> <location filename="mainscreen_widgets.py" line="253"/>
<source>Send sticker</source> <source>Send sticker</source>
<translation>Отправить стикер</translation> <translation>Отправить стикер</translation>
</message> </message>
@ -384,12 +389,12 @@ Version: </source>
<context> <context>
<name>PluginWindow</name> <name>PluginWindow</name>
<message> <message>
<location filename="plugins/plugin_super_class.py" line="130"/> <location filename="plugins/plugin_super_class.py" line="132"/>
<source>List of commands for plugin {}</source> <source>List of commands for plugin {}</source>
<translation>Список команд для плагина {}</translation> <translation>Список команд для плагина {}</translation>
</message> </message>
<message> <message>
<location filename="plugins/plugin_super_class.py" line="131"/> <location filename="plugins/plugin_super_class.py" line="133"/>
<source>No commands available</source> <source>No commands available</source>
<translation>Команды не найдены</translation> <translation>Команды не найдены</translation>
</message> </message>
@ -397,42 +402,42 @@ Version: </source>
<context> <context>
<name>PluginsForm</name> <name>PluginsForm</name>
<message> <message>
<location filename="menu.py" line="697"/> <location filename="menu.py" line="737"/>
<source>Plugins</source> <source>Plugins</source>
<translation>Плагины</translation> <translation>Плагины</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="698"/> <location filename="menu.py" line="738"/>
<source>Open selected plugin</source> <source>Open selected plugin</source>
<translation>Открыть выбранный плагин</translation> <translation>Открыть выбранный плагин</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="711"/> <location filename="menu.py" line="751"/>
<source>No GUI found for this plugin</source> <source>No GUI found for this plugin</source>
<translation>GUI для данного плагина не найден</translation> <translation>GUI для данного плагина не найден</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="727"/> <location filename="menu.py" line="767"/>
<source>No description available</source> <source>No description available</source>
<translation>Описание недоступно</translation> <translation>Описание недоступно</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="743"/> <location filename="menu.py" line="783"/>
<source>Disable plugin</source> <source>Disable plugin</source>
<translation>Отключить плагин</translation> <translation>Отключить плагин</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="745"/> <location filename="menu.py" line="785"/>
<source>Enable plugin</source> <source>Enable plugin</source>
<translation>Включить плагин</translation> <translation>Включить плагин</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="735"/> <location filename="menu.py" line="775"/>
<source>No plugins found</source> <source>No plugins found</source>
<translation>Плагины не найдены</translation> <translation>Плагины не найдены</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="712"/> <location filename="menu.py" line="752"/>
<source>Error</source> <source>Error</source>
<translation>Ошибка</translation> <translation>Ошибка</translation>
</message> </message>
@ -563,17 +568,17 @@ Version: </source>
<context> <context>
<name>audioSettingsForm</name> <name>audioSettingsForm</name>
<message> <message>
<location filename="menu.py" line="654"/> <location filename="menu.py" line="694"/>
<source>Audio settings</source> <source>Audio settings</source>
<translation>Настройки аудио</translation> <translation>Настройки аудио</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="655"/> <location filename="menu.py" line="695"/>
<source>Input device:</source> <source>Input device:</source>
<translation>Устройство ввода:</translation> <translation>Устройство ввода:</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="656"/> <location filename="menu.py" line="696"/>
<source>Output device:</source> <source>Output device:</source>
<translation>Устройство вывода:</translation> <translation>Устройство вывода:</translation>
</message> </message>
@ -581,32 +586,32 @@ Version: </source>
<context> <context>
<name>incoming_call</name> <name>incoming_call</name>
<message> <message>
<location filename="profile.py" line="1098"/> <location filename="profile.py" line="1120"/>
<source>Incoming video call</source> <source>Incoming video call</source>
<translation>Входящий видеозвонок</translation> <translation>Входящий видеозвонок</translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="1101"/> <location filename="profile.py" line="1123"/>
<source>Incoming audio call</source> <source>Incoming audio call</source>
<translation>Входящий аудиозвонок</translation> <translation>Входящий аудиозвонок</translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="1081"/> <location filename="profile.py" line="1103"/>
<source>Outgoing video call</source> <source>Outgoing video call</source>
<translation>Исходящий видеозвонок</translation> <translation>Исходящий видеозвонок</translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="1084"/> <location filename="profile.py" line="1106"/>
<source>Outgoing audio call</source> <source>Outgoing audio call</source>
<translation>Исходящий аудиозвонок</translation> <translation>Исходящий аудиозвонок</translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="1130"/> <location filename="profile.py" line="1152"/>
<source>Call declined</source> <source>Call declined</source>
<translation>Звонок отменен</translation> <translation>Звонок отменен</translation>
</message> </message>
<message> <message>
<location filename="profile.py" line="1132"/> <location filename="profile.py" line="1154"/>
<source>Call finished</source> <source>Call finished</source>
<translation>Звонок завершен</translation> <translation>Звонок завершен</translation>
</message> </message>
@ -614,50 +619,55 @@ Version: </source>
<context> <context>
<name>interfaceForm</name> <name>interfaceForm</name>
<message> <message>
<location filename="menu.py" line="572"/> <location filename="menu.py" line="602"/>
<source>Interface settings</source> <source>Interface settings</source>
<translation>Настройки интерфейса</translation> <translation>Настройки интерфейса</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="573"/> <location filename="menu.py" line="603"/>
<source>Theme:</source> <source>Theme:</source>
<translation>Тема:</translation> <translation>Тема:</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="574"/> <location filename="menu.py" line="604"/>
<source>Language:</source> <source>Language:</source>
<translation>Язык:</translation> <translation>Язык:</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="575"/> <location filename="menu.py" line="605"/>
<source>Smileys</source> <source>Smileys</source>
<translation>Смайлики</translation> <translation>Смайлики</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="576"/> <location filename="menu.py" line="606"/>
<source>Smiley pack:</source> <source>Smiley pack:</source>
<translation>Набор смайликов</translation> <translation>Набор смайликов</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="577"/> <location filename="menu.py" line="607"/>
<source>Mirror mode</source> <source>Mirror mode</source>
<translation>Зеркальный режим</translation> <translation>Зеркальный режим</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="578"/> <location filename="menu.py" line="608"/>
<source>Messages font size:</source> <source>Messages font size:</source>
<translation>Размер шрифта сообщений:</translation> <translation>Размер шрифта сообщений:</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="589"/> <location filename="menu.py" line="629"/>
<source>Restart app to apply settings</source> <source>Restart app to apply settings</source>
<translation>Для применения настроек необходимо перезапустить приложение</translation> <translation>Для применения настроек необходимо перезапустить приложение</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="590"/> <location filename="menu.py" line="630"/>
<source>Restart required</source> <source>Restart required</source>
<translation>Требуется перезапуск</translation> <translation>Требуется перезапуск</translation>
</message> </message>
<message>
<location filename="menu.py" line="609"/>
<source>Select unread messages notification color</source>
<translation>Цвет уведомления о сообщении</translation>
</message>
</context> </context>
<context> <context>
<name>login</name> <name>login</name>
@ -702,7 +712,7 @@ Version: </source>
<translation>toxygen</translation> <translation>toxygen</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="125"/> <location filename="main.py" line="124"/>
<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>Похоже, что этот профиль используется другим экземпляром Toxygen! Продолжить?</translation> <translation>Похоже, что этот профиль используется другим экземпляром Toxygen! Продолжить?</translation>
</message> </message>
@ -715,22 +725,22 @@ Version: </source>
<context> <context>
<name>notificationsForm</name> <name>notificationsForm</name>
<message> <message>
<location filename="menu.py" line="489"/> <location filename="menu.py" line="517"/>
<source>Notification settings</source> <source>Notification settings</source>
<translation>Настройки уведомлений</translation> <translation>Настройки уведомлений</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="490"/> <location filename="menu.py" line="518"/>
<source>Enable notifications</source> <source>Enable notifications</source>
<translation>Включить уведомления</translation> <translation>Включить уведомления</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="491"/> <location filename="menu.py" line="519"/>
<source>Enable call&apos;s sound</source> <source>Enable call&apos;s sound</source>
<translation>Включить звук звонка</translation> <translation>Включить звук звонка</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="492"/> <location filename="menu.py" line="520"/>
<source>Enable sound notifications</source> <source>Enable sound notifications</source>
<translation>Включить звуковые уведомления <translation>Включить звуковые уведомления
</translation> </translation>
@ -739,72 +749,72 @@ Version: </source>
<context> <context>
<name>privacySettings</name> <name>privacySettings</name>
<message> <message>
<location filename="menu.py" line="407"/> <location filename="menu.py" line="413"/>
<source>Privacy settings</source> <source>Privacy settings</source>
<translation>Настройки приватности</translation> <translation>Настройки приватности</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="408"/> <location filename="menu.py" line="414"/>
<source>Save chat history</source> <source>Save chat history</source>
<translation>Сохранять историю переписки</translation> <translation>Сохранять историю переписки</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="409"/> <location filename="menu.py" line="415"/>
<source>Allow file auto accept</source> <source>Allow file auto accept</source>
<translation>Разрешить автополучение файлов</translation> <translation>Разрешить автополучение файлов</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="410"/> <location filename="menu.py" line="416"/>
<source>Send typing notifications</source> <source>Send typing notifications</source>
<translation>Посылать уведомления о наборе текста</translation> <translation>Посылать уведомления о наборе текста</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="411"/> <location filename="menu.py" line="417"/>
<source>Auto accept default path:</source> <source>Auto accept default path:</source>
<translation>Путь автоприема файлов:</translation> <translation>Путь автоприема файлов:</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="412"/> <location filename="menu.py" line="418"/>
<source>Change</source> <source>Change</source>
<translation>Изменить</translation> <translation>Изменить</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="413"/> <location filename="menu.py" line="419"/>
<source>Allow inlines</source> <source>Allow inlines</source>
<translation>Разрешать инлайны</translation> <translation>Разрешать инлайны</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="436"/> <location filename="menu.py" line="464"/>
<source>Chat history</source> <source>Chat history</source>
<translation>История чата</translation> <translation>История чата</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="439"/> <location filename="menu.py" line="467"/>
<source>History will be cleaned! Continue?</source> <source>History will be cleaned! Continue?</source>
<translation>История переписки будет очищена! Продолжить?</translation> <translation>История переписки будет очищена! Продолжить?</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="415"/> <location filename="menu.py" line="421"/>
<source>Blocked users:</source> <source>Blocked users:</source>
<translation>Заблокированные пользователи:</translation> <translation>Заблокированные пользователи:</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="416"/> <location filename="menu.py" line="422"/>
<source>Unblock</source> <source>Unblock</source>
<translation>Разблокировать</translation> <translation>Разблокировать</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="417"/> <location filename="menu.py" line="423"/>
<source>Block user</source> <source>Block user</source>
<translation>Заблокировать пользователя</translation> <translation>Заблокировать пользователя</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="423"/> <location filename="menu.py" line="435"/>
<source>Add to friend list</source> <source>Add to friend list</source>
<translation>Добавить в список друзей</translation> <translation>Добавить в список друзей</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="424"/> <location filename="menu.py" line="436"/>
<source>Do you want to add this user to friend list?</source> <source>Do you want to add this user to friend list?</source>
<translation>Добавить этого пользователя в список друзей?</translation> <translation>Добавить этого пользователя в список друзей?</translation>
</message> </message>
@ -814,40 +824,45 @@ Version: </source>
<translation type="obsolete">Блокировать по TOX ID:</translation> <translation type="obsolete">Блокировать по TOX ID:</translation>
</message> </message>
<message> <message>
<location filename="menu.py" line="414"/> <location filename="menu.py" line="420"/>
<source>Block by public key:</source> <source>Block by public key:</source>
<translation>Блокировать по публичному ключу</translation> <translation>Блокировать по публичному ключу</translation>
</message> </message>
<message>
<location filename="menu.py" line="424"/>
<source>Save unsent messages only</source>
<translation>Сохранять только неотправленные сообщения</translation>
</message>
</context> </context>
<context> <context>
<name>tray</name> <name>tray</name>
<message> <message>
<location filename="main.py" line="173"/> <location filename="main.py" line="172"/>
<source>Open Toxygen</source> <source>Open Toxygen</source>
<translation>Открыть Toxygen</translation> <translation>Открыть Toxygen</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="182"/> <location filename="main.py" line="181"/>
<source>Exit</source> <source>Exit</source>
<translation>Выход</translation> <translation>Выход</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="174"/> <location filename="main.py" line="173"/>
<source>Set status</source> <source>Set status</source>
<translation>Изменить статус</translation> <translation>Изменить статус</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="175"/> <location filename="main.py" line="174"/>
<source>Online</source> <source>Online</source>
<translation>Онлайн</translation> <translation>Онлайн</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="176"/> <location filename="main.py" line="175"/>
<source>Away</source> <source>Away</source>
<translation>Нет на месте</translation> <translation>Нет на месте</translation>
</message> </message>
<message> <message>
<location filename="main.py" line="177"/> <location filename="main.py" line="176"/>
<source>Busy</source> <source>Busy</source>
<translation>Занят</translation> <translation>Занят</translation>
</message> </message>

View File

@ -26,12 +26,11 @@ def convert_time(t):
return '%02d:%02d' % (h, m) return '%02d:%02d' % (h, m)
class Singleton(object): class Singleton:
_instance = None
def __new__(cls, *args, **kwargs): def __init__(self):
if not hasattr(cls, '_instance'): self.__class__._instance = self
cls._instance = super(Singleton, cls).__new__(cls, *args, **kwargs)
return cls._instance
@classmethod @classmethod
def get_instance(cls): def get_instance(cls):

View File

@ -8,12 +8,11 @@ class DataLabel(QtGui.QLabel):
""" """
Label with elided text Label with elided text
""" """
def setText(self, text):
def paintEvent(self, event): text = ''.join(c if c <= '\u10FFFF' else '\u25AF' for c in text)
painter = QtGui.QPainter(self)
metrics = QtGui.QFontMetrics(self.font()) metrics = QtGui.QFontMetrics(self.font())
text = metrics.elidedText(self.text(), QtCore.Qt.ElideRight, self.width()) text = metrics.elidedText(text, QtCore.Qt.ElideRight, self.width())
painter.drawText(self.rect(), self.alignment(), text) super().setText(text)
class CenteredWidget(QtGui.QWidget): class CenteredWidget(QtGui.QWidget):