diff --git a/applet/contents/ui/ListItemBase.qml b/applet/contents/ui/ListItemBase.qml --- a/applet/contents/ui/ListItemBase.qml +++ b/applet/contents/ui/ListItemBase.qml @@ -286,6 +286,9 @@ var port = PulseObject.ports[i]; var menuItem = newMenuItem(); menuItem.text = port.description; + if (port.availability == Port.Unavailable) { + menuItem.text += i18nc("Port (headphones, speakers, ...) is unavailable", " (unavailable)"); + } menuItem.enabled = isMultiplePorts; menuItem.checkable = true; menuItem.checked = i === PulseObject.activePortIndex; diff --git a/src/kcm/package/contents/ui/DeviceListItem.qml b/src/kcm/package/contents/ui/DeviceListItem.qml --- a/src/kcm/package/contents/ui/DeviceListItem.qml +++ b/src/kcm/package/contents/ui/DeviceListItem.qml @@ -24,6 +24,8 @@ import org.kde.kquickcontrolsaddons 2.0 +import org.kde.plasma.private.volume 0.1 + ColumnLayout { id: delegate width: parent.width @@ -73,12 +75,26 @@ ComboBox { id: portbox + readonly property var ports: Ports Layout.fillWidth: true - model: Ports onModelChanged: currentIndex = ActivePortIndex - textRole: "description" currentIndex: ActivePortIndex onActivated: ActivePortIndex = index + + model: ListModel { + id: portModel + } + + onPortsChanged: { + portModel.clear(); + for (var i = 0; i < ports.length; ++i) { + var t = ports[i].description; + if (ports[i].availability == Port.Unavailable) { + t += i18nc("Port (headphones, speakers, ...) is unavailable", " (unavailable)"); + } + portModel.append({text: t}); + } + } } }