Changeset View
Changeset View
Standalone View
Standalone View
applet/contents/ui/DeviceListItem.qml
Show All 27 Lines | 27 | ListItemBase { | |||
---|---|---|---|---|---|
28 | readonly property var currentPort: Ports[ActivePortIndex] | 28 | readonly property var currentPort: Ports[ActivePortIndex] | ||
29 | readonly property var currentActivePortIndex: ActivePortIndex | 29 | readonly property var currentActivePortIndex: ActivePortIndex | ||
30 | readonly property var currentMuted: Muted | 30 | readonly property var currentMuted: Muted | ||
31 | readonly property var activePortIndex: ActivePortIndex | 31 | readonly property var activePortIndex: ActivePortIndex | ||
32 | property bool onlyone: false | 32 | property bool onlyone: false | ||
33 | 33 | | |||
34 | draggable: false | 34 | draggable: false | ||
35 | label: { | 35 | label: { | ||
36 | if (currentPort) { | 36 | if (currentPort && currentPort.description) { | ||
37 | if (onlyone) { | 37 | if (onlyone || !Description) { | ||
38 | return currentPort.description; | 38 | return currentPort.description; | ||
39 | } | 39 | } else { | ||
40 | return i18nc("label of device items", "%1 (%2)", currentPort.description, Description); | 40 | return i18nc("label of device items", "%1 (%2)", currentPort.description, Description); | ||
41 | } | 41 | } | ||
42 | } | ||||
43 | if (Description) { | ||||
42 | return Description; | 44 | return Description; | ||
43 | } | 45 | } | ||
46 | if (Name) { | ||||
47 | return Name; | ||||
48 | } | ||||
49 | return i18n("Device name not found"); | ||||
ngraham: If this is something that should be shown to the user (is it?), then it needs to be localized… | |||||
50 | } | ||||
44 | 51 | | |||
45 | onCurrentActivePortIndexChanged: { | 52 | onCurrentActivePortIndexChanged: { | ||
46 | if (type === "sink" && globalMute && !Muted) { | 53 | if (type === "sink" && globalMute && !Muted) { | ||
47 | Muted = true; | 54 | Muted = true; | ||
48 | } | 55 | } | ||
49 | } | 56 | } | ||
50 | 57 | | |||
51 | onCurrentMutedChanged: { | 58 | onCurrentMutedChanged: { | ||
Show All 20 Lines |
If this is something that should be shown to the user (is it?), then it needs to be localized by wrapping it in i18n()