def icon_item_double_click(self, x, y):
        '''
        Handle double click event.
        '''
        if self.is_paired:
            if is_bluetooth_file_type(self.device):
                self.do_send_file()
            elif is_bluetooth_audio_type(self.device):
                self.do_connect_audio_sink()
            return

        self.do_pair()
    def icon_item_double_click(self, x, y):
        '''
        Handle double click event.
        '''
        if self.is_paired:
            if is_bluetooth_file_type(self.device):
                self.do_send_file()
            elif is_bluetooth_audio_type(self.device):
                self.do_connect_audio_sink()
            return

        self.do_pair()
                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

        if is_bluetooth_audio_type(self.device):
            return do_connect_audio_sink
        elif is_bluetooth_file_type(self.device):
            return do_send_file
        elif is_bluetooth_input_type(self.device):
            return do_connect_input_service
        else:
            return None

    def __render_name(self, cr, rect):
        name_width = 130

        cr.set_source_rgb(1, 1, 1)
        cr.rectangle(rect.x, rect.y, rect.width, rect.height)
        cr.fill()
Example #4
0
                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

        if is_bluetooth_audio_type(self.device):
            return do_connect_audio_sink
        elif is_bluetooth_file_type(self.device):
            return do_send_file
        elif is_bluetooth_input_type(self.device):
            return do_connect_input_service
        else:
            return None

    def __render_name(self, cr, rect):
        name_width = 130

        cr.set_source_rgb(1, 1, 1)
        cr.rectangle(rect.x, rect.y, rect.width, rect.height)
        cr.fill()