diff --git a/src/kcm/package/contents/ui/Advanced.qml b/src/kcm/package/contents/ui/Advanced.qml index c737ff4..536ae3e 100644 --- a/src/kcm/package/contents/ui/Advanced.qml +++ b/src/kcm/package/contents/ui/Advanced.qml @@ -1,245 +1,245 @@ /* Copyright 2014-2015 Harald Sitter This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License or (at your option) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ import QtQuick 2.0 import QtQuick.Layouts 1.1 import QtQuick.Controls 1.3 import org.kde.plasma.private.volume 0.1 import org.kde.kcoreaddons 1.0 as KCoreAddons ScrollView { id: scrollView ColumnLayout { Component.onCompleted: { // Normal binding causes binding loops width = Qt.binding(function() { return scrollView.viewport.width; }); } Header { Layout.fillWidth: true enabled: view.count > 0 - text: i18n("Device Profiles") - disabledText: i18nc("@label", "No Device Profiles Available") + text: i18nd("kcm_pulseaudio", "Device Profiles") + disabledText: i18ndc("kcm_pulseaudio", "@label", "No Device Profiles Available") } ListView { id: view Layout.fillWidth: true Layout.preferredHeight: contentHeight Layout.margins: units.gridUnit / 2 interactive: false spacing: units.smallSpacing * 2 model: CardModel {} delegate: CardListItem {} } Header { Layout.fillWidth: true - text: i18n("Advanced Output Configuration") + text: i18nd("kcm_pulseaudio", "Advanced Output Configuration") visible: moduleManager.settingsSupported } ModuleManager { id: moduleManager } CheckBox { Layout.fillWidth: true Layout.topMargin: units.smallSpacing Layout.leftMargin: units.gridUnit / 2 Layout.rightMargin: units.gridUnit / 2 - text: i18n("Add virtual output device for simultaneous output on all local sound cards") + text: i18nd("kcm_pulseaudio", "Add virtual output device for simultaneous output on all local sound cards") checked: moduleManager.combineSinks onCheckedChanged: moduleManager.combineSinks = checked; enabled: moduleManager.loadedModules.indexOf("module-gconf") != -1 visible: moduleManager.settingsSupported } CheckBox { Layout.fillWidth: true Layout.leftMargin: units.gridUnit / 2 Layout.rightMargin: units.gridUnit / 2 - text: i18n("Automatically switch all running streams when a new output becomes available") + text: i18nd("kcm_pulseaudio", "Automatically switch all running streams when a new output becomes available") checked: moduleManager.switchOnConnect onCheckedChanged: moduleManager.switchOnConnect = checked; enabled: moduleManager.loadedModules.indexOf("module-gconf") != -1 visible: moduleManager.settingsSupported } Label { Layout.alignment: Qt.AlignHCenter enabled: false font.italic: true - text: i18n("Requires 'module-gconf' PulseAudio module") + text: i18nd("kcm_pulseaudio", "Requires 'module-gconf' PulseAudio module") visible: moduleManager.settingsSupported && moduleManager.loadedModules.indexOf("module-gconf") == -1 } Header { Layout.fillWidth: true - text: i18n("Speaker Placement and Testing") + text: i18nd("kcm_pulseaudio", "Speaker Placement and Testing") } RowLayout { Layout.margins: units.gridUnit / 2 visible: sinks.count > 1 Label { - text: i18nc("@label", "Output:") + text: i18ndc("kcm_pulseaudio", "@label", "Output:") font.bold: true } ComboBox { id: sinks property var pulseObject: null Layout.fillWidth: true textRole: "Description" model: SinkModel { onRowsInserted: sinks.updatePulseObject() onRowsRemoved: sinks.updatePulseObject() onDataChanged: sinks.updatePulseObject() } onCurrentIndexChanged: updatePulseObject() onCurrentTextChanged: updatePulseObject() Component.onCompleted: updatePulseObject() function updatePulseObject() { Qt.callLater(function() { pulseObject = model.data(model.index(sinks.currentIndex, 0), model.role("PulseObject")); }); } } } Grid { id: grid columns: 3 spacing: 5 Layout.fillWidth: true Item { width: grid.width/3 height: 50 Button{ - text: i18n("Front Left") + text: i18nd("kcm_pulseaudio", "Front Left") anchors.centerIn: parent visible: sinks.pulseObject ? sinks.pulseObject.rawChannels.indexOf("front-left") > -1 : false onClicked: sinks.pulseObject.testChannel("front-left") } } Item { width: grid.width/3 height: 50 Button{ - text: i18n("Front Center") + text: i18nd("kcm_pulseaudio", "Front Center") anchors.centerIn: parent visible: sinks.pulseObject ? sinks.pulseObject.rawChannels.indexOf("front-center") > -1 : false onClicked: sinks.pulseObject.testChannel("front-center") } } Item { width: grid.width/3 height: 50 Button{ - text: i18n("Front Right") + text: i18nd("kcm_pulseaudio", "Front Right") anchors.centerIn: parent visible: sinks.pulseObject ? sinks.pulseObject.rawChannels.indexOf("front-right") > -1 : false onClicked: sinks.pulseObject.testChannel("front-right") } } Item { width: grid.width/3 height: 50 Button{ - text: i18n("Side Left") + text: i18nd("kcm_pulseaudio", "Side Left") anchors.centerIn: parent visible: sinks.pulseObject ? sinks.pulseObject.rawChannels.indexOf("side-left") > -1 : false onClicked: sinks.pulseObject.testChannel("side-left") } } Item { width: grid.width/3 height: 50 KCoreAddons.KUser { id: kuser } Image { source: kuser.faceIconUrl anchors.centerIn: parent width: 50 height: 50 } } Item { width: grid.width/3 height: 50 Button{ - text: i18n("Side Right") + text: i18nd("kcm_pulseaudio", "Side Right") anchors.centerIn: parent visible: sinks.pulseObject ? sinks.pulseObject.rawChannels.indexOf("side-right") > -1 : false onClicked: sinks.pulseObject.testChannel("side-right") } } Item { width: grid.width/3 height: 50 Button{ - text: i18n("Rear Left") + text: i18nd("kcm_pulseaudio", "Rear Left") anchors.centerIn: parent visible: sinks.pulseObject ? sinks.pulseObject.rawChannels.indexOf("rear-left") > -1 : false onClicked: sinks.pulseObject.testChannel("rear-left") } } Item { width: grid.width/3 height: 50 Button{ - text: i18n("Subwoofer") + text: i18nd("kcm_pulseaudio", "Subwoofer") anchors.centerIn: parent visible: sinks.pulseObject ? sinks.pulseObject.rawChannels.indexOf("lfe") > -1 : false onClicked: sinks.pulseObject.testChannel("subwoofer") } } Item { width: grid.width/3 height: 50 Button{ - text: i18n("Rear Right") + text: i18nd("kcm_pulseaudio", "Rear Right") anchors.centerIn: parent visible: sinks.pulseObject ? sinks.pulseObject.rawChannels.indexOf("rear-right") > -1 : false onClicked: sinks.pulseObject.testChannel("rear-right") } } } } } diff --git a/src/kcm/package/contents/ui/Applications.qml b/src/kcm/package/contents/ui/Applications.qml index 997bd27..ab3fe64 100644 --- a/src/kcm/package/contents/ui/Applications.qml +++ b/src/kcm/package/contents/ui/Applications.qml @@ -1,103 +1,103 @@ /* Copyright 2014-2015 Harald Sitter Copyright 2016 David Rosca This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License or (at your option) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ import QtQuick 2.0 import QtQuick.Layouts 1.1 import QtQuick.Controls 1.3 import org.kde.plasma.private.volume 0.1 ScrollView { id: scrollView anchors.fill: parent ColumnLayout { Component.onCompleted: { // Normal binding causes binding loops width = Qt.binding(function() { return scrollView.viewport.width; }); } Header { Layout.fillWidth: true enabled: eventStreamView.count || sinkInputView.count - text: i18n("Playback") - disabledText: i18nc("@label", "No Applications Playing Audio") + text: i18nd("kcm_pulseaudio", "Playback") + disabledText: i18ndc("kcm_pulseaudio", "@label", "No Applications Playing Audio") } ListView { id: eventStreamView Layout.fillWidth: true Layout.preferredHeight: contentHeight Layout.margins: units.gridUnit / 2 interactive: false spacing: units.largeSpacing model: PulseObjectFilterModel { filters: [ { role: "Name", value: "sink-input-by-media-role:event" } ] sourceModel: StreamRestoreModel {} } delegate: StreamListItem { deviceModel: sinkModel } } ListView { id: sinkInputView Layout.fillWidth: true Layout.preferredHeight: contentHeight Layout.margins: units.gridUnit / 2 interactive: false spacing: units.largeSpacing model: PulseObjectFilterModel { filters: [ { role: "VirtualStream", value: false } ] sourceModel: SinkInputModel {} } delegate: StreamListItem { deviceModel: sinkModel } } Header { Layout.fillWidth: true enabled: sourceOutputView.count > 0 - text: i18n("Capture") - disabledText: i18nc("@label", "No Applications Recording Audio") + text: i18nd("kcm_pulseaudio", "Capture") + disabledText: i18ndc("kcm_pulseaudio", "@label", "No Applications Recording Audio") } ListView { id: sourceOutputView Layout.fillWidth: true Layout.preferredHeight: contentHeight Layout.margins: units.gridUnit / 2 interactive: false spacing: units.largeSpacing model: PulseObjectFilterModel { filters: [ { role: "VirtualStream", value: false } ] sourceModel: SourceOutputModel {} } delegate: StreamListItem { deviceModel: sourceModel } } } } diff --git a/src/kcm/package/contents/ui/CardListItem.qml b/src/kcm/package/contents/ui/CardListItem.qml index 556e76e..904c171 100644 --- a/src/kcm/package/contents/ui/CardListItem.qml +++ b/src/kcm/package/contents/ui/CardListItem.qml @@ -1,70 +1,70 @@ /* Copyright 2014-2015 Harald Sitter This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License or (at your option) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ import QtQuick 2.0 import QtQuick.Controls 1.0 import QtQuick.Layouts 1.0 import org.kde.kquickcontrolsaddons 2.0 import org.kde.plasma.private.volume 0.1 ColumnLayout { id: delegate width: parent.width RowLayout { QIconItem { id: clientIcon Layout.alignment: Qt.AlignHCenter width: height height: nameLabel.contentHeight icon: IconName || "audio-card" } Label { id: nameLabel Layout.fillWidth: true text: Properties["device.description"] || Name elide: Text.ElideRight } } RowLayout { Label { id: profileLabel - text: i18nc("@label", "Profile:") + text: i18ndc("kcm_pulseaudio", "@label", "Profile:") font.bold: true } ComboBox { Layout.fillWidth: true model: Profiles.filter(function (profile) { return profile.availability === Profile.Available; }) // NOTE: model resets (i.e. profiles property changes) will reset // the currentIndex, so force it to be set on model changes, otherwise // it would eventually become 0 when it shouldn't be. onModelChanged: currentIndex = model.indexOf(Profiles[ActiveProfileIndex]) textRole: "description" onActivated: ActiveProfileIndex = Profiles.indexOf(model[index]) } } ListItemSeperator { view: delegate.ListView.view } } diff --git a/src/kcm/package/contents/ui/DefaultDeviceButton.qml b/src/kcm/package/contents/ui/DefaultDeviceButton.qml index ac3bd65..877ccb5 100644 --- a/src/kcm/package/contents/ui/DefaultDeviceButton.qml +++ b/src/kcm/package/contents/ui/DefaultDeviceButton.qml @@ -1,30 +1,30 @@ /* Copyright 2016 David Rosca This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License or (at your option) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ import QtQuick 2.0 import QtQuick.Controls 1.0 RadioButton { property bool isDefault: true checked: isDefault - text: checked ? i18n("Default") : "" + text: checked ? i18nd("kcm_pulseaudio", "Default") : "" onIsDefaultChanged: checked = isDefault } diff --git a/src/kcm/package/contents/ui/DeviceListItem.qml b/src/kcm/package/contents/ui/DeviceListItem.qml index 2b90f92..b1642c2 100644 --- a/src/kcm/package/contents/ui/DeviceListItem.qml +++ b/src/kcm/package/contents/ui/DeviceListItem.qml @@ -1,107 +1,107 @@ /* Copyright 2014-2015 Harald Sitter This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License or (at your option) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ import QtQuick 2.0 import QtQuick.Controls 1.0 import QtQuick.Layouts 1.0 import org.kde.kquickcontrolsaddons 2.0 import org.kde.plasma.private.volume 0.1 ColumnLayout { id: delegate width: parent.width RowLayout { QIconItem { width: height height: inputText.height icon: IconName || "audio-card" } Label { id: inputText Layout.fillWidth: true elide: Text.ElideRight text: Description } DefaultDeviceButton { visible: delegate.ListView.view.count > 1 isDefault: Default onCheckedChanged: { if (!checked) { // Cannot unset default device checked = isDefault; } else { Default = true; } } } MuteButton { muted: Muted onCheckedChanged: Muted = checked } } ColumnLayout { width: parent.width RowLayout { visible: portbox.count > 1 Label { - text: i18n("Port") + text: i18nd("kcm_pulseaudio", "Port") } ComboBox { id: portbox readonly property var ports: Ports Layout.fillWidth: true onModelChanged: currentIndex = ActivePortIndex currentIndex: ActivePortIndex onActivated: ActivePortIndex = index onPortsChanged: { var items = []; for (var i = 0; i < ports.length; ++i) { var port = ports[i]; var text = port.description; if (port.availability == Port.Unavailable) { if (port.name == "analog-output-speaker" || port.name == "analog-input-microphone-internal") { - text += i18nc("Port is unavailable", " (unavailable)"); + text += i18ndc("kcm_pulseaudio", "Port is unavailable", " (unavailable)"); } else { - text += i18nc("Port is unplugged", " (unplugged)"); + text += i18ndc("kcm_pulseaudio", "Port is unplugged", " (unplugged)"); } } items.push(text); } model = items; } } } VolumeSlider {} } ListItemSeperator { view: delegate.ListView.view } } diff --git a/src/kcm/package/contents/ui/Devices.qml b/src/kcm/package/contents/ui/Devices.qml index d8cbb8b..7b1e23a 100644 --- a/src/kcm/package/contents/ui/Devices.qml +++ b/src/kcm/package/contents/ui/Devices.qml @@ -1,71 +1,71 @@ /* Copyright 2014-2015 Harald Sitter This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License or (at your option) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ import QtQuick 2.0 import QtQuick.Layouts 1.1 import QtQuick.Controls 1.3 ScrollView { id: scrollView ColumnLayout { Component.onCompleted: { // Normal binding causes binding loops width = Qt.binding(function() { return scrollView.viewport.width; }); } Header { Layout.fillWidth: true enabled: sinks.count > 0 - text: i18n("Outputs") - disabledText: i18nc("@label", "No Output Devices Available") + text: i18nd("kcm_pulseaudio", "Outputs") + disabledText: i18ndc("kcm_pulseaudio", "@label", "No Output Devices Available") } ListView { id: sinks Layout.fillWidth: true Layout.preferredHeight: contentHeight Layout.margins: units.gridUnit / 2 interactive: false spacing: units.smallSpacing * 2 model: sinkModel delegate: DeviceListItem {} } Header { Layout.fillWidth: true enabled: sources.count > 0 - text: i18n("Inputs") - disabledText: i18nc("@label", "No Input Devices Available") + text: i18nd("kcm_pulseaudio", "Inputs") + disabledText: i18ndc("kcm_pulseaudio", "@label", "No Input Devices Available") } ListView { id: sources Layout.fillWidth: true Layout.preferredHeight: contentHeight Layout.margins: units.gridUnit / 2 interactive: false model: sourceModel delegate: DeviceListItem {} } } } diff --git a/src/kcm/package/contents/ui/MuteButton.qml b/src/kcm/package/contents/ui/MuteButton.qml index d536d2b..71a0996 100644 --- a/src/kcm/package/contents/ui/MuteButton.qml +++ b/src/kcm/package/contents/ui/MuteButton.qml @@ -1,32 +1,32 @@ /* Copyright 2014-2015 Harald Sitter This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License or (at your option) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ import QtQuick 2.0 import QtQuick.Controls 1.0 ToolButton { property bool muted: true iconName: 'audio-volume-muted' - tooltip: i18n("Mute audio") + tooltip: i18nd("kcm_pulseaudio", "Mute audio") checkable: true checked: muted onMutedChanged: checked = muted } diff --git a/src/kcm/package/contents/ui/StreamListItem.qml b/src/kcm/package/contents/ui/StreamListItem.qml index 94a3b79..8de8b71 100644 --- a/src/kcm/package/contents/ui/StreamListItem.qml +++ b/src/kcm/package/contents/ui/StreamListItem.qml @@ -1,98 +1,98 @@ /* Copyright 2014-2015 Harald Sitter This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License or (at your option) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ import QtQuick 2.0 import QtQuick.Controls 1.0 import QtQuick.Layouts 1.0 import org.kde.kquickcontrolsaddons 2.0 import org.kde.plasma.private.volume 0.1 ColumnLayout { id: delegate property alias deviceModel: deviceComboBox.model readonly property bool isEventStream: Name == "sink-input-by-media-role:event" width: parent.width RowLayout { Layout.fillWidth: true spacing: units.smallSpacing * 2 QIconItem { id: clientIcon Layout.preferredHeight: delegateColumn.height * 0.60 Layout.preferredWidth: Layout.preferredHeight icon: IconName || "unknown" } ColumnLayout { id: delegateColumn Layout.fillWidth: true RowLayout { Label { id: inputText Layout.fillWidth: true text: { if (isEventStream) { - return i18n("Notification Sounds"); + return i18nd("kcm_pulseaudio", "Notification Sounds"); } else if (Client) { - return i18nc("label of stream items", "%1: %2", Client.name, Name); + return i18ndc("kcm_pulseaudio", "label of stream items", "%1: %2", Client.name, Name); } else { return Name; } } elide: Text.ElideRight } DeviceComboBox { id: deviceComboBox Layout.leftMargin: units.smallSpacing Layout.rightMargin: units.smallSpacing Layout.preferredWidth: delegate.width / 3 visible: !isEventStream && count > 1 } MuteButton { muted: Muted onCheckedChanged: Muted = checked } } VolumeSlider {} } } ListItemSeperator { view: delegate.ListView.view Component.onCompleted: { if (isEventStream) { visible = Qt.binding(function() { return sinkInputView.count > 0; }); } } } } diff --git a/src/kcm/package/contents/ui/VolumeSlider.qml b/src/kcm/package/contents/ui/VolumeSlider.qml index 7c67c4f..6703500 100644 --- a/src/kcm/package/contents/ui/VolumeSlider.qml +++ b/src/kcm/package/contents/ui/VolumeSlider.qml @@ -1,112 +1,112 @@ /* Copyright 2014-2015 Harald Sitter This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License or (at your option) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ import QtQuick 2.4 import QtQuick.Layouts 1.0 import QtQuick.Controls 1.0 import org.kde.plasma.private.volume 0.1 RowLayout { Layout.bottomMargin: hundredPercentLabel.height Slider { id: slider // Helper properties to allow async slider updates. // While we are sliding we must not react to value updates // as otherwise we can easily end up in a loop where value // changes trigger volume changes trigger value changes. property int volume: Volume property bool ignoreValueChange: true Layout.fillWidth: true minimumValue: PulseAudio.MinimalVolume maximumValue: PulseAudio.MaximalVolume visible: HasVolume enabled: VolumeWritable opacity: Muted ? 0.5 : 1 Component.onCompleted: { ignoreValueChange = false; } onVolumeChanged: { var oldIgnoreValueChange = ignoreValueChange; ignoreValueChange = true; value = Volume; ignoreValueChange = oldIgnoreValueChange; } onValueChanged: { if (!ignoreValueChange) { Volume = value; Muted = value == 0; if (!pressed) { updateTimer.restart(); } } } onPressedChanged: { if (!pressed) { // Make sure to sync the volume once the button was // released. // Otherwise it might be that the slider is at v10 // whereas PA rejected the volume change and is // still at v15 (e.g.). updateTimer.restart(); } } Label { id: hundredPercentLabel readonly property real hundredPos: (slider.width / slider.maximumValue) * PulseAudio.NormalVolume z: slider.z - 1 x: (Qt.application.layoutDirection == Qt.RightToLeft ? slider.width - hundredPos : hundredPos) - width / 2 y: slider.height / 1.2 opacity: 0.5 font.pixelSize: slider.height / 2.2 - text: i18n("100%") + text: i18nd("kcm_pulseaudio", "100%") } Timer { id: updateTimer interval: 200 onTriggered: slider.value = Volume } } Label { id: percentText readonly property real value: PulseObject.volume > slider.maximumValue ? PulseObject.volume : slider.value Layout.alignment: Qt.AlignHCenter Layout.minimumWidth: percentMetrics.advanceWidth horizontalAlignment: Qt.AlignRight - text: i18nc("volume percentage", "%1%", Math.round(value / PulseAudio.NormalVolume * 100.0)) + text: i18ndc("kcm_pulseaudio", "volume percentage", "%1%", Math.round(value / PulseAudio.NormalVolume * 100.0)) } TextMetrics { id: percentMetrics font: percentText.font - text: i18nc("only used for sizing, should be widest possible string", "100%") + text: i18ndc("kcm_pulseaudio", "only used for sizing, should be widest possible string", "100%") } } diff --git a/src/kcm/package/contents/ui/main.qml b/src/kcm/package/contents/ui/main.qml index e2afc90..4e48058 100644 --- a/src/kcm/package/contents/ui/main.qml +++ b/src/kcm/package/contents/ui/main.qml @@ -1,76 +1,76 @@ /* Copyright 2014-2015 Harald Sitter This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License or (at your option) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ import QtQuick 2.1 import QtQuick.Controls 1.3 import org.kde.kcm 1.0 import org.kde.plasma.core 2.0 as PlasmaCore /* for units.gridUnit */ import org.kde.plasma.private.volume 0.1 MouseArea { property int wheelDelta: 0 property QtObject sinkModel: SinkModel { } property QtObject sourceModel: SourceModel { } acceptedButtons: Qt.NoButton implicitWidth: units.gridUnit * 30 implicitHeight: units.gridUnit * 30 - ConfigModule.quickHelp: i18n("This module allows to set up the Pulseaudio sound subsystem.") + ConfigModule.quickHelp: i18nd("kcm_pulseaudio", "This module allows to set up the Pulseaudio sound subsystem.") onWheel: { if (tabView.childAt(wheel.x, wheel.y).objectName != "tabbar") { wheel.accepted = false; return; } var delta = wheel.angleDelta.y || wheel.angleDelta.x; wheelDelta += delta; // Magic number 120 for common "one click" // See: http://qt-project.org/doc/qt-5/qml-qtquick-wheelevent.html#angleDelta-prop while (wheelDelta >= 120) { wheelDelta -= 120; tabView.currentIndex = Math.max(0, tabView.currentIndex - 1); } while (wheelDelta <= -120) { wheelDelta += 120; tabView.currentIndex = Math.min(tabView.count - 1, tabView.currentIndex + 1); } } TabView { id: tabView anchors.fill: parent Tab { - title: i18nc("@title:tab", "Devices") + title: i18ndc("kcm_pulseaudio", "@title:tab", "Devices") Devices {} } Tab { - title: i18nc("@title:tab", "Applications") + title: i18ndc("kcm_pulseaudio", "@title:tab", "Applications") Applications {} } Tab { - title: i18nc("@title:tab", "Advanced") + title: i18ndc("kcm_pulseaudio", "@title:tab", "Advanced") Advanced {} } } }