mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-01-18 08:30:42 -06:00
Mastodon: read long posts in GUI should be improved and work in all kinds of buffers
This commit is contained in:
parent
021dd0ae52
commit
40689caef6
@ -407,7 +407,7 @@ class BaseBuffer(base.Buffer):
|
||||
ts = original_date.humanize(locale=languageHandler.getLanguage())
|
||||
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():
|
||||
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):
|
||||
self.session.sound.play("audio.ogg")
|
||||
if self.session.settings['sound']['indicate_img'] and utils.is_image(post):
|
||||
|
@ -164,7 +164,7 @@ class ConversationListBuffer(BaseBuffer):
|
||||
def onFocus(self, *args, **kwargs):
|
||||
post = self.get_item()
|
||||
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):
|
||||
self.session.sound.play("audio.ogg")
|
||||
if self.session.settings['sound']['indicate_img'] and utils.is_image(post):
|
||||
|
@ -3,6 +3,7 @@ import time
|
||||
import logging
|
||||
import arrow
|
||||
import widgetUtils
|
||||
import wx
|
||||
import output
|
||||
import languageHandler
|
||||
import config
|
||||
@ -42,7 +43,7 @@ class NotificationsBuffer(BaseBuffer):
|
||||
ts = original_date.humanize(locale=languageHandler.getLanguage())
|
||||
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():
|
||||
output.speak(self.get_message(), interrupt=True)
|
||||
wx.CallLater(40, output.speak, self.get_message(), interrupt=True)
|
||||
|
||||
def bind_events(self):
|
||||
self.buffer.set_focus_function(self.onFocus)
|
||||
|
Loading…
x
Reference in New Issue
Block a user