mirror of
https://github.com/onionshare/onionshare.git
synced 2025-05-04 23:45:04 -04:00
Add desktop notification messages on download events (via systray)
This commit is contained in:
parent
d3eeda887b
commit
3766a6048d
4 changed files with 40 additions and 0 deletions
|
@ -52,9 +52,15 @@ 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))
|
||||
|
||||
# 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 = QtWidgets.QGroupBox(strings._("gui_settings_sharing_label", True))
|
||||
sharing_group.setLayout(sharing_group_layout)
|
||||
|
||||
|
@ -257,6 +263,12 @@ 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)
|
||||
|
||||
use_stealth = self.old_settings.get('use_stealth')
|
||||
if use_stealth:
|
||||
self.stealth_checkbox.setCheckState(QtCore.Qt.Checked)
|
||||
|
@ -499,6 +511,7 @@ 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('use_stealth', self.stealth_checkbox.isChecked())
|
||||
|
||||
if self.connection_type_bundled_radio.isChecked():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue