From bdd7d617c3d3f3577c1ce9cc3556806d3af4bc8b Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Wed, 3 Jun 2020 11:19:23 -0500 Subject: [PATCH] Update title on user changes when sending a DM. Fixes #276 --- doc/changelog.md | 1 + src/controller/messages.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/doc/changelog.md b/doc/changelog.md index 637d5f6d..fc3e6475 100644 --- a/doc/changelog.md +++ b/doc/changelog.md @@ -6,6 +6,7 @@ * TWBlue has been migrated completely to Python 3 (currently, the software builds with Python 3.7). * TWBlue should be restarted gracefully. Before, the application was alerting users of not being closed properly every time the application restarted by itself. * If TWBlue attemps to load an account with invalid tokens (this happens when reactivating a previously deactivated account, or when access to the ap is revoqued), TWBlue will inform the user about this error and will skip the account. Before, the app was unable to start due to a critical error. +* When sending a direct message, the title of the window will change appropiately when the recipient is edited. ((#276,)[https://github.com/manuelcortez/TWBlue/issues/276]) ## Changes in version 0.95 diff --git a/src/controller/messages.py b/src/controller/messages.py index 0567f0c5..295cd939 100644 --- a/src/controller/messages.py +++ b/src/controller/messages.py @@ -194,6 +194,11 @@ class dm(basicTweet): super(dm, self).__init__(session, title, caption, text, messageType="dm", max=10000) widgetUtils.connect_event(self.message.autocompletionButton, widgetUtils.BUTTON_PRESSED, self.autocomplete_users) self.text_processor() + widgetUtils.connect_event(self.message.cb, widgetUtils.ENTERED_TEXT, self.user_changed) + + def user_changed(self, *args, **kwargs): + self.title = _("Direct message to %s") % (self.message.get_user()) + self.text_processor() def autocomplete_users(self, *args, **kwargs): c = autocompletionUsers.completion.autocompletionUsers(self.message, self.session.session_id)