Exemplo n.º 1
0
	def __init__(self, adapter=None, inst=None):
		cr = gtk.CellRendererText()
		cr.props.ellipsize = pango.ELLIPSIZE_END
		data = [
			#device picture
			["device_pb", 'GdkPixbuf', gtk.CellRendererPixbuf(), {"pixbuf":0}, None],
			
			#device caption
			["caption", str, cr, {"markup":1}, None, {"expand": True}],

			
			["rssi_pb", 'GdkPixbuf', gtk.CellRendererPixbuf(), {"pixbuf":2}, None, {"spacing": 0, "sizing": gtk.TREE_VIEW_COLUMN_AUTOSIZE}],
			["lq_pb", 'GdkPixbuf', gtk.CellRendererPixbuf(), {"pixbuf":3}, None, {"spacing": 0, "sizing": gtk.TREE_VIEW_COLUMN_AUTOSIZE}],
			["tpl_pb", 'GdkPixbuf', gtk.CellRendererPixbuf(), {"pixbuf":4}, None, {"spacing": 0, "sizing": gtk.TREE_VIEW_COLUMN_AUTOSIZE}],
			
			#trusted/bonded icons
			#["tb_icons", 'PyObject', CellRendererPixbufTable(), {"pixbuffs":5}, None],
			
			["connected", bool], #used for quick access instead of device.GetProperties
			["bonded", bool], #used for quick access instead of device.GetProperties
			["trusted", bool], #used for quick access instead of device.GetProperties	
			["fake", bool], #used for quick access instead of device.GetProperties, 
					#fake determines whether device is "discovered" or a real bluez device
			
			["rssi", float],
			["lq", float],
			["tpl", float],
			["orig_icon", 'GdkPixbuf'],
			["cell_fader", gobject.TYPE_PYOBJECT],
			["row_fader", gobject.TYPE_PYOBJECT],
			["levels_visible", bool],
			["initial_anim", bool],
		]
		DeviceList.__init__(self, adapter, data)
		self.set_headers_visible(False)
		self.props.has_tooltip = True
		self.Blueman = inst
		
		self.connect("query-tooltip", self.tooltip_query)		
		self.tooltip_row = -1
		self.tooltip_col = None
		
		self.connect("button_press_event", self.on_event_clicked)
		self.connect("button_release_event", self.on_event_clicked)
		
		self.menu = None
		
		self.connect("drag_data_received", self.drag_recv)
		self.connect("drag-motion", self.drag_motion)

		self.drag_dest_set(gtk.DEST_DEFAULT_ALL, [], gtk.gdk.ACTION_COPY|gtk.gdk.ACTION_DEFAULT)
		self.drag_dest_add_uri_targets()
		
		self.set_search_equal_func(self.search_func)
Exemplo n.º 2
0
    def __init__(self, adapter=None, inst=None):
        cr = Gtk.CellRendererText()
        cr.props.ellipsize = Pango.EllipsizeMode.END
        data = [
            # device picture
            ["device_pb", GdkPixbuf.Pixbuf, Gtk.CellRendererPixbuf(), {"pixbuf": 0}, None],
            # device caption
            ["caption", str, cr, {"markup": 1}, None, {"expand": True}],


            ["rssi_pb", GdkPixbuf.Pixbuf, Gtk.CellRendererPixbuf(), {"pixbuf": 2}, None, {"spacing": 0}],
            ["lq_pb", GdkPixbuf.Pixbuf, Gtk.CellRendererPixbuf(), {"pixbuf": 3}, None, {"spacing": 0}],
            ["tpl_pb", GdkPixbuf.Pixbuf, Gtk.CellRendererPixbuf(), {"pixbuf": 4}, None, {"spacing": 0}],
            # trusted/bonded icons
            # ["tb_icons", 'PyObject', CellRendererPixbufTable(), {"pixbuffs":5}, None],

            ["connected", bool], # used for quick access instead of device.GetProperties
            ["bonded", bool], # used for quick access instead of device.GetProperties
            ["trusted", bool], # used for quick access instead of device.GetProperties
            ["fake", bool], # used for quick access instead of device.GetProperties,
            # fake determines whether device is "discovered" or a real bluez device

            ["rssi", float],
            ["lq", float],
            ["tpl", float],
            ["orig_icon", GdkPixbuf.Pixbuf],
            ["cell_fader", GObject.TYPE_PYOBJECT],
            ["row_fader", GObject.TYPE_PYOBJECT],
            ["levels_visible", bool],
            ["initial_anim", bool],
        ]
        DeviceList.__init__(self, adapter, data)
        self.set_name("ManagerDeviceList")
        self.set_headers_visible(False)
        self.props.has_tooltip = True
        self.Blueman = inst

        self.connect("query-tooltip", self.tooltip_query)
        self.tooltip_row = None
        self.tooltip_col = None

        self.connect("button_press_event", self.on_event_clicked)
        self.connect("button_release_event", self.on_event_clicked)

        self.menu = None

        self.connect("drag_data_received", self.drag_recv)
        self.connect("drag-motion", self.drag_motion)

        Gtk.Widget.drag_dest_set(self, Gtk.DestDefaults.ALL, [], Gdk.DragAction.COPY | Gdk.DragAction.DEFAULT)
        Gtk.Widget.drag_dest_add_uri_targets(self)

        self.set_search_equal_func(self.search_func, None)
Exemplo n.º 3
0
    def __init__(self, adapter=None):
        cr = Gtk.CellRendererText()
        cr.props.ellipsize = Pango.EllipsizeMode.END
        data = [
            #device picture
            [
                "found_pb", GdkPixbuf.Pixbuf,
                Gtk.CellRendererPixbuf(), {
                    "pixbuf": 0
                }, None, {
                    "spacing": 0,
                    "sizing": Gtk.TreeViewColumnSizing.AUTOSIZE
                }
            ],
            [
                "device_pb", GdkPixbuf.Pixbuf,
                Gtk.CellRendererPixbuf(), {
                    "pixbuf": 1
                }, None
            ],

            #device caption
            ["caption", str, cr, {
                "markup": 2
            }, None, {
                "expand": True
            }],
            [
                "bonded_icon", GdkPixbuf.Pixbuf,
                Gtk.CellRendererPixbuf(), {
                    "pixbuf": 3
                }, None
            ],
            [
                "trusted_icon", GdkPixbuf.Pixbuf,
                Gtk.CellRendererPixbuf(), {
                    "pixbuf": 4
                }, None
            ]

            #["connected", bool], #used for quick access instead of device.GetProperties
            #["bonded", bool], #used for quick access instead of device.GetProperties
            #["trusted", bool], #used for quick access instead of device.GetProperties
            #["fake", bool], #used for quick access instead of device.GetProperties,
            #fake determines whether device is "discovered" or a real bluez device
        ]

        DeviceList.__init__(self, adapter, data)
        self.props.headers_visible = False
Exemplo n.º 4
0
    def __init__(self, adapter=None, inst=None):
        cr = Gtk.CellRendererText()
        cr.props.ellipsize = Pango.EllipsizeMode.END
        data = [
            # device picture
            ["device_pb", GdkPixbuf.Pixbuf, Gtk.CellRendererPixbuf(), {"pixbuf": 0}, None],
            # device caption
            ["caption", str, cr, {"markup": 1}, None, {"expand": True}],
            ["rssi_pb", GdkPixbuf.Pixbuf, Gtk.CellRendererPixbuf(), {"pixbuf": 2}, None, {"spacing": 0}],
            ["lq_pb", GdkPixbuf.Pixbuf, Gtk.CellRendererPixbuf(), {"pixbuf": 3}, None, {"spacing": 0}],
            ["tpl_pb", GdkPixbuf.Pixbuf, Gtk.CellRendererPixbuf(), {"pixbuf": 4}, None, {"spacing": 0}],
            # trusted/bonded icons
            # ["tb_icons", 'PyObject', CellRendererPixbufTable(), {"pixbuffs":5}, None],
            ["connected", bool],  # used for quick access instead of device.GetProperties
            ["bonded", bool],  # used for quick access instead of device.GetProperties
            ["trusted", bool],  # used for quick access instead of device.GetProperties
            ["fake", bool],  # used for quick access instead of device.GetProperties,
            # fake determines whether device is "discovered" or a real bluez device
            ["rssi", float],
            ["lq", float],
            ["tpl", float],
            ["orig_icon", GdkPixbuf.Pixbuf],
            ["cell_fader", GObject.TYPE_PYOBJECT],
            ["row_fader", GObject.TYPE_PYOBJECT],
            ["levels_visible", bool],
            ["initial_anim", bool],
        ]
        DeviceList.__init__(self, adapter, data)
        self.set_name("ManagerDeviceList")
        self.set_headers_visible(False)
        self.props.has_tooltip = True
        self.Blueman = inst

        self.connect("query-tooltip", self.tooltip_query)
        self.tooltip_row = None
        self.tooltip_col = None

        self.connect("button_press_event", self.on_event_clicked)
        self.connect("button_release_event", self.on_event_clicked)

        self.menu = None

        self.connect("drag_data_received", self.drag_recv)
        self.connect("drag-motion", self.drag_motion)

        Gtk.Widget.drag_dest_set(self, Gtk.DestDefaults.ALL, [], Gdk.DragAction.COPY | Gdk.DragAction.DEFAULT)
        Gtk.Widget.drag_dest_add_uri_targets(self)

        self.set_search_equal_func(self.search_func, None)
Exemplo n.º 5
0
	def device_remove_event(self, device, iter):
		if device.Temp:
			DeviceList.device_remove_event(self, device, iter)
		else:
			row_fader = self.get(iter, "row_fader")["row_fader"]
		
			def on_finished(fader):
			
				fader.disconnect(signal)
				fader.freeze()
				DeviceList.device_remove_event(self, device, iter)	
		
			signal = row_fader.connect("animation-finished", on_finished)
			row_fader.thaw()
			self.emit("device-selected", None, None)
			row_fader.animate(start=row_fader.get_state(), end=0.0, duration=400)
Exemplo n.º 6
0
    def device_remove_event(self, device, iter):
        if device.Temp:
            DeviceList.device_remove_event(self, device, iter)
        else:
            row_fader = self.get(iter, "row_fader")["row_fader"]

            def on_finished(fader):

                fader.disconnect(signal)
                fader.freeze()
                DeviceList.device_remove_event(self, device, iter)

            signal = row_fader.connect("animation-finished", on_finished)
            row_fader.thaw()
            self.emit("device-selected", None, None)
            row_fader.animate(start=row_fader.get_state(), end=0.0, duration=400)
Exemplo n.º 7
0
	def __init__(self, adapter=None):
		cr = gtk.CellRendererText()
		cr.props.ellipsize = pango.ELLIPSIZE_END
		data = [
			#device picture
			["found_pb", 'GdkPixbuf', gtk.CellRendererPixbuf(), {"pixbuf":0}, None, {"spacing": 0, "sizing": gtk.TREE_VIEW_COLUMN_AUTOSIZE}],
			["device_pb", 'GdkPixbuf', gtk.CellRendererPixbuf(), {"pixbuf":1}, None],
			
			#device caption
			["caption", str, cr, {"markup":2}, None, {"expand": True}],

			["bonded_icon", 'GdkPixbuf', gtk.CellRendererPixbuf(), {"pixbuf":3}, None],
			["trusted_icon", 'GdkPixbuf', gtk.CellRendererPixbuf(), {"pixbuf":4}, None]
			
			#["connected", bool], #used for quick access instead of device.GetProperties
			#["bonded", bool], #used for quick access instead of device.GetProperties
			#["trusted", bool], #used for quick access instead of device.GetProperties	
			#["fake", bool], #used for quick access instead of device.GetProperties, 
					#fake determines whether device is "discovered" or a real bluez device
		]
		
		DeviceList.__init__(self, adapter, data)
		self.props.headers_visible = False
Exemplo n.º 8
0
            def on_finished(fader):

                fader.disconnect(signal)
                fader.freeze()
                DeviceList.device_remove_event(self, device, iter)
Exemplo n.º 9
0
			def on_finished(fader):
			
				fader.disconnect(signal)
				fader.freeze()
				DeviceList.device_remove_event(self, device, iter)