diff --git a/blueman/gui/manager/ManagerDeviceList.py b/blueman/gui/manager/ManagerDeviceList.py index 177f28929..ab9918d99 100644 --- a/blueman/gui/manager/ManagerDeviceList.py +++ b/blueman/gui/manager/ManagerDeviceList.py @@ -48,9 +48,6 @@ def __init__(self, adapter: Optional[str] = None, inst: Optional["Blueman"] = No {"id": "rssi_pb", "type": GdkPixbuf.Pixbuf, "renderer": Gtk.CellRendererPixbuf(), "render_attrs": {}, "view_props": {"spacing": 0}, "celldata_func": (self._set_cell_data, "rssi")}, - {"id": "lq_pb", "type": GdkPixbuf.Pixbuf, "renderer": Gtk.CellRendererPixbuf(), - "render_attrs": {}, "view_props": {"spacing": 0}, - "celldata_func": (self._set_cell_data, "lq")}, {"id": "tpl_pb", "type": GdkPixbuf.Pixbuf, "renderer": Gtk.CellRendererPixbuf(), "render_attrs": {}, "view_props": {"spacing": 0}, "celldata_func": (self._set_cell_data, "tpl")}, @@ -61,7 +58,6 @@ def __init__(self, adapter: Optional[str] = None, inst: Optional["Blueman"] = No {"id": "objpush", "type": bool}, # used to set Send File button {"id": "battery", "type": float}, {"id": "rssi", "type": float}, - {"id": "lq", "type": float}, {"id": "tpl", "type": float}, {"id": "icon_info", "type": Gtk.IconInfo}, {"id": "cell_fader", "type": CellFade}, @@ -474,22 +470,18 @@ def _update_power_levels(self, tree_iter: Gtk.TreeIter, device: Device, cinfo: c # cinfo init may fail for bluetooth devices version 4 and up # FIXME Workaround is horrible and we should show something better if cinfo.failed: - bars.update({"rssi": 100.0, "tpl": 100.0, "lq": 100.0}) + bars.update({"rssi": 100.0, "tpl": 100.0}) else: try: bars["rssi"] = max(50 + float(cinfo.get_rssi()) / 127 * 50, 10) except ConnInfoReadError: bars["rssi"] = 50 - try: - bars["lq"] = max(float(cinfo.get_lq()) / 255 * 100, 10) - except ConnInfoReadError: - bars["lq"] = 10 try: bars["tpl"] = max(50 + float(cinfo.get_tpl()) / 127 * 50, 10) except ConnInfoReadError: bars["tpl"] = 50 - if row["battery"] == row["rssi"] == row["tpl"] == row["lq"] == 0: + if row["battery"] == row["rssi"] == row["tpl"] == 0: self._prepare_fader(row["cell_fader"]).animate(start=0.0, end=1.0, duration=400) w = 14 * self.get_scale_factor() @@ -502,12 +494,12 @@ def _update_power_levels(self, tree_iter: Gtk.TreeIter, device: Device, cinfo: c self.set(tree_iter, **{name: perc, f"{name}_pb": icon}) def _disable_power_levels(self, tree_iter: Gtk.TreeIter) -> None: - row = self.get(tree_iter, "cell_fader", "battery", "rssi", "lq", "tpl") - if row["battery"] == row["rssi"] == row["tpl"] == row["lq"] == 0: + row = self.get(tree_iter, "cell_fader", "battery", "rssi", "tpl") + if row["battery"] == row["rssi"] == row["tpl"] == 0: return - self.set(tree_iter, battery=0, rssi=0, lq=0, tpl=0) - self._prepare_fader(row["cell_fader"], lambda: self.set(tree_iter, battery_pb=None, rssi_pb=None, lq_pb=None, + self.set(tree_iter, battery=0, rssi=0, tpl=0) + self._prepare_fader(row["cell_fader"], lambda: self.set(tree_iter, battery_pb=None, rssi_pb=None, tpl_pb=None)).animate(start=1.0, end=0.0, duration=400) def _prepare_fader(self, fader: AnimBase, callback: Optional[Callable[[], None]] = None) -> AnimBase: @@ -559,7 +551,6 @@ def tooltip_query(self, _tw: Gtk.Widget, x: int, y: int, _kb: bool, tooltip: Gtk elif path[1] == self.columns["battery_pb"] \ or path[1] == self.columns["tpl_pb"] \ - or path[1] == self.columns["lq_pb"] \ or path[1] == self.columns["rssi_pb"]: tree_iter = self.get_iter(path[0]) assert tree_iter is not None @@ -572,7 +563,6 @@ def tooltip_query(self, _tw: Gtk.Widget, x: int, y: int, _kb: bool, tooltip: Gtk battery = self.get(tree_iter, "battery")["battery"] rssi = self.get(tree_iter, "rssi")["rssi"] - lq = self.get(tree_iter, "lq")["lq"] tpl = self.get(tree_iter, "tpl")["tpl"] if battery != 0: @@ -600,12 +590,6 @@ def tooltip_query(self, _tw: Gtk.Widget, x: int, y: int, _kb: bool, tooltip: Gtk lines.append(_("Received Signal Strength: %(rssi)u%% (%(rssi_state)s)") % {"rssi": rssi, "rssi_state": rssi_state}) - if lq != 0: - if path[1] == self.columns["lq_pb"]: - lines.append(_("Link Quality: %(lq)u%%") % {"lq": lq}) - else: - lines.append(_("Link Quality: %(lq)u%%") % {"lq": lq}) - if tpl != 0: if tpl < 30: tpl_state = _("Low") diff --git a/data/icons/pixmaps/Makefile.am b/data/icons/pixmaps/Makefile.am index 2536c1f64..2adbd512d 100644 --- a/data/icons/pixmaps/Makefile.am +++ b/data/icons/pixmaps/Makefile.am @@ -11,16 +11,6 @@ pixmaps_DATA = \ blueman-battery-80.png \ blueman-battery-90.png \ blueman-battery-100.png \ - blueman-lq-10.png \ - blueman-lq-20.png \ - blueman-lq-30.png \ - blueman-lq-40.png \ - blueman-lq-50.png \ - blueman-lq-60.png \ - blueman-lq-70.png \ - blueman-lq-80.png \ - blueman-lq-90.png \ - blueman-lq-100.png \ blueman-rssi-10.png \ blueman-rssi-20.png \ blueman-rssi-30.png \ diff --git a/data/icons/pixmaps/blueman-lq-10.png b/data/icons/pixmaps/blueman-lq-10.png deleted file mode 100644 index 71c2b2ed9..000000000 Binary files a/data/icons/pixmaps/blueman-lq-10.png and /dev/null differ diff --git a/data/icons/pixmaps/blueman-lq-100.png b/data/icons/pixmaps/blueman-lq-100.png deleted file mode 100644 index 99b4ffb85..000000000 Binary files a/data/icons/pixmaps/blueman-lq-100.png and /dev/null differ diff --git a/data/icons/pixmaps/blueman-lq-20.png b/data/icons/pixmaps/blueman-lq-20.png deleted file mode 100644 index a354ff059..000000000 Binary files a/data/icons/pixmaps/blueman-lq-20.png and /dev/null differ diff --git a/data/icons/pixmaps/blueman-lq-30.png b/data/icons/pixmaps/blueman-lq-30.png deleted file mode 100644 index cc496198b..000000000 Binary files a/data/icons/pixmaps/blueman-lq-30.png and /dev/null differ diff --git a/data/icons/pixmaps/blueman-lq-40.png b/data/icons/pixmaps/blueman-lq-40.png deleted file mode 100644 index 8fb5bb554..000000000 Binary files a/data/icons/pixmaps/blueman-lq-40.png and /dev/null differ diff --git a/data/icons/pixmaps/blueman-lq-50.png b/data/icons/pixmaps/blueman-lq-50.png deleted file mode 100644 index 5818da81e..000000000 Binary files a/data/icons/pixmaps/blueman-lq-50.png and /dev/null differ diff --git a/data/icons/pixmaps/blueman-lq-60.png b/data/icons/pixmaps/blueman-lq-60.png deleted file mode 100644 index 72846ae56..000000000 Binary files a/data/icons/pixmaps/blueman-lq-60.png and /dev/null differ diff --git a/data/icons/pixmaps/blueman-lq-70.png b/data/icons/pixmaps/blueman-lq-70.png deleted file mode 100644 index f7adc7df4..000000000 Binary files a/data/icons/pixmaps/blueman-lq-70.png and /dev/null differ diff --git a/data/icons/pixmaps/blueman-lq-80.png b/data/icons/pixmaps/blueman-lq-80.png deleted file mode 100644 index 892b74e77..000000000 Binary files a/data/icons/pixmaps/blueman-lq-80.png and /dev/null differ diff --git a/data/icons/pixmaps/blueman-lq-90.png b/data/icons/pixmaps/blueman-lq-90.png deleted file mode 100644 index 1d425e53d..000000000 Binary files a/data/icons/pixmaps/blueman-lq-90.png and /dev/null differ diff --git a/meson.build b/meson.build index ec59b7f8a..a552180d9 100644 --- a/meson.build +++ b/meson.build @@ -100,16 +100,6 @@ install_data( 'data/icons/pixmaps/blueman-battery-80.png', 'data/icons/pixmaps/blueman-battery-90.png', 'data/icons/pixmaps/blueman-battery-100.png', - 'data/icons/pixmaps/blueman-lq-10.png', - 'data/icons/pixmaps/blueman-lq-20.png', - 'data/icons/pixmaps/blueman-lq-30.png', - 'data/icons/pixmaps/blueman-lq-40.png', - 'data/icons/pixmaps/blueman-lq-50.png', - 'data/icons/pixmaps/blueman-lq-60.png', - 'data/icons/pixmaps/blueman-lq-70.png', - 'data/icons/pixmaps/blueman-lq-80.png', - 'data/icons/pixmaps/blueman-lq-90.png', - 'data/icons/pixmaps/blueman-lq-100.png', 'data/icons/pixmaps/blueman-rssi-10.png', 'data/icons/pixmaps/blueman-rssi-20.png', 'data/icons/pixmaps/blueman-rssi-30.png', diff --git a/module/_blueman.pyx b/module/_blueman.pyx index 428b75917..d646177da 100644 --- a/module/_blueman.pyx +++ b/module/_blueman.pyx @@ -79,7 +79,6 @@ cdef extern from "libblueman.h": cdef int connection_init(int dev_id, char *addr, conn_info_handles *ci) cdef int connection_get_rssi(conn_info_handles *ci, signed char *ret_rssi) - cdef int connection_get_lq(conn_info_handles *ci, unsigned char *ret_lq) cdef int connection_get_tpl(conn_info_handles *ci, signed char *ret_tpl, unsigned char type) cdef int connection_close(conn_info_handles *ci) cdef int c_get_rfcomm_channel "get_rfcomm_channel" (unsigned short service_class, char* btd_addr) @@ -100,7 +99,6 @@ ERR = { -4:"Get connection info failed", -5:"Read RSSI failed", -6:"Read transmit power level request failed", - -7:"Read Link quality failed", -8:"Getting rfcomm list failed", -9:"ERR_SOCKET_FAILED", -12: "Can't bind RFCOMM socket", @@ -248,14 +246,6 @@ cdef class conn_info: return rssi - def get_lq(self): - cdef unsigned char lq - res = connection_get_lq(&self.ci, &lq) - if res < 0: - raise ConnInfoReadError(ERR[res]) - - return lq - def get_tpl(self, tp=0): cdef signed char tpl res = connection_get_tpl(&self.ci, &tpl, tp) diff --git a/module/libblueman.c b/module/libblueman.c index 69c1fbfeb..03c94f74a 100644 --- a/module/libblueman.c +++ b/module/libblueman.c @@ -220,16 +220,6 @@ int connection_get_rssi(struct conn_info_handles *ci, int8_t *ret_rssi) } -int connection_get_lq(struct conn_info_handles *ci, uint8_t *ret_lq) -{ - uint8_t lq; - if (hci_read_link_quality(ci->dd, htobs(ci->handle), &lq, 1000) < 0) { - return ERR_READ_LQ_FAILED; - } - *ret_lq = lq; - return 1; -} - int connection_get_tpl(struct conn_info_handles *ci, int8_t *ret_tpl, uint8_t type) { int8_t level; diff --git a/module/libblueman.h b/module/libblueman.h index fd0f2f44b..3f1b56a21 100644 --- a/module/libblueman.h +++ b/module/libblueman.h @@ -5,7 +5,6 @@ #define ERR_GET_CONN_INFO_FAILED -4 #define ERR_READ_RSSI_FAILED -5 #define ERR_READ_TPL_FAILED -6 -#define ERR_READ_LQ_FAILED -7 #define ERR_GET_RFCOMM_LIST_FAILED -8 #define ERR_SOCKET_FAILED -9 #define ERR_BIND_FAILED -12 @@ -20,7 +19,6 @@ struct conn_info_handles { int connection_init(int dev_id, char *addr, struct conn_info_handles *ci); int connection_get_rssi(struct conn_info_handles *ci, int8_t *ret_rssi); -int connection_get_lq(struct conn_info_handles *ci, uint8_t *ret_lq); int connection_get_tpl(struct conn_info_handles *ci, int8_t *ret_tpl, uint8_t type); int connection_close(struct conn_info_handles *ci); int get_rfcomm_channel(uint16_t uuid, char* btd_addr); diff --git a/stubs/_blueman.pyi b/stubs/_blueman.pyi index 03a3ee711..59d93181d 100644 --- a/stubs/_blueman.pyi +++ b/stubs/_blueman.pyi @@ -43,7 +43,6 @@ class conn_info: failed: bool def __init__(self, addr: str, hci_name: str) -> None: ... def deinit(self) -> None: ... - def get_lq(self) -> int: ... def get_rssi(self) -> int: ... def get_tpl(self) -> int: ... def init(self) -> None: ...