From 19fb90555471e3dabb588cd24077020f3c660807 Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Thu, 6 Apr 2017 21:28:34 +0300 Subject: [PATCH] some fixes --- README.md | 6 +++--- docs/plugin_api.md | 6 +++--- docs/plugins.md | 14 +++++++------- toxygen/avwidgets.py | 1 + toxygen/basecontact.py | 4 ++++ toxygen/contact.py | 2 +- 6 files changed, 19 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index ff70b47..d2159e9 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Toxygen is powerful cross-platform [Tox](https://tox.chat/) client written in pu [![License](https://img.shields.io/badge/license-GPLv3-blue.svg?style=flat)](https://raw.githubusercontent.com/toxygen-project/toxygen/master/LICENSE.md) [![Build Status](https://travis-ci.org/toxygen-project/toxygen.svg?branch=master)](https://travis-ci.org/toxygen-project/toxygen) -### [Install](/docs/install.md) - [Contribute](/docs/contributing.md) - [Plugins](/docs/plugins.md) - [Compile](/docs/compile.md) - [Contact](/docs/contact.md) +### [Install](/docs/install.md) - [Contribute](/docs/contributing.md) - [Plugins](/docs/plugins.md) - [Compile](/docs/compile.md) - [Contact](/docs/contact.md) - [Updater](https://github.com/toxygen-project/toxygen_updater) ### Supported OS: @@ -18,7 +18,7 @@ Toxygen is powerful cross-platform [Tox](https://tox.chat/) client written in pu - [x] 1v1 messages - [x] File transfers -- [x] Audio +- [x] Audio calls - [x] Plugins support - [x] Chat history - [x] Emoticons @@ -42,7 +42,7 @@ Toxygen is powerful cross-platform [Tox](https://tox.chat/) client written in pu - [x] Changing nospam - [x] File resuming - [x] Read receipts -- [ ] Video +- [ ] Video calls - [ ] Desktop sharing - [ ] Group chats diff --git a/docs/plugin_api.md b/docs/plugin_api.md index 3c45b84..480cb33 100644 --- a/docs/plugin_api.md +++ b/docs/plugin_api.md @@ -1,4 +1,4 @@ -#Plugins API +# Plugins API 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. @@ -18,7 +18,7 @@ All plugin's data should be stored in following structure: ``` Plugin MUST override: -- __init__ with params: tox (Tox instance), profile (Profile instance), settings (Settings instance), encrypt_save (ToxEncryptSave instance). Call super().__init__ with params plugin_full_name, plugin_short_name, tox, profile, settings, encrypt_save. +- __init__ with params: tox (Tox instance), profile (Profile instance), settings (Settings instance), encrypt_save (ToxES instance). Call super().__init__ with params plugin_full_name, plugin_short_name, tox, profile, settings, encrypt_save. Plugin can override following methods: - get_description - this method should return plugin description. @@ -51,7 +51,7 @@ Exceptions: Plugin's methods MUST NOT raise exceptions. -#Examples +# Examples You can find examples in [official repo](https://github.com/toxygen-project/toxygen_plugins) diff --git a/docs/plugins.md b/docs/plugins.md index fee1fe4..ef6e5dd 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -1,21 +1,21 @@ -#Plugins +# Plugins 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 Check [Plugin API](/docs/plugin_api.md) for more info -#How to install plugin +# How to install plugin Toxygen comes without preinstalled plugins. -1. Put plugin and directory with its data into /src/plugins/ or import it via GUI (In menu: Plugins -> Import plugin) -2. Restart Toxygen +1. Put plugin and directory with its data into /src/plugins/ or import it via GUI (In menu: Plugins => Import plugin) +2. Restart Toxygen or choose Plugins => Reload plugins in menu. -##Note: /src/plugins/ should contain plugin_super_class.py and __init__.py +## 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! diff --git a/toxygen/avwidgets.py b/toxygen/avwidgets.py index 798911e..480fa28 100644 --- a/toxygen/avwidgets.py +++ b/toxygen/avwidgets.py @@ -63,6 +63,7 @@ class IncomingCallWidget(widgets.CenteredWidget): def __init__(self): QtCore.QThread.__init__(self) + self.a = None def run(self): class AudioFile: diff --git a/toxygen/basecontact.py b/toxygen/basecontact.py index 4657944..d6366c3 100644 --- a/toxygen/basecontact.py +++ b/toxygen/basecontact.py @@ -109,6 +109,10 @@ class BaseContact: def get_pixmap(self): return self._widget.avatar_label.pixmap() + # ----------------------------------------------------------------------------------------------------------------- + # Widgets + # ----------------------------------------------------------------------------------------------------------------- + def init_widget(self): if self._widget is not None: self._widget.name.setText(self._name) diff --git a/toxygen/contact.py b/toxygen/contact.py index 6f28164..1b69b9e 100644 --- a/toxygen/contact.py +++ b/toxygen/contact.py @@ -146,7 +146,7 @@ class Contact(basecontact.BaseContact): old = filter(save_message, self._corr[:-SAVE_MESSAGES]) self._corr = list(old) + self._corr[-SAVE_MESSAGES:] - text_messages = filter(lambda x: x.get_type <= 1, self._corr) + text_messages = filter(lambda x: x.get_type() <= 1, self._corr) self._unsaved_messages = min(self._unsaved_messages, len(list(text_messages))) self._search_index = 0