diff --git a/toot/tui/app.py b/toot/tui/app.py index 21315dc..c2a39f7 100644 --- a/toot/tui/app.py +++ b/toot/tui/app.py @@ -260,7 +260,7 @@ class TUI(urwid.Frame): self.loop.set_alarm_in(5, lambda *args: self.footer.clear_message()) config.save_config(self.config) - timeline = Timeline(self, name, statuses, self.can_translate, self.followed_tags, self.followed_accounts) + timeline = Timeline(self, name, statuses) self.connect_default_timeline_signals(timeline) urwid.connect_signal(timeline, "next", _next) @@ -289,8 +289,7 @@ class TUI(urwid.Frame): statuses = ancestors + [status] + descendants focus = len(ancestors) - timeline = Timeline(self, "thread", statuses, self.can_translate, - self.followed_tags, self.followed_accounts, focus, is_thread=True) + timeline = Timeline(self, "thread", statuses, focus=focus, is_thread=True) self.connect_default_timeline_signals(timeline) urwid.connect_signal(timeline, "close", _close) diff --git a/toot/tui/timeline.py b/toot/tui/timeline.py index e70a8a2..645ab3e 100644 --- a/toot/tui/timeline.py +++ b/toot/tui/timeline.py @@ -49,9 +49,6 @@ class Timeline(urwid.Columns): tui: "app.TUI", name, statuses, - can_translate, - followed_tags=[], - followed_accounts=[], focus=0, is_thread=False): @@ -59,10 +56,7 @@ class Timeline(urwid.Columns): self.name = name self.is_thread = is_thread self.statuses = statuses - self.can_translate = can_translate self.status_list = self.build_status_list(statuses, focus=focus) - self.followed_tags = followed_tags - self.followed_accounts = followed_accounts try: focused_status = statuses[focus] @@ -132,7 +126,7 @@ class Timeline(urwid.Columns): "[P]oll" if poll and not poll["expired"] else "", "So[u]rce", "[Z]oom", - "Tra[n]slate" if self.can_translate else "", + "Tra[n]slate" if self.tui.can_translate else "", "Cop[y]", "[H]elp", ] @@ -242,7 +236,7 @@ class Timeline(urwid.Columns): return if key in ("n", "N"): - if self.can_translate: + if self.tui.can_translate: self._emit("translate", status) return @@ -331,8 +325,8 @@ class Timeline(urwid.Columns): class StatusDetails(urwid.Pile): def __init__(self, timeline: Timeline, status: Optional[Status]): self.status = status - self.followed_tags = timeline.followed_tags - self.followed_accounts = timeline.followed_accounts + self.followed_tags = timeline.tui.followed_tags + self.followed_accounts = timeline.tui.followed_accounts reblogged_by = status.author if status and status.reblog else None widget_list = list(self.content_generator(status.original, reblogged_by)