mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-08 07:33:53 +01:00
device: use "Name" instead of "Description"
This is the terminology used in libratbag as well (and everywhere else where we deal with input devices). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
@@ -34,7 +34,7 @@ import argparse
|
||||
|
||||
def list_devices(r, args):
|
||||
for d in r.devices:
|
||||
print("{:10s} {:32s}".format(d.id + ":", d.description))
|
||||
print("{:10s} {:32s}".format(d.id + ":", d.name))
|
||||
|
||||
def find_device(r, args):
|
||||
dev = None
|
||||
@@ -85,7 +85,7 @@ def show_device(r, args):
|
||||
RatbagdDevice.CAP_DEFAULT_PROFILE : "default-profile" }
|
||||
capabilities = [caps[c] for c in d.capabilities]
|
||||
|
||||
print("{} - {}".format(d.id, d.description))
|
||||
print("{} - {}".format(d.id, d.name))
|
||||
print(" SVG: {}".format(d.svg))
|
||||
print(" Capabilities: {}".format(", ".join(capabilities)))
|
||||
print("Number of Profiles: {}".format(len(d.profiles)))
|
||||
@@ -99,7 +99,7 @@ def show_device(r, args):
|
||||
def show_profile(r, args):
|
||||
p, d = find_profile(r, args)
|
||||
|
||||
print("Profile {} on {} ({})".format(args.profile, d.id, d.description))
|
||||
print("Profile {} on {} ({})".format(args.profile, d.id, d.name))
|
||||
print(" Number of Buttons: {}".format(len(p.buttons)))
|
||||
print("Number of Resolutions: {}".format(len(p.resolutions)))
|
||||
active, default = -1, -1
|
||||
@@ -118,7 +118,7 @@ def show_resolution(r, args):
|
||||
print("Resolution {} on Profile {} on {} ({})".format(args.resolution,
|
||||
args.profile,
|
||||
d.id,
|
||||
d.description))
|
||||
d.name))
|
||||
print(" Report Rate: {}Hz".format(r.report_rate))
|
||||
if RatbagdResolution.CAP_SEPARATE_XY_RESOLUTION in r.capabilities:
|
||||
print(" Resolution: {}x{}dpi".format(*r.resolution))
|
||||
@@ -137,7 +137,7 @@ def show_button(r, args):
|
||||
print("Button {} on Profile {} on {} ({})".format(args.button,
|
||||
args.profile,
|
||||
d.id,
|
||||
d.description))
|
||||
d.name))
|
||||
|
||||
print(" Type: {}".format(b.button_type))
|
||||
print(" Action Type: {}".format(b.action_type))
|
||||
|
||||
@@ -88,7 +88,7 @@ class RatbagdDevice(_RatbagdDBus):
|
||||
def __init__(self, object_path):
|
||||
_RatbagdDBus.__init__(self, "Device", object_path)
|
||||
self._devnode = self.dbus_property("Id")
|
||||
self._description = self.dbus_property("Description")
|
||||
self._name = self.dbus_property("Name")
|
||||
self._svg = self.dbus_property("Svg")
|
||||
self._svg_path = self.dbus_property("SvgPath")
|
||||
|
||||
@@ -109,11 +109,11 @@ class RatbagdDevice(_RatbagdDBus):
|
||||
return self._profiles
|
||||
|
||||
@property
|
||||
def description(self):
|
||||
def name(self):
|
||||
"""
|
||||
The device name, usually provided by the kernel.
|
||||
"""
|
||||
return self._description
|
||||
return self._name
|
||||
|
||||
@property
|
||||
def svg(self):
|
||||
|
||||
@@ -118,7 +118,7 @@ error:
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
static int ratbagd_device_get_description(sd_bus *bus,
|
||||
static int ratbagd_device_get_device_name(sd_bus *bus,
|
||||
const char *path,
|
||||
const char *interface,
|
||||
const char *property,
|
||||
@@ -127,16 +127,16 @@ static int ratbagd_device_get_description(sd_bus *bus,
|
||||
sd_bus_error *error)
|
||||
{
|
||||
struct ratbagd_device *device = userdata;
|
||||
const char *description;
|
||||
const char *name;
|
||||
|
||||
description = ratbag_device_get_name(device->lib_device);
|
||||
if (!description) {
|
||||
log_error("Unable to fetch description for %s\n",
|
||||
name = ratbag_device_get_name(device->lib_device);
|
||||
if (!name) {
|
||||
log_error("Unable to fetch name for %s\n",
|
||||
ratbagd_device_get_name(device));
|
||||
description = "";
|
||||
name = "";
|
||||
}
|
||||
|
||||
return sd_bus_message_append(reply, "s", description);
|
||||
return sd_bus_message_append(reply, "s", name);
|
||||
}
|
||||
|
||||
static int ratbagd_device_get_svg(sd_bus *bus,
|
||||
@@ -317,7 +317,7 @@ const sd_bus_vtable ratbagd_device_vtable[] = {
|
||||
SD_BUS_VTABLE_START(0),
|
||||
SD_BUS_PROPERTY("Id", "s", NULL, offsetof(struct ratbagd_device, name), SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_PROPERTY("Capabilities", "au", ratbagd_device_get_capabilities, 0, SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_PROPERTY("Description", "s", ratbagd_device_get_description, 0, SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_PROPERTY("Name", "s", ratbagd_device_get_device_name, 0, SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_PROPERTY("Svg", "s", ratbagd_device_get_svg, 0, SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_PROPERTY("SvgPath", "s", ratbagd_device_get_svg_path, 0, SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_PROPERTY("Profiles", "ao", ratbagd_device_get_profiles, 0, SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
|
||||
Reference in New Issue
Block a user