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
|
#variables
|
||||||
programTitle = "Mail Notifier"
|
programTitle = "Mail Notifier"
|
||||||
programVersion = "3.01"
|
programVersion = "3.01-dev"
|
||||||
settings = QSettings(os.path.expanduser("~")+"/.config/mail-notifier/settings.conf", QSettings.NativeFormat)
|
settings = QSettings(os.path.expanduser("~")+"/.config/mail-notifier/settings.conf", QSettings.NativeFormat)
|
||||||
def GlobalSettingsExist():
|
def GlobalSettingsExist():
|
||||||
if ((settings.contains("CheckInterval") and settings.value("CheckInterval") != "") and
|
if ((settings.contains("CheckInterval") and settings.value("CheckInterval") != "") and
|
||||||
|
@ -438,9 +438,12 @@ def mail_check():
|
||||||
# check was successfull, lastCheckCount is updating
|
# check was successfull, lastCheckCount is updating
|
||||||
window.lastCheckCount = mail_count
|
window.lastCheckCount = mail_count
|
||||||
def notify(message):
|
def notify(message):
|
||||||
|
try:
|
||||||
if settings.value("Notify"):
|
if settings.value("Notify"):
|
||||||
subprocess.Popen(['notify-send', programTitle, message])
|
subprocess.Popen(['notify-send', programTitle, message])
|
||||||
return
|
return
|
||||||
|
except:
|
||||||
|
print(message)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue