Do not crash when no notification service present
This commit is contained in:
parent
c2038ec20b
commit
2221dcee36
@ -28,7 +28,7 @@ import fcntl
|
|||||||
import errno
|
import errno
|
||||||
from PyQt4.QtCore import *
|
from PyQt4.QtCore import *
|
||||||
from PyQt4.QtGui import *
|
from PyQt4.QtGui import *
|
||||||
from PyQt4.QtDBus import QDBus,QDBusVariant
|
from PyQt4.QtDBus import QDBus,QDBusVariant, QDBusMessage
|
||||||
from PyQt4.QtDBus import QDBusConnection
|
from PyQt4.QtDBus import QDBusConnection
|
||||||
from PyQt4.QtDBus import QDBusInterface,QDBusAbstractAdaptor
|
from PyQt4.QtDBus import QDBusInterface,QDBusAbstractAdaptor
|
||||||
|
|
||||||
@ -1564,10 +1564,13 @@ class QubesTrayIcon(QSystemTrayIcon):
|
|||||||
|
|
||||||
self.connect (self, SIGNAL("activated (QSystemTrayIcon::ActivationReason)"), self.icon_clicked)
|
self.connect (self, SIGNAL("activated (QSystemTrayIcon::ActivationReason)"), self.icon_clicked)
|
||||||
|
|
||||||
|
self.tray_notifier_type = None
|
||||||
self.tray_notifier = QDBusInterface("org.freedesktop.Notifications",
|
self.tray_notifier = QDBusInterface("org.freedesktop.Notifications",
|
||||||
"/org/freedesktop/Notifications",
|
"/org/freedesktop/Notifications",
|
||||||
"org.freedesktop.Notifications", session_bus)
|
"org.freedesktop.Notifications", session_bus)
|
||||||
srv_info = self.tray_notifier.call("GetServerInformation")
|
srv_info = self.tray_notifier.call("GetServerInformation")
|
||||||
|
if srv_info.type() == QDBusMessage.ReplyMessage and len(srv_info
|
||||||
|
.arguments()) > 1:
|
||||||
self.tray_notifier_type = srv_info.arguments()[1]
|
self.tray_notifier_type = srv_info.arguments()[1]
|
||||||
|
|
||||||
def update_blk_menu(self):
|
def update_blk_menu(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user