Mastodon: read long posts in GUI should be improved and work in all kinds of buffers

This commit is contained in:
Manuel Cortez 2024-11-26 23:23:36 -06:00
parent 021dd0ae52
commit 40689caef6
3 changed files with 4 additions and 3 deletions

View File

@ -407,7 +407,7 @@ class BaseBuffer(base.Buffer):
ts = original_date.humanize(locale=languageHandler.getLanguage()) ts = original_date.humanize(locale=languageHandler.getLanguage())
self.buffer.list.list.SetItem(self.buffer.list.get_selected(), 2, ts) self.buffer.list.list.SetItem(self.buffer.list.get_selected(), 2, ts)
if config.app["app-settings"]["read_long_posts_in_gui"] == True and self.buffer.list.list.HasFocus(): if config.app["app-settings"]["read_long_posts_in_gui"] == True and self.buffer.list.list.HasFocus():
wx.CallLater(20, output.speak, self.get_message(), interrupt=True) wx.CallLater(40, output.speak, self.get_message(), interrupt=True)
if self.session.settings['sound']['indicate_audio'] and utils.is_audio_or_video(post): if self.session.settings['sound']['indicate_audio'] and utils.is_audio_or_video(post):
self.session.sound.play("audio.ogg") self.session.sound.play("audio.ogg")
if self.session.settings['sound']['indicate_img'] and utils.is_image(post): if self.session.settings['sound']['indicate_img'] and utils.is_image(post):

View File

@ -164,7 +164,7 @@ class ConversationListBuffer(BaseBuffer):
def onFocus(self, *args, **kwargs): def onFocus(self, *args, **kwargs):
post = self.get_item() post = self.get_item()
if config.app["app-settings"]["read_long_posts_in_gui"] == True and self.buffer.list.list.HasFocus(): if config.app["app-settings"]["read_long_posts_in_gui"] == True and self.buffer.list.list.HasFocus():
output.speak(self.get_message(), interrupt=True) wx.CallLater(40, output.speak, self.get_message(), interrupt=True)
if self.session.settings['sound']['indicate_audio'] and utils.is_audio_or_video(post): if self.session.settings['sound']['indicate_audio'] and utils.is_audio_or_video(post):
self.session.sound.play("audio.ogg") self.session.sound.play("audio.ogg")
if self.session.settings['sound']['indicate_img'] and utils.is_image(post): if self.session.settings['sound']['indicate_img'] and utils.is_image(post):

View File

@ -3,6 +3,7 @@ import time
import logging import logging
import arrow import arrow
import widgetUtils import widgetUtils
import wx
import output import output
import languageHandler import languageHandler
import config import config
@ -42,7 +43,7 @@ class NotificationsBuffer(BaseBuffer):
ts = original_date.humanize(locale=languageHandler.getLanguage()) ts = original_date.humanize(locale=languageHandler.getLanguage())
self.buffer.list.list.SetItem(self.buffer.list.get_selected(), 1, ts) self.buffer.list.list.SetItem(self.buffer.list.get_selected(), 1, ts)
if config.app["app-settings"]["read_long_posts_in_gui"] == True and self.buffer.list.list.HasFocus(): if config.app["app-settings"]["read_long_posts_in_gui"] == True and self.buffer.list.list.HasFocus():
output.speak(self.get_message(), interrupt=True) wx.CallLater(40, output.speak, self.get_message(), interrupt=True)
def bind_events(self): def bind_events(self):
self.buffer.set_focus_function(self.onFocus) self.buffer.set_focus_function(self.onFocus)