def do_connect_headset(self):
     try:
         self.headset_service.hs_connect()
         if self.headset_service.get_state() == "connected":
             notify_message(_("Bluetooth Headset"),
                            _("Successfully connected to the Bluetooth headset."))
         else:
             notify_message(_("Connection Failed"), _("An error occured when connecting to the device."))
         self.emit_redraw_request()
     except Exception, e:
         print "Exception:", e
 def do_connect_audio_sink(self):
     try:
         self.audio_sink_service.as_connect()
         if self.audio_sink_service.get_state() == "connected":
             notify_message(_("Bluetooth Audio"),
                            _("Successfully connected to the Bluetooth audio device."))
         else:
             notify_message(_("Connection Failed"), _("An error occured when connecting to the device."))
         self.emit_redraw_request()
     except Exception, e:
         print "Exception:", e
 def do_connect_input_service():
     try:
         self.input_service = Input(self.device.device_path)
         self.input_service.i_connect()
         if self.input_service.get_connected():
             notify_message(_("Bluetooth Input Service"),
                            _("Successfully connected to the Bluetooth input device."))
         else:
             notify_message(_("Connection Failed"), _("An error occured when connecting to the device."))
             self.emit_redraw_request()
     except Exception, e:
         print "Exception:", e
 def do_connect_headset(self):
     try:
         self.headset_service.hs_connect()
         if self.headset_service.get_state() == "connected":
             notify_message(
                 _("Bluetooth Headset"),
                 _("Successfully connected to the Bluetooth headset."))
         else:
             notify_message(
                 _("Connection Failed"),
                 _("An error occured when connecting to the device."))
         self.emit_redraw_request()
     except Exception, e:
         print "Exception:", e
 def do_connect_audio_sink(self):
     try:
         self.audio_sink_service.as_connect()
         if self.audio_sink_service.get_state() == "connected":
             notify_message(
                 _("Bluetooth Audio"),
                 _("Successfully connected to the Bluetooth audio device."))
         else:
             notify_message(
                 _("Connection Failed"),
                 _("An error occured when connecting to the device."))
         self.emit_redraw_request()
     except Exception, e:
         print "Exception:", e
 def do_connect_input_service(self):
     try:
         self.input_service.i_connect()
         print self.input_service.get_connected()
         if self.input_service.get_connected() == True:
             notify_message(
                 _("Bluetooth Input Service"),
                 _("Successfully connected to the Bluetooth input device."))
         else:
             notify_message(
                 _("Connection Failed"),
                 _("An error occured when connecting to the device."))
         self.emit_redraw_request()
     except Exception, e:
         print "Exception:", e