From 98b783836a8ebc5f6193cf25938e7d897d4e8bf8 Mon Sep 17 00:00:00 2001 From: Ivan Habunek Date: Thu, 29 Aug 2019 13:38:48 +0200 Subject: [PATCH] Mark toot curses as deprecated --- toot/ui/README.md | 4 ++++ toot/ui/app.py | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 toot/ui/README.md diff --git a/toot/ui/README.md b/toot/ui/README.md new file mode 100644 index 0000000..6f39c85 --- /dev/null +++ b/toot/ui/README.md @@ -0,0 +1,4 @@ +This curses TUI has been deprecated in favour of the new one in `toot.tui` which +uses the Urwid framework to avoid having to do all the drawing manually. + +This app will no longer be maintained and will be removed in a future release. diff --git a/toot/ui/app.py b/toot/ui/app.py index 3d9e704..748099a 100644 --- a/toot/ui/app.py +++ b/toot/ui/app.py @@ -338,6 +338,25 @@ class HelpModal(Modal): ] +class DeprecationNoticeModal(Modal): + def get_content(self): + return [ + ("DEPRECATION NOTICE", Color.RED | curses.A_BOLD), + "", + "This experimental terminal UI has been deprecated and will be ", + "removed in the near future.", + "", + "The new TUI can be lauched by running `toot tui`. This new UI ", + "contains all the functionality of this one and much more. ", + "It will be supported for the forseeable future.", + "", + "For details see:", + ("https://github.com/ihabunek/toot/pull/108", Color.CYAN), + "", + ("Press q to close this notice.", Color.YELLOW), + ] + + class EntryModal(Modal): def __init__(self, stdscr, title, footer=None, size=(None, None), default=None, resize_callback=None): self.stdscr = stdscr @@ -527,6 +546,9 @@ class TimelineApp: self.selected = 0 self.full_redraw() + self.deprecation_modal.loop() + self.full_redraw() + self.loop() def setup_windows(self): @@ -549,6 +571,7 @@ class TimelineApp: self.right = StatusDetailWindow(self.stdscr, main_height, main_width, header_height, left_width) self.help_modal = HelpModal(self.stdscr, resize_callback=self.on_resize) + self.deprecation_modal = DeprecationNoticeModal(self.stdscr, resize_callback=self.on_resize) def loop(self): while True: