Feat: Read long posts from GUI

This commit is contained in:
Manuel Cortez 2024-05-22 17:55:52 -06:00
parent 503bf72b11
commit fe43ce562c
No known key found for this signature in database
GPG Key ID: 9E0735CA15EFE790
5 changed files with 14 additions and 5 deletions

View File

@ -4,6 +4,8 @@ TWBlue Changelog
* Core:
* The way sessions are named has been changed. Now the account is indicated first, followed by the social network it belongs to.
* An option has been added to the global options dialog that allows for the reading of long posts in the graphical interface. This is especially useful since, by default, the graphical interface can only display a limited number of characters in the post.
* Some options that are no longer necessary in the application have been removed from the global settings dialog.
* Mastodon:
* fixed an error that caused TWBlue to not display some posts correctly.
* Fixed name for community timelines when created during startup. Now it should be clear if it's a federated or local timeline.

View File

@ -9,8 +9,7 @@ update_period = integer(default=2)
hide_gui = boolean(default=False)
voice_enabled = boolean(default=False)
ask_at_exit = boolean(default=True)
autostart = boolean(default=False)
handle_longtweets = boolean(default=True)
read_long_posts_in_gui = boolean(default=True)
use_invisible_keyboard_shorcuts = boolean(default=True)
play_ready_sound = boolean(default=True)
speak_ready_msg = boolean(default=True)
@ -18,9 +17,6 @@ log_level = string(default="error")
load_keymap = string(default="default.keymap")
donation_dialog_displayed = boolean(default=False)
check_for_updates = boolean(default=True)
remember_mention_and_longtweet = boolean(default=False)
longtweet = boolean(default=false)
mention_all = boolean(default=False)
no_streaming = boolean(default=False)
[proxy]

View File

@ -406,6 +406,8 @@ class BaseBuffer(base.Buffer):
original_date = arrow.get(self.session.db[self.name][self.buffer.list.get_selected()].created_at)
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():
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):

View File

@ -4,6 +4,7 @@ import logging
import wx
import widgetUtils
import output
import config
from mastodon import MastodonNotFoundError
from controller.mastodon import messages
from controller.buffers.mastodon.base import BaseBuffer
@ -162,6 +163,8 @@ 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)
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):

View File

@ -1,8 +1,11 @@
# -*- coding: utf-8 -*-
import time
import logging
import arrow
import widgetUtils
import output
import languageHandler
import config
from pubsub import pub
from controller.buffers.mastodon.base import BaseBuffer
from controller.mastodon import messages
@ -38,8 +41,11 @@ class NotificationsBuffer(BaseBuffer):
original_date = arrow.get(self.session.db[self.name][self.buffer.list.get_selected()].created_at)
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)
def bind_events(self):
self.buffer.set_focus_function(self.onFocus)
widgetUtils.connect_event(self.buffer.list.list, widgetUtils.KEYPRESS, self.get_event)
widgetUtils.connect_event(self.buffer, widgetUtils.BUTTON_PRESSED, self.post_status, self.buffer.post)
widgetUtils.connect_event(self.buffer, widgetUtils.BUTTON_PRESSED, self.destroy_status, self.buffer.dismiss)