From 7cc404ce52cac52a071c8b7a146c01c4ecd92b70 Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Wed, 15 Mar 2017 23:17:38 +0300 Subject: [PATCH] plugins improvements --- toxygen/mainscreen.py | 21 ++++++-- toxygen/translations/en_GB.ts | 93 ++++++++++++++++++---------------- toxygen/translations/fr_FR.ts | 93 ++++++++++++++++++---------------- toxygen/translations/ru_RU.qm | Bin 24496 -> 24591 bytes toxygen/translations/ru_RU.ts | 93 ++++++++++++++++++---------------- 5 files changed, 164 insertions(+), 136 deletions(-) diff --git a/toxygen/mainscreen.py b/toxygen/mainscreen.py index 92733fd..f1648d3 100644 --- a/toxygen/mainscreen.py +++ b/toxygen/mainscreen.py @@ -65,6 +65,7 @@ class MainWindow(QtGui.QMainWindow, Singleton): self.audioSettings = QtGui.QAction(Form) self.pluginData = QtGui.QAction(Form) self.importPlugin = QtGui.QAction(Form) + self.reloadPlugins = QtGui.QAction(Form) self.lockApp = QtGui.QAction(Form) self.menuProfile.addAction(self.actionAdd_friend) self.menuProfile.addAction(self.actionSettings) @@ -77,6 +78,7 @@ class MainWindow(QtGui.QMainWindow, Singleton): self.menuSettings.addAction(self.updateSettings) self.menuPlugins.addAction(self.pluginData) self.menuPlugins.addAction(self.importPlugin) + self.menuPlugins.addAction(self.reloadPlugins) self.menuAbout.addAction(self.actionAbout_program) self.profile_button.setMenu(self.menuProfile) @@ -96,6 +98,7 @@ class MainWindow(QtGui.QMainWindow, Singleton): self.pluginData.triggered.connect(self.plugins_menu) self.lockApp.triggered.connect(self.lock_app) self.importPlugin.triggered.connect(self.import_plugin) + self.reloadPlugins.triggered.connect(self.reload_plugins) Form.setLayout(box) QtCore.QMetaObject.connectSlotsByName(Form) @@ -140,6 +143,7 @@ class MainWindow(QtGui.QMainWindow, Singleton): d = {0: 0, 1: 1, 2: 2, 3: 4, 1 | 4: 4, 2 | 4: 5} self.online_contacts.setCurrentIndex(d[ind]) self.importPlugin.setText(QtGui.QApplication.translate("MainWindow", "Import plugin", None, QtGui.QApplication.UnicodeUTF8)) + self.reloadPlugins.setText(QtGui.QApplication.translate("MainWindow", "Reload plugins", None, QtGui.QApplication.UnicodeUTF8)) def setup_right_bottom(self, Form): Form.resize(650, 60) @@ -460,6 +464,13 @@ class MainWindow(QtGui.QMainWindow, Singleton): self.update_s = UpdateSettings() self.update_s.show() + def reload_plugins(self): + plugin_loader = plugin_support.PluginLoader.get_instance() + if plugin_loader is None: + return + plugin_loader.stop() + plugin_loader.load() + def import_plugin(self): import util directory = QtGui.QFileDialog.getExistingDirectory(self, @@ -599,10 +610,12 @@ class MainWindow(QtGui.QMainWindow, Singleton): block_item = self.listMenu.addAction(QtGui.QApplication.translate("MainWindow", 'Block friend', None, QtGui.QApplication.UnicodeUTF8)) notes_item = self.listMenu.addAction(QtGui.QApplication.translate("MainWindow", 'Notes', None, QtGui.QApplication.UnicodeUTF8)) - submenu = plugin_support.PluginLoader.get_instance().get_menu(self.listMenu, num) - if len(submenu): - plug = self.listMenu.addMenu(QtGui.QApplication.translate("MainWindow", 'Plugins', None, QtGui.QApplication.UnicodeUTF8)) - plug.addActions(submenu) + plugins_loader = plugin_support.PluginLoader.get_instance() + if plugins_loader is not None: + submenu = plugins_loader.get_menu(self.listMenu, num) + if len(submenu): + plug = self.listMenu.addMenu(QtGui.QApplication.translate("MainWindow", 'Plugins', None, QtGui.QApplication.UnicodeUTF8)) + plug.addActions(submenu) self.connect(set_alias_item, QtCore.SIGNAL("triggered()"), lambda: self.set_alias(num)) self.connect(remove_item, QtCore.SIGNAL("triggered()"), lambda: self.remove_friend(num)) self.connect(block_item, QtCore.SIGNAL("triggered()"), lambda: self.block_friend(num)) diff --git a/toxygen/translations/en_GB.ts b/toxygen/translations/en_GB.ts index 6036f81..0a9871d 100644 --- a/toxygen/translations/en_GB.ts +++ b/toxygen/translations/en_GB.ts @@ -84,47 +84,47 @@ can produce IP leak MainWindow - + Profile - + Settings - + About - + Add contact - + Privacy - + Interface - + Notifications - + Network - + About program @@ -140,32 +140,32 @@ can produce IP leak - + Choose file Choose file - + Disallow auto accept - + Allow auto accept - + Set alias - + Clear history - + Remove friend @@ -175,7 +175,7 @@ can produce IP leak Enter new alias for friend {} or leave empty to use friend's name: - + Audio Audio @@ -190,7 +190,7 @@ can produce IP leak Friend added - + Toxygen is Tox client written on Python. Version: Toxygen is Tox client written on Python. @@ -202,7 +202,7 @@ Version: Friend added without sending friend request - + Choose folder Choose folder @@ -217,22 +217,22 @@ Version: Send file - + Send message Send message - + Start audio call with friend Start audio call with friend - + Plugins - + List of plugins @@ -242,22 +242,22 @@ Version: - + All - + Online - + Notes - + Notes about user @@ -317,32 +317,32 @@ Version: - + Lock - + Cannot lock app - + Error. Profile password is not set. - + Name - + Status message - + Public key @@ -367,22 +367,22 @@ Version: - + Import plugin - + Choose folder with plugin - + Restart Toxygen - + Plugin will be loaded after restart @@ -392,42 +392,42 @@ Version: - + Chat history - + Export as text - + Export as HTML - + Updates - + Online first - + Online and by name - + Online first and by name - + Block friend @@ -441,6 +441,11 @@ Version: Text "{}" was not found + + + Reload plugins + + MenuWindow diff --git a/toxygen/translations/fr_FR.ts b/toxygen/translations/fr_FR.ts index 0e87b51..16f37e7 100644 --- a/toxygen/translations/fr_FR.ts +++ b/toxygen/translations/fr_FR.ts @@ -84,47 +84,47 @@ can produce IP leak MainWindow - + Profile Profile - + Settings Paramêtres - + About À Propos - + Add contact Rajouter un contact - + Privacy Confidentialité - + Interface Interface - + Notifications Notifications - + Network Réseau - + About program À propos du programme @@ -145,27 +145,27 @@ can produce IP leak Toxygen est un client Tox écris en Python 2.7. Version : - + Choose file Choisir un fichier - + Disallow auto accept Désactiver l'auto-réception - + Allow auto accept Activer l'auto-réception - + Set alias Définir un alias - + Clear history Vider l'historique @@ -175,7 +175,7 @@ can produce IP leak Copier la clé publique - + Remove friend Retirer un ami @@ -185,7 +185,7 @@ can produce IP leak Entrez un nouvel alias pour l'ami {} ou laissez vide pour garder son nom de base : - + Audio Audio @@ -200,7 +200,7 @@ can produce IP leak Ami rajouté - + Toxygen is Tox client written on Python. Version: Toxygen est un client Tox écrit en Python. @@ -212,7 +212,7 @@ Version : Ami rajouté sans avoir envoyé de demande - + Choose folder Choisir le dossier @@ -227,22 +227,22 @@ Version : Envoyer le fichier - + Send message Envoyer le message - + Start audio call with friend Lancer un appel audio avec un ami - + Plugins - + List of plugins @@ -252,22 +252,22 @@ Version : - + All - + Online - + Notes - + Notes about user @@ -327,32 +327,32 @@ Version : - + Lock - + Cannot lock app - + Error. Profile password is not set. - + Name - + Status message - + Public key @@ -377,22 +377,22 @@ Version : - + Import plugin - + Choose folder with plugin - + Restart Toxygen - + Plugin will be loaded after restart @@ -402,42 +402,42 @@ Version : - + Chat history Historique de chat - + Export as text - + Export as HTML - + Updates - + Online first - + Online and by name - + Online first and by name - + Block friend @@ -451,6 +451,11 @@ Version : Text "{}" was not found + + + Reload plugins + + MenuWindow diff --git a/toxygen/translations/ru_RU.qm b/toxygen/translations/ru_RU.qm index ae4bf08a44a0c6c54bb3d8be60441a42d7212aa7..25507b2e47b2914bc7459f6e28e25b44990467c4 100644 GIT binary patch delta 1623 zcmX9;XH-)M7`;i}$a`7JiY#Rb1q3NWS%Qcl5U_{=1S?oY6k5x%Qi?^16}45Xf&s)$ z56)T~1uaz&Jh(kp0S9*AR*tw@6k8PR=gE(pd)`aV_ucP~9BP)VZ;_N*NQRYJy80&D zfLXf=aJg;5soh|{M(y0%!0E2U{w4ibZAPJE+r@RD|o1`trl8O3k=?z0G zU|%nN;gJTI@0Rv1i3D^8>EOCldT%d-)m>UtArm{^KhKf5=N6M*lVtI~(3KM-WYdaQ z0L~S%SlUQb%aO8frw!0p1@He67BlbWmnH#x=Jrmwb`i3uMyIM(T zR|Wg`+zP<4my_S4`y&cDO(*GVZpE3$2au5koX>M}V48|cX(Rep4&3y#*}#YZ6MA%U z^9o3Rs|DQra2G(6#}x(BqLA&}sxxLp{1(?(b{a_4bLXQife-F*SNL)8gl#H!wc#0% zlFxM}yae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k>GMA9$; zL=H);J$?jc*GrN6WVml?72Yv$-36fTkes{Sqxj4%mF#J_2 z2HXeqrld1wYJs3?Y0R+-ny;3|53L3AYz|2?_pSycLDIIwF+jOr+TN5v)RofPc^!b| zYUwlQB*5T=bo7&OAjVNT_2n|aqDuzj0l+mxCic?VQY~{z%LQzn$zp#XmEj|@<+%lP z4w0?daRhjKNLDZ!1uXTIbt{QL)Jxg38=Y7Q_jK8WG=z-Y!N?*5fVbA`&{@eWU6cXn z4=}0wh5+*{W<%RJ4X$7^&mRU%vzXl`Z-597ru^0cU~vF*Wamx7(F^Ow?32n zH#XxohS~y}bS^uPE((g|in^u|@j|YptP@C_ z7~qh@GgB0Z$3tHHhZqJP<@L;oKxA$Cd6|Q$mXGz9QB0luwvR`EMJar~A^Eq^rF>Fm zlJ_D1brmgvSt4I=a*TStgKtP{qcH9H>s!5v%m_bxk4VngrbD+?a>j+SwSFmAR__G- z6Xe_L25H(?^8G<1Ho8k*{o)>AQZLAoD~X$$I2`z$`1_Kw2T@8yW&3QgN3rWvuKM4~908r7y&jErGNf17cn2IPJ^r;xGFsGj)PEcshg1V(>`e?Lk{SbDkotl$O%kPLV!I=V)I=M#Ul^ zKwnYe`7dp6uMQXARUCUwuZB^f;+vPvM5J3$7qOm6)+W%46|HQRY@wE=D!V@=#le2cduF3F$X_}B zQ4O$MPsJUl_QeV+Tk#68z*gm6Ob=e%6_pSA0na~Gz8CIO0bF(HTB_1c+#sjiRI6^< zkkS&>;nd%$0As3)DelzvcU5-+&d`!as2*AP(EX13s>wZc0SeR>Rcq<}+NE|bp${zU z)E=hPB+pQF^u+(fo~z4iT7g-X>g(B5gt>Lv8xs8w@O7hyMr2 MainWindow - + Profile Профиль - + Settings Настройки - + About О программе - + Add contact Добавить контакт - + Privacy Приватность - + Interface Интерфейс - + Notifications Уведомления - + Network Сеть - + About program О программе @@ -144,27 +144,27 @@ can produce IP leak Запрос на добавление в друзья - + Choose file Выберите файл - + Disallow auto accept Запретить автоматическое получение файлов - + Allow auto accept Разрешить автоматическое получение файлов - + Set alias Изменить псевдоним - + Clear history Очистить историю @@ -174,7 +174,7 @@ can produce IP leak Копировать публичный ключ - + Remove friend Удалить друга @@ -184,7 +184,7 @@ can produce IP leak Введите новый псевдоним для друга {} или оставьте пустым для использования его имени: - + Audio Аудио @@ -199,7 +199,7 @@ can produce IP leak Друг добавлен - + Toxygen is Tox client written on Python. Version: Toxygen - клиент для мессенджера Tox, написанный на Python. Версия: @@ -210,7 +210,7 @@ Version: Друг добавлен без отправки запроса на добавление в друзья - + Choose folder Выбрать папку @@ -225,22 +225,22 @@ Version: Отправить файл - + Send message Отправить сообщение - + Start audio call with friend Начать аудиозвонок с другом - + Plugins Плагины - + List of plugins Список плагинов @@ -250,22 +250,22 @@ Version: Поиск - + All Все - + Online Онлайн - + Notes Заметки - + Notes about user Заметки о пользователе @@ -325,32 +325,32 @@ Version: Удалить сообщение - + Lock Заблокировать - + Cannot lock app Невозможно заблокировать приложение - + Error. Profile password is not set. Ошибка. Пароль профиля не установлен. - + Name Имя - + Status message Статус - + Public key Публичный ключ @@ -375,22 +375,22 @@ Version: Выберите папку с паком смайлов - + Import plugin Импортировать плагин - + Choose folder with plugin Выберите папку с плагином - + Restart Toxygen Перезапустите Toxygen - + Plugin will be loaded after restart Плагин будет загружен после перезапуска @@ -400,42 +400,42 @@ Version: Цитировать выбранный текст - + Chat history История чата - + Export as text Экспортировать как текст - + Export as HTML Экспортировать как HTML - + Updates Обновления - + Online first Сначала онлайн - + Online and by name Онлайн и по имени - + Online first and by name Сначала онлайн и по имени - + Block friend Заблокировать друга @@ -449,6 +449,11 @@ Version: Text "{}" was not found Текст "{}" не был найден + + + Reload plugins + Перезагрузить плагины + MenuWindow