From 5e4a4f66131d3a1c16ad91d6ba2c6240be3f09ac Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Sun, 11 Feb 2018 17:42:07 +1100 Subject: [PATCH 1/2] Move the copy URL/HidServAuth notifications to desktop notifications instead of statusbar --- onionshare_gui/onionshare_gui.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index 5d0999b2..372bf719 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -367,7 +367,6 @@ class OnionShareGui(QtWidgets.QMainWindow): self.starting_server_error.emit(e.strerror) return - #self.status_bar.showMessage(strings._('gui_starting_server2', True)) t = threading.Thread(target=finish_starting_server, kwargs={'self': self}) t.daemon = True t.start() @@ -549,14 +548,16 @@ class OnionShareGui(QtWidgets.QMainWindow): When the URL gets copied to the clipboard, display this in the status bar. """ common.log('OnionShareGui', 'copy_url') - self.status_bar.showMessage(strings._('gui_copied_url', True), 2000) + if self.systemTray.supportsMessages() and self.settings.get('systray_notifications'): + self.status_bar.showMessage(strings._('gui_copied_url', True), 2000) def copy_hidservauth(self): """ When the stealth onion service HidServAuth gets copied to the clipboard, display this in the status bar. """ common.log('OnionShareGui', 'copy_hidservauth') - self.status_bar.showMessage(strings._('gui_copied_hidservauth', True), 2000) + if self.systemTray.supportsMessages() and self.settings.get('systray_notifications'): + self.status_bar.showMessage(strings._('gui_copied_hidservauth', True), 2000) def clear_message(self): """ From b8cf692cd8d9555a6a0c9a25d867555f7fea02fa Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Sun, 11 Feb 2018 17:52:14 +1100 Subject: [PATCH 2/2] actually show those messages in the system tray, not still in the statusbar, and with the mandatory titles --- onionshare_gui/onionshare_gui.py | 4 ++-- share/locale/en.json | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index 372bf719..8494c33f 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -549,7 +549,7 @@ class OnionShareGui(QtWidgets.QMainWindow): """ common.log('OnionShareGui', 'copy_url') if self.systemTray.supportsMessages() and self.settings.get('systray_notifications'): - self.status_bar.showMessage(strings._('gui_copied_url', True), 2000) + self.systemTray.showMessage(strings._('gui_copied_url_title', True), strings._('gui_copied_url', True)) def copy_hidservauth(self): """ @@ -557,7 +557,7 @@ class OnionShareGui(QtWidgets.QMainWindow): """ common.log('OnionShareGui', 'copy_hidservauth') if self.systemTray.supportsMessages() and self.settings.get('systray_notifications'): - self.status_bar.showMessage(strings._('gui_copied_hidservauth', True), 2000) + self.systemTray.showMessage(strings._('gui_copied_hidservauth_title', True), strings._('gui_copied_hidservauth', True)) def clear_message(self): """ diff --git a/share/locale/en.json b/share/locale/en.json index 2daff998..2d1590da 100644 --- a/share/locale/en.json +++ b/share/locale/en.json @@ -44,8 +44,10 @@ "gui_copy_hidservauth": "Copy HidServAuth", "gui_downloads": "Downloads:", "gui_canceled": "Canceled", - "gui_copied_url": "Copied address to clipboard", - "gui_copied_hidservauth": "Copied HidServAuth line to clipboard", + "gui_copied_url_title": "Copied Onion address", + "gui_copied_url": "The Onion address has been copied to clipboard", + "gui_copied_hidservauth_title": "Copied HidServAuth", + "gui_copied_hidservauth": "The HidServAuth line has been copied to clipboard", "gui_starting_server1": "Starting Tor onion service...", "gui_starting_server2": "Crunching files...", "gui_please_wait": "Please wait...",