From 27cf1a7348226849432191247f827d290e19c682 Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Mon, 4 Jul 2016 23:30:45 +0300 Subject: [PATCH] welcome screen --- src/mainscreen.py | 2 + src/mainscreen_widgets.py | 66 ++++++++++++++++- src/profile.py | 2 + src/settings.py | 3 +- src/translations/en_GB.ts | 142 +++++++++++++++++++++++++----------- src/translations/fr_FR.ts | 142 +++++++++++++++++++++++++----------- src/translations/ru_RU.qm | Bin 15314 -> 18400 bytes src/translations/ru_RU.ts | 146 ++++++++++++++++++++++++++------------ 8 files changed, 373 insertions(+), 130 deletions(-) diff --git a/src/mainscreen.py b/src/mainscreen.py index 227619d..943d761 100644 --- a/src/mainscreen.py +++ b/src/mainscreen.py @@ -16,6 +16,8 @@ class MainWindow(QtGui.QMainWindow): self.tray = tray self.setAcceptDrops(True) self.initUI(tox) + if settings.Settings.get_instance()['show_welcome_screen']: + self.ws = WelcomeScreen() def setup_menu(self, MainWindow): self.menubar = QtGui.QMenuBar(MainWindow) diff --git a/src/mainscreen_widgets.py b/src/mainscreen_widgets.py index 79d9838..f12f521 100644 --- a/src/mainscreen_widgets.py +++ b/src/mainscreen_widgets.py @@ -2,7 +2,7 @@ try: from PySide import QtCore, QtGui except ImportError: from PyQt4 import QtCore, QtGui -from widgets import RubberBand, create_menu, QRightClickButton +from widgets import RubberBand, create_menu, QRightClickButton, CenteredWidget from profile import Profile import smileys import util @@ -312,3 +312,67 @@ class StickerWindow(QtGui.QWidget): self.close() +class WelcomeScreen(CenteredWidget): + + def __init__(self): + super().__init__() + self.setMaximumSize(250, 200) + self.setMinimumSize(250, 200) + self.center() + self.setAttribute(QtCore.Qt.WA_DeleteOnClose) + self.text = QtGui.QTextBrowser(self) + self.text.setGeometry(QtCore.QRect(0, 0, 250, 170)) + self.text.setOpenExternalLinks(True) + self.checkbox = QtGui.QCheckBox(self) + self.checkbox.setGeometry(QtCore.QRect(5, 170, 240, 30)) + self.checkbox.setText(QtGui.QApplication.translate('WelcomeScreen', "Don't show again", + None, QtGui.QApplication.UnicodeUTF8)) + self.setWindowTitle(QtGui.QApplication.translate('WelcomeScreen', 'Tip of the day', + None, QtGui.QApplication.UnicodeUTF8)) + import random + num = random.randint(0, 8) + if num == 0: + text = QtGui.QApplication.translate('WelcomeScreen', 'Press Esc if you want hide app to tray.', + None, QtGui.QApplication.UnicodeUTF8) + elif num == 1: + text = QtGui.QApplication.translate('WelcomeScreen', + 'Right click on screenshot button hides app to tray during screenshot.', + None, QtGui.QApplication.UnicodeUTF8) + elif num == 2: + text = QtGui.QApplication.translate('WelcomeScreen', + 'You can use Tox over Tor. For more info read this post', + None, QtGui.QApplication.UnicodeUTF8) + elif num == 3: + text = QtGui.QApplication.translate('WelcomeScreen', + 'Use Settings -> Interface to customize interface.', + None, QtGui.QApplication.UnicodeUTF8) + elif num == 4: + text = QtGui.QApplication.translate('WelcomeScreen', + 'Set profile password via Profile -> Settings. Password allows Toxygen encrypt your history and settings.', + None, QtGui.QApplication.UnicodeUTF8) + elif num == 5: + text = QtGui.QApplication.translate('WelcomeScreen', + 'Since v0.1.3 Toxygen supports plugins. Read more', + None, QtGui.QApplication.UnicodeUTF8) + elif num == 6: + text = QtGui.QApplication.translate('WelcomeScreen', + 'New in Toxygen v0.2.2:
Users can lock application using profile password.
Compact contact list support
Bug fixes
Tox DNS improvements', + None, QtGui.QApplication.UnicodeUTF8) + elif num == 7: + text = QtGui.QApplication.translate('WelcomeScreen', + 'Toxygen supports faux offline messages and file transfers. Send message or file to offline friend and he will get it later.', + None, QtGui.QApplication.UnicodeUTF8) + else: + text = QtGui.QApplication.translate('WelcomeScreen', + 'Set new NoSpam to avoid spam friend requests: Profile -> Settings -> Set new NoSpam.', + None, QtGui.QApplication.UnicodeUTF8) + self.text.setHtml(text) + self.checkbox.stateChanged.connect(self.not_show) + QtCore.QTimer.singleShot(1000, self.show) + + def not_show(self): + import settings + s = settings.Settings.get_instance() + s['show_welcome_screen'] = False + s.save() + diff --git a/src/profile.py b/src/profile.py index f934eae..9ca41fe 100644 --- a/src/profile.py +++ b/src/profile.py @@ -229,6 +229,7 @@ class Profile(contact.Contact, Singleton): self._screen.account_avatar.setScaledContents(False) self._screen.account_avatar.setPixmap(pixmap.scaled(64, 64, QtCore.Qt.KeepAspectRatio)) self._screen.account_avatar.repaint() # comment? + self.update_filtration() except Exception as ex: # no friend found. ignore log('Friend value: ' + str(value)) log('Error: ' + str(ex)) @@ -778,6 +779,7 @@ class Profile(contact.Contact, Singleton): self.status = None for friend in self._friends: friend.status = None + self.update_filtration() def close(self): if hasattr(self, '_call'): diff --git a/src/settings.py b/src/settings.py index 7b8f4ab..69ed458 100644 --- a/src/settings.py +++ b/src/settings.py @@ -125,7 +125,8 @@ class Settings(dict, Singleton): 'message_font_size': 14, 'unread_color': 'red', 'save_unsent_only': False, - 'compact_mode': False + 'compact_mode': False, + 'show_welcome_screen': True } @staticmethod diff --git a/src/translations/en_GB.ts b/src/translations/en_GB.ts index ece01c4..cb8914e 100644 --- a/src/translations/en_GB.ts +++ b/src/translations/en_GB.ts @@ -84,103 +84,103 @@ can produce IP leak MainWindow - + Profile - + Settings - + About - + Add contact - + Privacy - + Interface - + Notifications - + Network - + About program - + User {} wants to add you to contact list. Message: {} - + Friend request - + Choose file Choose file - + Disallow auto accept - + Allow auto accept - + Set alias - + Clear history - + Copy public key - + Remove friend - + 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: - + Audio Audio @@ -190,19 +190,19 @@ can produce IP leak Find contact - + Friend added Friend added - + Toxygen is Tox client written on Python. Version: Toxygen is Tox client written on Python. Version: - + Friend added without sending friend request Friend added without sending friend request @@ -222,47 +222,47 @@ Version: Send file - + Send message Send message - + Start audio call with friend Start audio call with friend - + Plugins - + List of plugins - + Search - + All - + Online - + Notes - + Notes about user @@ -312,7 +312,7 @@ Version: - + User {} is now known as {} @@ -322,17 +322,17 @@ Version: - + Lock - + Cannot lock app - + Error. Profile password is not set. @@ -572,6 +572,64 @@ Version: + + WelcomeScreen + + + Don't show again + + + + + Tip of the day + + + + + Press Esc if you want hide app to tray. + + + + + Right click on screenshot button hides app to tray during screenshot + + + + + You can use Tox over Tor. For more info read <a href="https://wiki.tox.chat/users/tox_over_tor_tot">this post</a> + + + + + Use Settings -> Interface to customize interface + + + + + Set profile password via Profile -> Settings. Password allows Toxygen encrypt your history and settings. + + + + + Since v0.1.3 Toxygen supports plugins. <a href="https://github.com/xveduk/toxygen/blob/master/docs/plugins.md">Read more</a> + + + + + New in Toxygen v0.2.2:<br>Users can lock application using profile password.<br>Compact contact list support<br>Bug fixes<br>Tox DNS improvements + + + + + Toxygen supports faux offline messages and file transfers. Send message or file to offline friend and he will get it later + + + + + Set new NoSpam to avoid spam friend requests: Profile -> Settings -> Set new NoSpam + + + audioSettingsForm @@ -593,32 +651,32 @@ Version: incoming_call - + Incoming video call Incoming video call - + Incoming audio call Incoming audio call - + Outgoing video call - + Outgoing audio call - + Call declined - + Call finished diff --git a/src/translations/fr_FR.ts b/src/translations/fr_FR.ts index 48998fa..a4f443c 100644 --- a/src/translations/fr_FR.ts +++ b/src/translations/fr_FR.ts @@ -84,58 +84,58 @@ 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 - + User {} wants to add you to contact list. Message: {} L'Utilisateur {} veut vout rajouter à sa liste de contacts. Message : {} - + Friend request Demande d'amis @@ -145,47 +145,47 @@ 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 - + Copy public key Copier la clé publique - + Remove friend Retirer un ami - + Enter new alias for friend {} or leave empty to use friend's name: Entrez un nouvel alias pour l'ami {} ou laissez vide pour garder son nom de base : - + Audio Audio @@ -195,19 +195,19 @@ can produce IP leak Trouver le contact - + Friend added Ami rajouté - + Toxygen is Tox client written on Python. Version: Toxygen est un client Tox écrit en Python. Version : - + Friend added without sending friend request Ami rajouté sans avoir envoyé de demande @@ -227,47 +227,47 @@ 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 - + Search - + All - + Online - + Notes - + Notes about user @@ -317,7 +317,7 @@ Version : - + User {} is now known as {} @@ -327,17 +327,17 @@ Version : - + Lock - + Cannot lock app - + Error. Profile password is not set. @@ -577,6 +577,64 @@ Version : + + WelcomeScreen + + + Don't show again + + + + + Tip of the day + + + + + Press Esc if you want hide app to tray. + + + + + Right click on screenshot button hides app to tray during screenshot + + + + + You can use Tox over Tor. For more info read <a href="https://wiki.tox.chat/users/tox_over_tor_tot">this post</a> + + + + + Use Settings -> Interface to customize interface + + + + + Set profile password via Profile -> Settings. Password allows Toxygen encrypt your history and settings. + + + + + Since v0.1.3 Toxygen supports plugins. <a href="https://github.com/xveduk/toxygen/blob/master/docs/plugins.md">Read more</a> + + + + + New in Toxygen v0.2.2:<br>Users can lock application using profile password.<br>Compact contact list support<br>Bug fixes<br>Tox DNS improvements + + + + + Toxygen supports faux offline messages and file transfers. Send message or file to offline friend and he will get it later + + + + + Set new NoSpam to avoid spam friend requests: Profile -> Settings -> Set new NoSpam + + + audioSettingsForm @@ -598,32 +656,32 @@ Version : incoming_call - + Incoming video call Appel vidéo entrant - + Incoming audio call Appel audio entrant - + Outgoing video call - + Outgoing audio call - + Call declined - + Call finished diff --git a/src/translations/ru_RU.qm b/src/translations/ru_RU.qm index 1208cf7fb683253a98220797dfb7799edb7b41c3..629e9bd27971f59aea1bbf113fa73223f3d00df2 100644 GIT binary patch delta 3807 zcmb_ee{56N6+TX`B3pb`C2*PvX#EIj?PMn6ODHIq98n7+di~Vdr#r8Ar zJtqzwbJtGQREi3Huy*anx>0DWj#V1_qhpk@Qn9H>E2Zn!sZxi^hR}vKt*F|{DBE`( zleUmZ2+fxL?mh3^bI-SF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N9>YZ{-kijU9E~(YYcsI3Mtyn3>gyu{TM5(c@Nk!SkaYUVAONA z=JFvRB!h{k`+>1h?C{nO!fmYnTrJ(7V5i~<)iT!B^$O6YvyTZJ7_m-?ai1q%P4Vpg z3pj2m=?jV9_(hr1{TU)%4wpSYMV_oXMwKWxQ+p^yS6*Ms2O^76*GsQhQW*q-XDfZ)Pa3o#DN2wD#4S@AzKSr37HkKXj5OG2cyWG?@@~(zL1ZEj=qY?VC7=yjmhw8@&F+ z)8@yydx+(N`9-x87}#p=TA53No48%N4qE+a_{1kW=aMI>JT1fo3~l8znv;RybNPaB zg* MainWindow - + Profile Профиль - + Settings Настройки - + About О программе - + Add contact Добавить контакт - + Privacy Приватность - + Interface Интерфейс - + Notifications Уведомления - + Network Сеть - + About program О программе - + User {} wants to add you to contact list. Message: {} Пользователь {} хочет добавить Вас в список контактов. Сообщение: {} - + Friend request Запрос на добавление в друзья - + Choose file Выберите файл - + Disallow auto accept Запретить автоматическое получение файлов - + Allow auto accept Разрешить автоматическое получение файлов - + Set alias Изменить псевдоним - + Clear history Очистить историю - + Copy public key Копировать публичный ключ - + Remove friend Удалить друга - + Enter new alias for friend {} or leave empty to use friend's name: Введите новый псевдоним для друга {} или оставьте пустым для использования его имени: - + Audio Аудио @@ -194,18 +194,18 @@ can produce IP leak Найти контакт - + Friend added Друг добавлен - + Toxygen is Tox client written on Python. Version: Toxygen - клиент для мессенджера Tox, написанный на Python. Версия: - + Friend added without sending friend request Друг добавлен без отправки запроса на добавление в друзья @@ -225,47 +225,47 @@ Version: Отправить файл - + Send message Отправить сообщение - + Start audio call with friend Начать аудиозвонок с другом - + Plugins Плагины - + List of plugins Список плагинов - + Search Поиск - + All Все - + Online Онлайн - + Notes Заметки - + Notes about user Заметки о пользователе @@ -315,7 +315,7 @@ Version: Сохранить - + User {} is now known as {} Пользователь {} сейчас известен как {} @@ -325,17 +325,17 @@ Version: Удалить сообщение - + Lock Заблокировать - + Cannot lock app Невозможно заблокировать приложение - + Error. Profile password is not set. Ошибка. Пароль профиля не установлен. @@ -580,6 +580,64 @@ Version: Сделать профилем по умолчанию + + WelcomeScreen + + + Don't show again + Не показывать снова + + + + Tip of the day + Подсказка дня + + + + Press Esc if you want hide app to tray. + Нажатие Esc сворачивает приложение в трей. + + + + Right click on screenshot button hides app to tray during screenshot + Правый клик на кнопке скриншота сворачивает приложение в трей на время скриншота + + + + You can use Tox over Tor. For more info read <a href="https://wiki.tox.chat/users/tox_over_tor_tot">this post</a> + Вы можете использовать Tox через Tor. Дополнительная информация <a href="https://wiki.tox.chat/users/tox_over_tor_tot">тут</a> + + + + Use Settings -> Interface to customize interface + Используйте Настройки -> Интерфейс для настройки интерфейса + + + + Set profile password via Profile -> Settings. Password allows Toxygen encrypt your history and settings. + Установите пароль профиля: Профиль -> Настройки. Пароль позволяет шифровать историю переписки и настройки. + + + + Since v0.1.3 Toxygen supports plugins. <a href="https://github.com/xveduk/toxygen/blob/master/docs/plugins.md">Read more</a> + С версии 0.1.3 Toxygen поддерживает плагины. <a href="https://github.com/xveduk/toxygen/blob/master/docs/plugins.md">Узнать больше.</a> + + + + New in Toxygen v0.2.2:<br>Users can lock application using profile password.<br>Compact contact list support<br>Bug fixes<br>Tox DNS improvements + С версии 0.1.3 Toxygen поддерживает плагины. <a href="https://github.com/xveduk/toxygen/blob/master/docs/plugins.md">Узнать больше.</a> + + + + Toxygen supports faux offline messages and file transfers. Send message or file to offline friend and he will get it later + Toxygen поддерживает псевдооффлайн сообщения и файл трансферы + + + + Set new NoSpam to avoid spam friend requests: Profile -> Settings -> Set new NoSpam + Установите новый NoSpam, чтобы избежать спам запросов в друзья: Профиль->Настройки->Новый NoSpam + + audioSettingsForm @@ -601,32 +659,32 @@ Version: incoming_call - + Incoming video call Входящий видеозвонок - + Incoming audio call Входящий аудиозвонок - + Outgoing video call Исходящий видеозвонок - + Outgoing audio call Исходящий аудиозвонок - + Call declined Звонок отменен - + Call finished Звонок завершен @@ -656,7 +714,7 @@ Version: Smiley pack: - Набор смайликов + Набор смайликов: @@ -851,7 +909,7 @@ Version: Block by public key: - Блокировать по публичному ключу + Блокировать по публичному ключу: