Adds flash message when copy is successful

This commit is contained in:
Josue Ortega
2017-05-05 12:57:39 -06:00
parent ed5419eff8
commit 7412f5256d

View File

@@ -333,10 +333,12 @@ class Page(object):
if url is not None: if url is not None:
try: try:
self.copy_to_clipboard(url) self.copy_to_clipboard(url)
self.term.show_notification(
'Copied {} to clipboard'.format(url), timeout=1)
except ProgramError as e: except ProgramError as e:
_logger.exception(e) _logger.exception(e)
self.term.show_notification( 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')) @PageController.register(Command('COPY_SUBMISSION_URL'))
def copy_post_permalink(self): def copy_post_permalink(self):
@@ -349,10 +351,12 @@ class Page(object):
if url is not None: if url is not None:
try: try:
self.copy_to_clipboard(url) self.copy_to_clipboard(url)
self.term.show_notification(
'Copied {} to clipboard'.format(url), timeout=1)
except ProgramError as e: except ProgramError as e:
_logger.exception(e) _logger.exception(e)
self.term.show_notification( 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): def clear_input_queue(self):
""" """