diff --git a/onionshare/settings.py b/onionshare/settings.py index 1c7638c0..a79ec9a6 100644 --- a/onionshare/settings.py +++ b/onionshare/settings.py @@ -59,7 +59,6 @@ class Settings(object): 'auth_type': 'no_auth', 'auth_password': '', 'close_after_first_download': True, - 'systray_notifications': True, 'shutdown_timeout': False, 'use_stealth': False, 'use_autoupdate': True, diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index 292564f2..14c4d22a 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -357,8 +357,7 @@ class OnionShareGui(QtWidgets.QMainWindow): if not self.onion.is_authenticated(): self.timer.stop() self.status_bar.showMessage(strings._('gui_tor_connection_lost', True)) - if self.system_tray.supportsMessages() and self.settings.get('systray_notifications'): - self.system_tray.showMessage(strings._('gui_tor_connection_lost', True), strings._('gui_tor_connection_error_settings', True)) + self.system_tray.showMessage(strings._('gui_tor_connection_lost', True), strings._('gui_tor_connection_error_settings', True)) self.share_mode.handle_tor_broke() @@ -401,16 +400,14 @@ class OnionShareGui(QtWidgets.QMainWindow): When the URL gets copied to the clipboard, display this in the status bar. """ self.common.log('OnionShareGui', 'copy_url') - if self.system_tray.supportsMessages() and self.common.settings.get('systray_notifications'): - self.system_tray.showMessage(strings._('gui_copied_url_title', True), strings._('gui_copied_url', True)) + self.system_tray.showMessage(strings._('gui_copied_url_title', True), strings._('gui_copied_url', True)) def copy_hidservauth(self): """ When the stealth onion service HidServAuth gets copied to the clipboard, display this in the status bar. """ self.common.log('OnionShareGui', 'copy_hidservauth') - if self.system_tray.supportsMessages() and self.common.settings.get('systray_notifications'): - self.system_tray.showMessage(strings._('gui_copied_hidservauth_title', True), strings._('gui_copied_hidservauth', True)) + self.system_tray.showMessage(strings._('gui_copied_hidservauth_title', True), strings._('gui_copied_hidservauth', True)) def clear_message(self): """ diff --git a/onionshare_gui/settings_dialog.py b/onionshare_gui/settings_dialog.py index 07353153..a80ec7ff 100644 --- a/onionshare_gui/settings_dialog.py +++ b/onionshare_gui/settings_dialog.py @@ -59,11 +59,6 @@ class SettingsDialog(QtWidgets.QDialog): self.close_after_first_download_checkbox.setCheckState(QtCore.Qt.Checked) self.close_after_first_download_checkbox.setText(strings._("gui_settings_close_after_first_download_option", True)) - # Whether or not to show systray notifications - self.systray_notifications_checkbox = QtWidgets.QCheckBox() - self.systray_notifications_checkbox.setCheckState(QtCore.Qt.Checked) - self.systray_notifications_checkbox.setText(strings._("gui_settings_systray_notifications", True)) - # Whether or not to use a shutdown timer self.shutdown_timeout_checkbox = QtWidgets.QCheckBox() self.shutdown_timeout_checkbox.setCheckState(QtCore.Qt.Checked) @@ -77,7 +72,6 @@ class SettingsDialog(QtWidgets.QDialog): # Sharing options layout sharing_group_layout = QtWidgets.QVBoxLayout() sharing_group_layout.addWidget(self.close_after_first_download_checkbox) - sharing_group_layout.addWidget(self.systray_notifications_checkbox) sharing_group_layout.addWidget(self.shutdown_timeout_checkbox) sharing_group_layout.addWidget(self.save_private_key_checkbox) sharing_group = QtWidgets.QGroupBox(strings._("gui_settings_sharing_label", True)) @@ -386,12 +380,6 @@ class SettingsDialog(QtWidgets.QDialog): else: self.close_after_first_download_checkbox.setCheckState(QtCore.Qt.Unchecked) - systray_notifications = self.old_settings.get('systray_notifications') - if systray_notifications: - self.systray_notifications_checkbox.setCheckState(QtCore.Qt.Checked) - else: - self.systray_notifications_checkbox.setCheckState(QtCore.Qt.Unchecked) - shutdown_timeout = self.old_settings.get('shutdown_timeout') if shutdown_timeout: self.shutdown_timeout_checkbox.setCheckState(QtCore.Qt.Checked) @@ -760,7 +748,6 @@ class SettingsDialog(QtWidgets.QDialog): settings.load() # To get the last update timestamp settings.set('close_after_first_download', self.close_after_first_download_checkbox.isChecked()) - settings.set('systray_notifications', self.systray_notifications_checkbox.isChecked()) settings.set('shutdown_timeout', self.shutdown_timeout_checkbox.isChecked()) if self.save_private_key_checkbox.isChecked(): settings.set('save_private_key', True) diff --git a/onionshare_gui/share_mode.py b/onionshare_gui/share_mode.py index d248f2ff..008fb910 100644 --- a/onionshare_gui/share_mode.py +++ b/onionshare_gui/share_mode.py @@ -195,8 +195,7 @@ class ShareMode(QtWidgets.QWidget): self.downloads_in_progress += 1 self.update_downloads_in_progress(self.downloads_in_progress) - if self.system_tray.supportsMessages() and self.common.settings.get('systray_notifications'): - self.system_tray.showMessage(strings._('systray_download_started_title', True), strings._('systray_download_started_message', True)) + self.system_tray.showMessage(strings._('systray_download_started_title', True), strings._('systray_download_started_message', True)) def handle_request_rate_limit(self, event): """ @@ -213,8 +212,8 @@ class ShareMode(QtWidgets.QWidget): # Is the download complete? if event["data"]["bytes"] == self.web.zip_filesize: - if self.system_tray.supportsMessages() and self.common.settings.get('systray_notifications'): - self.system_tray.showMessage(strings._('systray_download_completed_title', True), strings._('systray_download_completed_message', True)) + self.system_tray.showMessage(strings._('systray_download_completed_title', True), strings._('systray_download_completed_message', True)) + # Update the total 'completed downloads' info self.downloads_completed += 1 self.update_downloads_completed(self.downloads_completed) @@ -242,8 +241,7 @@ class ShareMode(QtWidgets.QWidget): # Update the 'in progress downloads' info self.downloads_in_progress -= 1 self.update_downloads_in_progress(self.downloads_in_progress) - if self.system_tray.supportsMessages() and self.common.settings.get('systray_notifications'): - self.system_tray.showMessage(strings._('systray_download_canceled_title', True), strings._('systray_download_canceled_message', True)) + self.system_tray.showMessage(strings._('systray_download_canceled_title', True), strings._('systray_download_canceled_message', True)) def update_primary_action(self): # Show or hide primary action layout diff --git a/share/locale/da.json b/share/locale/da.json index 2c8d0c78..af0789b9 100644 --- a/share/locale/da.json +++ b/share/locale/da.json @@ -75,7 +75,6 @@ "gui_settings_autoupdate_check_button": "Søg efter opdateringer", "gui_settings_sharing_label": "Valgmuligheder for deling", "gui_settings_close_after_first_download_option": "Stop deling efter første download", - "gui_settings_systray_notifications": "Vis skrivebordsnotifikationer", "gui_settings_connection_type_label": "Hvordan skal OnionShare oprette forbindelse til Tor?", "gui_settings_connection_type_bundled_option": "Brug Tor som er bundet med OnionShare", "gui_settings_connection_type_automatic_option": "Prøv automatisk konfiguration med Tor Browser", diff --git a/share/locale/en.json b/share/locale/en.json index 2c2a824e..7d240b59 100644 --- a/share/locale/en.json +++ b/share/locale/en.json @@ -86,7 +86,6 @@ "gui_settings_autoupdate_check_button": "Check For Updates", "gui_settings_sharing_label": "Sharing options", "gui_settings_close_after_first_download_option": "Stop sharing after first download", - "gui_settings_systray_notifications": "Show desktop notifications", "gui_settings_connection_type_label": "How should OnionShare connect to Tor?", "gui_settings_connection_type_bundled_option": "Use Tor that is bundled with OnionShare", "gui_settings_connection_type_automatic_option": "Attempt automatic configuration with Tor Browser", diff --git a/share/locale/nl.json b/share/locale/nl.json index 3dd74664..3af1e0d8 100644 --- a/share/locale/nl.json +++ b/share/locale/nl.json @@ -74,7 +74,6 @@ "gui_settings_autoupdate_check_button": "Controleer voor update", "gui_settings_sharing_label": "Deel opties", "gui_settings_close_after_first_download_option": "Stop delen na eerste download", - "gui_settings_systray_notifications": "Laat desktop notificaties zien", "gui_settings_connection_type_label": "Hoe moet OnionShare verbinden met Tor?", "gui_settings_connection_type_bundled_option": "Gebruik Tor die is meegeleverd met OnionShare", "gui_settings_connection_type_automatic_option": "Probeer automatische configuratie met Tor Browser", diff --git a/test/test_onionshare_settings.py b/test/test_onionshare_settings.py index 67fd7b38..116e5356 100644 --- a/test/test_onionshare_settings.py +++ b/test/test_onionshare_settings.py @@ -51,7 +51,6 @@ class TestSettings: 'auth_type': 'no_auth', 'auth_password': '', 'close_after_first_download': True, - 'systray_notifications': True, 'shutdown_timeout': False, 'use_stealth': False, 'use_autoupdate': True, @@ -119,7 +118,6 @@ class TestSettings: assert settings_obj.get('auth_type') == 'no_auth' assert settings_obj.get('auth_password') == '' assert settings_obj.get('close_after_first_download') is True - assert settings_obj.get('systray_notifications') is True assert settings_obj.get('use_stealth') is False assert settings_obj.get('use_autoupdate') is True assert settings_obj.get('autoupdate_timestamp') is None