MCPcopy
hub / github.com/persepolisdm/persepolis / notifySend

Function notifySend

persepolis/scripts/bubble.py:143–175  ·  view source on GitHub ↗
(message1, message2, time, sound, parent=None)

Source from the content-addressed store, hash-verified

141
142
143def notifySend(message1, message2, time, sound, parent=None):
144
145 file = getSoundPath(sound)
146 if file is not None:
147 playNotification(file)
148
149 # load settings
150 persepolis_setting = QSettings('persepolis_download_manager', 'persepolis')
151
152 enable_notification = persepolis_setting.value('settings/notification')
153
154 time = str(time)
155 message1 = str(message1)
156 message2 = str(message2)
157
158 # using Qt notification or Native system notification
159 if enable_notification == 'QT notification':
160 parent.system_tray_icon.showMessage(message1, message2, QIcon.fromTheme('persepolis-tray', QIcon(':/persepolis-tray.svg')), 10000)
161
162 else:
163 if os_type in OS.LINUX and dasbus_is_installed:
164 bus = SessionMessageBus()
165
166 proxy = bus.get_proxy(
167 "org.freedesktop.Notifications",
168 "/org/freedesktop/Notifications"
169 )
170
171 proxy.Notify(
172 "Persepolis", 0, QIcon.fromTheme('persepolis-tray', QIcon(':/persepolis-tray.svg')).name(), message1, message2, [], {}, 10000)
173
174 else:
175 parent.system_tray_icon.showMessage(message1, message2, QIcon.fromTheme('persepolis-tray', QIcon(':/persepolis-tray.svg')), 10000)

Callers 15

notifySendFromThreadMethod · 0.90
newVersionIsAvailableMethod · 0.90
checkDownloadInfoMethod · 0.90
callBackMethod · 0.90
resumeButtonPressedMethod · 0.90
stopButtonPressedMethod · 0.90
pauseButtonPressedMethod · 0.90
openDownloadFolderMethod · 0.90
openFileMethod · 0.90
removeSelected2Method · 0.90

Calls 2

playNotificationFunction · 0.90
getSoundPathFunction · 0.85

Tested by

no test coverage detected