Update title on user changes when sending a DM. Fixes #276

This commit is contained in:
Manuel Cortez 2020-06-03 11:19:23 -05:00
parent 6a2e00c467
commit bdd7d617c3
2 changed files with 6 additions and 0 deletions

View File

@ -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

View File

@ -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)