From 7412f5256d536ae3cb57131c4b5760174d7e12a0 Mon Sep 17 00:00:00 2001 From: Josue Ortega Date: Fri, 5 May 2017 12:57:39 -0600 Subject: [PATCH] Adds flash message when copy is successful --- rtv/page.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rtv/page.py b/rtv/page.py index 717caf9..83ed6da 100644 --- a/rtv/page.py +++ b/rtv/page.py @@ -333,10 +333,12 @@ class Page(object): if url is not None: try: self.copy_to_clipboard(url) + self.term.show_notification( + 'Copied {} to clipboard'.format(url), timeout=1) except ProgramError as e: _logger.exception(e) self.term.show_notification( - 'Failed to copy {} to clipboard, {}'.format(url, e) + 'Failed to copy {} to clipboard, {}'.format(url, e)) @PageController.register(Command('COPY_SUBMISSION_URL')) def copy_post_permalink(self): @@ -349,10 +351,12 @@ class Page(object): if url is not None: try: self.copy_to_clipboard(url) + self.term.show_notification( + 'Copied {} to clipboard'.format(url), timeout=1) except ProgramError as e: _logger.exception(e) self.term.show_notification( - 'Failed to copy {} to clipboard, {}'.format(url, e) + 'Failed to copy {} to clipboard, {}'.format(url, e)) def clear_input_queue(self): """