Changeset 804

Show
Ignore:
Timestamp:
01/04/08 12:29:19 (16 years ago)
Author:
arnonym
Message:

Try to start ffado-dbus-server if it can't be found on the DBus.

This is probably not the right solution, it would be better to register the server as a dbus-service and request that service so dbus autostarts it.
And the error handling isn't that nice either. if ffado-dbus-server can't be started, it keeps on asking until you press "No".
And probably the time to wait for the next try is to short or to long...

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/support/mixer/ffadomixer.in

    r802 r804  
    2626sys.path.append( "$PYTHONDIR" ) 
    2727 
     28import os 
     29import time 
    2830import dbus 
    2931from qt import * 
     
    151153    msg = QMessageBox() 
    152154 
    153     try: 
    154         devmgr=DeviceManagerInterface(server, basepath) 
    155     except dbus.DBusException, ex: 
    156         print "\n" 
    157         print "===========================================================" 
    158         print "ERROR: Could not communicate with the FFADO DBus service..." 
    159         print "===========================================================" 
    160         print "\n" 
    161         msg.warning( msg, "FFADO-DBus not found", "<qt><b>The connection to FFADOs DBus service could not be established.</b><p>Maybe you didn't start ffado-dbus-server?</qt>" ) 
    162         sys.exit(-1) 
     155    repeat = 1 
     156    while repeat > 0: 
     157        try: 
     158            devmgr=DeviceManagerInterface(server, basepath) 
     159            repeat -= 1 
     160        except dbus.DBusException, ex: 
     161            print "\n" 
     162            print "===========================================================" 
     163            print "ERROR: Could not communicate with the FFADO DBus service..." 
     164            print "===========================================================" 
     165            print "\n" 
     166            tmp = msg.question( msg, "FFADO-DBus not found", "<qt><b>The connection to FFADOs DBus service could not be established.</b><p>Probably you didn't start the ffado-dbus-server. Should I try this now?</qt>", QMessageBox.Yes, QMessageBox.No ) 
     167            if tmp == 4: 
     168                sys.exit(-1) 
     169            else: 
     170                os.spawnlp( os.P_NOWAIT, "ffado-dbus-server" ) 
     171                time.sleep( 2.5 ) 
     172 
    163173     
    164174    nbDevices=devmgr.getNbDevices()