Browse Source

Fallback to GLib DBus if Qt Dbus is not available

pull/312/head
fsantini 3 years ago
parent
commit
a96daddcd8
1 changed files with 8 additions and 3 deletions
  1. +8
    -3
      src/cadence.py

+ 8
- 3
src/cadence.py View File

@@ -52,10 +52,15 @@ from subprocess import getoutput

try:
import dbus
from dbus.mainloop.pyqt5 import DBusQtMainLoop
from dbus.mainloop.pyqt5 import DBusQtMainLoop as DBusMainLoop
haveDBus = True
except:
haveDBus = False
try:
# Try falling back to GMainLoop
from dbus.mainloop.glib import DBusGMainLoop as DBusMainLoop
haveDBus = True
except:
haveDBus = False

# ------------------------------------------------------------------------------------------------------------
# Check for PulseAudio and Wine
@@ -2359,7 +2364,7 @@ if __name__ == '__main__':
app.setWindowIcon(QIcon(":/scalable/cadence.svg"))

if haveDBus:
gDBus.loop = DBusQtMainLoop(set_as_default=True)
gDBus.loop = DBusMainLoop(set_as_default=True)
gDBus.bus = dbus.SessionBus(mainloop=gDBus.loop)

initSystemChecks()


Loading…
Cancel
Save