Commit dd390ee8 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

[applet] Show exact device type

Currently we only show a coarse device type for some devices (e.g. Audio Device for headsets, headphones, speakers etc).

For other types we show a collection of capabilities instead of a single type

Instead show the exact device type. This matches what we show in the KCM
parent 23010e59
Pipeline #113807 passed with stage
in 50 seconds
......@@ -237,6 +237,49 @@ PlasmaExtras.ExpandableListItem {
currentDeviceDetails = details;
}
function deviceTypeToString(type) {
switch (type) {
case BluezQt.Device.Phone:
return i18nc("This device is a Phone", "Phone");
case BluezQt.Device.Modem:
return i18nc("This device is a Modem", "Modem");
case BluezQt.Device.Computer:
return i18nc("This device is a Computer", "Computer");
case BluezQt.Device.Network:
return i18nc("This device is of type Network", "Network");
case BluezQt.Device.Headset:
return i18nc("This device is a Headset", "Headset");
case BluezQt.Device.Headphones:
return i18nc("This device is a Headphones", "Headphones");
case BluezQt.Device.AudioVideo:
return i18nc("This device is an Audio device", "Audio");
case BluezQt.Device.Keyboard:
return i18nc("This device is a Keyboard", "Keyboard");
case BluezQt.Device.Mouse:
return i18nc("This device is a Mouse", "Mouse");
case BluezQt.Device.Joypad:
return i18nc("This device is a Joypad", "Joypad");
case BluezQt.Device.Tablet:
return i18nc("This device is a Graphics Tablet (input device)", "Tablet");
case BluezQt.Device.Peripheral:
return i18nc("This device is a Peripheral device", "Peripheral");
case BluezQt.Device.Camera:
return i18nc("This device is a Camera", "Camera");
case BluezQt.Device.Printer:
return i18nc("This device is a Printer", "Printer");
case BluezQt.Device.Imaging:
return i18nc("This device is an Imaging device (printer, scanner, camera, display, …)", "Imaging");
case BluezQt.Device.Wearable:
return i18nc("This device is a Wearable", "Wearable");
case BluezQt.Device.Toy:
return i18nc("This device is a Toy", "Toy");
case BluezQt.Device.Health:
return i18nc("This device is a Health device", "Health");
default:
return i18nc("Type of device: could not be determined", "Unknown");
}
}
function infoText()
{
if (connecting) {
......@@ -249,49 +292,8 @@ PlasmaExtras.ExpandableListItem {
labels.push(i18n("Connected"));
}
switch (Type) {
case BluezQt.Device.Headset:
case BluezQt.Device.Headphones:
case BluezQt.Device.OtherAudio:
labels.push(i18n("Audio device"));
break;
labels.push(deviceTypeToString(Type))
case BluezQt.Device.Keyboard:
case BluezQt.Device.Mouse:
case BluezQt.Device.Joypad:
case BluezQt.Device.Tablet:
labels.push(i18n("Input device"));
break;
case BluezQt.Device.Phone:
labels.push(i18n("Phone"));
break;
default:
var profiles = [];
if (Uuids.indexOf(BluezQt.Services.ObexFileTransfer) != -1) {
profiles.push(i18n("File transfer"));
}
if (Uuids.indexOf(BluezQt.Services.ObexObjectPush) != -1) {
profiles.push(i18n("Send file"));
}
if (Uuids.indexOf(BluezQt.Services.HumanInterfaceDevice) != -1) {
profiles.push(i18n("Input"));
}
if (Uuids.indexOf(BluezQt.Services.AdvancedAudioDistribution) != -1) {
profiles.push(i18n("Audio"));
}
if (Uuids.indexOf(BluezQt.Services.Nap) != -1) {
profiles.push(i18n("Network"));
}
if (!profiles.length) {
profiles.push(i18n("Other device"));
}
labels.push(profiles.join(", "));
}
if (Battery) {
labels.push(i18n("%1% Battery", Battery.percentage));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment