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 ae4bf08..25507b2 100644 Binary files a/toxygen/translations/ru_RU.qm and b/toxygen/translations/ru_RU.qm differ diff --git a/toxygen/translations/ru_RU.ts b/toxygen/translations/ru_RU.ts index edb79d5..52bffa4 100644 --- a/toxygen/translations/ru_RU.ts +++ b/toxygen/translations/ru_RU.ts @@ -87,47 +87,47 @@ can produce IP leak 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