diff --git a/src/menu.py b/src/menu.py index c7848bb..ab45cb8 100644 --- a/src/menu.py +++ b/src/menu.py @@ -257,10 +257,9 @@ class PrivacySettings(CenteredWidget): def initUI(self): self.setObjectName("privacySettings") - self.resize(350, 200) - self.setMinimumSize(QtCore.QSize(350, 200)) - self.setMaximumSize(QtCore.QSize(350, 200)) - self.setBaseSize(QtCore.QSize(350, 200)) + self.resize(350, 400) + self.setMinimumSize(QtCore.QSize(350, 400)) + self.setMaximumSize(QtCore.QSize(350, 400)) self.saveHistory = QtGui.QCheckBox(self) self.saveHistory.setGeometry(QtCore.QRect(40, 20, 291, 22)) self.saveHistory.setObjectName("saveHistory") @@ -268,19 +267,25 @@ class PrivacySettings(CenteredWidget): self.fileautoaccept.setGeometry(QtCore.QRect(40, 60, 271, 22)) self.fileautoaccept.setObjectName("fileautoaccept") self.typingNotifications = QtGui.QCheckBox(self) - self.typingNotifications.setGeometry(QtCore.QRect(40, 90, 350, 30)) + self.typingNotifications.setGeometry(QtCore.QRect(40, 100, 350, 30)) self.typingNotifications.setObjectName("typingNotifications") + self.inlines = QtGui.QCheckBox(self) + self.inlines.setGeometry(QtCore.QRect(40, 140, 350, 30)) + self.inlines.setObjectName("inlines") + + self.auto_path = QtGui.QLabel(self) - self.auto_path.setGeometry(QtCore.QRect(40, 120, 350, 30)) + self.auto_path.setGeometry(QtCore.QRect(40, 190, 350, 30)) self.path = QtGui.QPlainTextEdit(self) - self.path.setGeometry(QtCore.QRect(10, 160, 330, 30)) + self.path.setGeometry(QtCore.QRect(10, 240, 330, 30)) self.change_path = QtGui.QPushButton(self) - self.change_path.setGeometry(QtCore.QRect(230, 120, 100, 30)) + self.change_path.setGeometry(QtCore.QRect(125, 280, 100, 30)) self.retranslateUi() settings = Settings.get_instance() self.typingNotifications.setChecked(settings['typing_notifications']) self.fileautoaccept.setChecked(settings['allow_auto_accept']) self.saveHistory.setChecked(settings['save_history']) + self.inlines.setChecked(settings['allow_inline']) self.path.setPlainText(settings['auto_accept_path'] or curr_directory()) self.change_path.clicked.connect(self.new_path) QtCore.QMetaObject.connectSlotsByName(self) @@ -292,15 +297,29 @@ class PrivacySettings(CenteredWidget): self.typingNotifications.setText(QtGui.QApplication.translate("privacySettings", "Send typing notifications", None, QtGui.QApplication.UnicodeUTF8)) self.auto_path.setText(QtGui.QApplication.translate("privacySettings", "Auto accept default path:", None, QtGui.QApplication.UnicodeUTF8)) self.change_path.setText(QtGui.QApplication.translate("privacySettings", "Change", None, QtGui.QApplication.UnicodeUTF8)) + self.inlines.setText(QtGui.QApplication.translate("privacySettings", "Allow inlines", None, QtGui.QApplication.UnicodeUTF8)) def closeEvent(self, event): settings = Settings.get_instance() settings['typing_notifications'] = self.typingNotifications.isChecked() settings['allow_auto_accept'] = self.fileautoaccept.isChecked() if settings['save_history'] and not self.saveHistory.isChecked(): # clear history - Profile.get_instance().clear_history() - settings['save_history'] = self.saveHistory.isChecked() + 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() + settings['save_history'] = self.saveHistory.isChecked() + else: + settings['save_history'] = self.saveHistory.isChecked() settings['auto_accept_path'] = self.path.toPlainText() + settings['allow_inline'] = self.inlines.isChecked() settings.save() def new_path(self): diff --git a/src/profile.py b/src/profile.py index 9a20f21..edd703c 100644 --- a/src/profile.py +++ b/src/profile.py @@ -896,7 +896,7 @@ class Profile(Contact, Singleton): if transfer.state: del self._file_transfers[(friend_number, file_number)] if type(transfer) is not SendAvatar: - if type(transfer) is SendFromBuffer: # inline + if type(transfer) is SendFromBuffer and Settings.get_instance()['allow_inline']: # inline inline = InlineImage(transfer.get_data()) self.get_friend_by_number(friend_number).update_transfer_data(file_number, FILE_TRANSFER_MESSAGE_STATUS['FINISHED'], diff --git a/src/translations/en_GB.qm b/src/translations/en_GB.qm index cfa5f65..2c9c410 100644 Binary files a/src/translations/en_GB.qm and b/src/translations/en_GB.qm differ diff --git a/src/translations/en_GB.ts b/src/translations/en_GB.ts index 68639e5..402b76c 100644 --- a/src/translations/en_GB.ts +++ b/src/translations/en_GB.ts @@ -1,21 +1,22 @@ - + + AddContact Add contact - Add contact + Add contact TOX ID: - TOX ID: + TOX ID: Message: - Message: + Message: @@ -23,37 +24,37 @@ Send request - Send request + Send request IPv6 - IPv6 + IPv6 UDP - UDP + UDP Proxy - Proxy + Proxy IP: - IP: + IP: Port: - Port: + Port: Online contacts - Online contacts + Online contacts @@ -61,98 +62,98 @@ Profile - + Settings - + About - + Add contact - + Privacy - + Interface - + Notifications - + Network - + About program - + - + User {} wants to add you to contact list. Message: {} - + - + Friend request - + Toxygen is Tox client written on Python 2.7. Version: - + Choose file - + Disallow auto accept - + Allow auto accept - + Set alias - + Clear history - + Copy public key - + Remove friend - + @@ -160,7 +161,7 @@ Network settings - Network settings + Network settings @@ -168,60 +169,60 @@ Export profile - + Profile settings - + Name: - + Status: - + TOX ID: - + Copy TOX ID - + New avatar - + Reset avatar - + interfaceForm - + Interface settings - + - + Theme: - + - + Language: - + @@ -229,116 +230,131 @@ Log in - + Create - + Profile name: - + Load profile - + Use as default - + Load existing profile - + Create new profile - + toxygen - + - + Looks like other instance of Toxygen uses this profile! Continue? - + notificationsForm - + Notification settings - + - + Enable notifications - + - + Enable call's sound - + - + Enable sound notifications - + privacySettings - - - Privacy settings - - - - - Save chat history - - - - - Allow file auto accept - - - - - Send typing notifications - - - - - Auto accept default path: - - + Privacy settings + + + + + Save chat history + + + + + Allow file auto accept + + + + + Send typing notifications + + + + + Auto accept default path: + + + + Change - + + + + + Allow inlines + + + + + Chat history + + + + + History will be cleaned! Continue? + tray - + Open Toxygen - + - + Exit - + diff --git a/src/translations/ru_RU.qm b/src/translations/ru_RU.qm index 49a5338..7e9ed2e 100644 Binary files a/src/translations/ru_RU.qm and b/src/translations/ru_RU.qm differ diff --git a/src/translations/ru_RU.ts b/src/translations/ru_RU.ts index 42fa1a4..0f5071b 100644 --- a/src/translations/ru_RU.ts +++ b/src/translations/ru_RU.ts @@ -1,21 +1,22 @@ - + + AddContact Add contact - Добавить контакт + Добавить контакт TOX ID: - TOX ID: + TOX ID: Message: - Сообщение: + Сообщение: @@ -23,37 +24,37 @@ Send request - Отправить запрос + Отправить запрос IPv6 - IPv6 + IPv6 UDP - UDP + UDP Proxy - Прокси + Прокси IP: - IP: + IP: Port: - Порт: + Порт: Online contacts - Контакты в сети + Контакты в сети @@ -61,99 +62,99 @@ Profile - Профиль + Профиль Settings - Настройки + Настройки About - О программе + О программе Add contact - Добавить контакт + Добавить контакт Privacy - Приватность + Приватность Interface - Интерфейс + Интерфейс Notifications - Уведомления + Уведомления Network - Сеть + Сеть About program - О программе + О программе - + User {} wants to add you to contact list. Message: {} - Пользователь {} хочет добавить Вас в список контактов. Сообщение: + Пользователь {} хочет добавить Вас в список контактов. Сообщение: {} - + Friend request - Запрос на добавление в друзья + Запрос на добавление в друзья Toxygen is Tox client written on Python 2.7. Version: - Toxygen - клиент для мессенджера Tox, написанный на Python 2.7. Версия: + Toxygen - клиент для мессенджера Tox, написанный на Python 2.7. Версия: Choose file - Выберите файл + Выберите файл Disallow auto accept - Запретить автоматическое получение файлов + Запретить автоматическое получение файлов Allow auto accept - Разрешить автоматическое получение файлов + Разрешить автоматическое получение файлов Set alias - Изменить псевдоним + Изменить псевдоним Clear history - Очистить историю + Очистить историю Copy public key - Копировать публичный ключ + Копировать публичный ключ Remove friend - Удалить друга + Удалить друга @@ -161,7 +162,7 @@ Network settings - Настройки сети + Настройки сети @@ -169,32 +170,32 @@ Export profile - Экспорт профиля + Экспорт профиля Profile settings - Настройки профиля + Настройки профиля Name: - Имя: + Имя: Status: - Статус: + Статус: TOX ID: - TOX ID: + TOX ID: Copy TOX ID - Копировать TOX ID + Копировать TOX ID @@ -204,30 +205,30 @@ New avatar - Новый аватар + Новый аватар Reset avatar - Сбросить аватар + Сбросить аватар interfaceForm - + Interface settings - Настройки интерфейса + Настройки интерфейса - + Theme: - Тема: + Тема: - + Language: - Язык: + Язык: @@ -235,117 +236,132 @@ Log in - Вход + Вход Create - Создать + Создать Profile name: - Имя профиля: + Имя профиля: Load profile - Загрузить профиль + Загрузить профиль Use as default - По умолчанию + По умолчанию Load existing profile - Загрузить профиль + Загрузить профиль Create new profile - Создать новый профиль + Создать новый профиль toxygen - toxygen + toxygen - + Looks like other instance of Toxygen uses this profile! Continue? - Похоже, что этот профиль используется другим экземпляром Toxygen! Продолжить? + Похоже, что этот профиль используется другим экземпляром Toxygen! Продолжить? notificationsForm - + Notification settings - Настройки уведомлений + Настройки уведомлений - + Enable notifications - Включить уведомления + Включить уведомления - + Enable call's sound - Включить звук звонков + Включить звук звонка - + Enable sound notifications - Включить звуковые уведомления + Включить звуковые уведомления privacySettings - - - Privacy settings - Настройки приватности - - - - Save chat history - Сохранять историю переписки - - - - Allow file auto accept - Разрешить автополучение файлов - - - - Send typing notifications - Посылать уведомления о наборе текста - - - - Auto accept default path: - Путь автоприема файлов: - + Privacy settings + Настройки приватности + + + + Save chat history + Сохранять историю переписки + + + + Allow file auto accept + Разрешить автополучение файлов + + + + Send typing notifications + Посылать уведомления о наборе текста + + + + Auto accept default path: + Путь автоприема файлов: + + + Change - Изменить + Изменить + + + + Allow inlines + Разрешать инлайны + + + + Chat history + История чата + + + + History will be cleaned! Continue? + История переписки будет очищена! Продолжить? tray - + Open Toxygen - Открыть Toxygen + Открыть Toxygen - + Exit - Выход + Выход