1
0
mirror of https://github.com/ihabunek/toot.git synced 2024-11-03 04:17:21 -05:00

Display a message in footer upon [P]in action

And clear the message after 5s.
This commit is contained in:
Denis Laxalde 2020-01-27 11:50:12 +01:00 committed by Ivan Habunek
parent 4d1fa837a1
commit 3efa330d69
No known key found for this signature in database
GPG Key ID: CDBD63C43A30BB95

View File

@ -221,8 +221,11 @@ class TUI(urwid.Frame):
timelines = self.config.setdefault("timelines", {}) timelines = self.config.setdefault("timelines", {})
if hashtag in timelines: if hashtag in timelines:
del timelines[hashtag] del timelines[hashtag]
self.footer.set_message("#{} unpinned".format(hashtag))
else: else:
timelines[hashtag] = {"local": local} timelines[hashtag] = {"local": local}
self.footer.set_message("#{} pinned".format(hashtag))
self.loop.set_alarm_in(5, lambda *args: self.footer.clear_message())
config.save_config(self.config) config.save_config(self.config)
timeline = Timeline(name, statuses) timeline = Timeline(name, statuses)