Fixed program crash if OS doesn't support baloon notification
This commit is contained in:
parent
66020b44a5
commit
b04cb9a6ff
|
@ -22,7 +22,7 @@ from datetime import datetime, date, time
|
|||
|
||||
#variables
|
||||
programTitle = "Mail Notifier"
|
||||
programVersion = "3.01"
|
||||
programVersion = "3.01-dev"
|
||||
settings = QSettings(os.path.expanduser("~")+"/.config/mail-notifier/settings.conf", QSettings.NativeFormat)
|
||||
def GlobalSettingsExist():
|
||||
if ((settings.contains("CheckInterval") and settings.value("CheckInterval") != "") and
|
||||
|
@ -438,9 +438,12 @@ def mail_check():
|
|||
# check was successfull, lastCheckCount is updating
|
||||
window.lastCheckCount = mail_count
|
||||
def notify(message):
|
||||
try:
|
||||
if settings.value("Notify"):
|
||||
subprocess.Popen(['notify-send', programTitle, message])
|
||||
return
|
||||
except:
|
||||
print(message)
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue