Changeset View
Changeset View
Standalone View
Standalone View
src/kcm/package/contents/ui/CardListItem.qml
Show All 17 Lines | 1 | /* | |||
---|---|---|---|---|---|
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | import QtQuick 2.0 | 21 | import QtQuick 2.0 | ||
22 | import QtQuick.Controls 1.0 | 22 | import QtQuick.Controls 1.0 | ||
23 | import QtQuick.Layouts 1.0 | 23 | import QtQuick.Layouts 1.0 | ||
24 | 24 | | |||
25 | import org.kde.kquickcontrolsaddons 2.0 | 25 | import org.kde.kquickcontrolsaddons 2.0 | ||
26 | import org.kde.plasma.private.volume 0.1 | ||||
26 | 27 | | |||
27 | ColumnLayout { | 28 | ColumnLayout { | ||
28 | id: delegate | 29 | id: delegate | ||
29 | width: parent.width | 30 | width: parent.width | ||
30 | 31 | | |||
31 | RowLayout { | 32 | RowLayout { | ||
32 | QIconItem { | 33 | QIconItem { | ||
33 | id: clientIcon | 34 | id: clientIcon | ||
Show All 14 Lines | |||||
48 | RowLayout { | 49 | RowLayout { | ||
49 | Label { | 50 | Label { | ||
50 | id: profileLabel | 51 | id: profileLabel | ||
51 | text: i18nc("@label", "Profile:") | 52 | text: i18nc("@label", "Profile:") | ||
52 | font.bold: true | 53 | font.bold: true | ||
53 | } | 54 | } | ||
54 | ComboBox { | 55 | ComboBox { | ||
55 | Layout.fillWidth: true | 56 | Layout.fillWidth: true | ||
56 | model: Profiles | 57 | model: Profiles.filter(function (profile) { | ||
58 | return profile.availability === Profile.Available; | ||||
59 | }) | ||||
broulikUnsubmitted Not Done broulik: ```
model: Profiles.filter(function (profile) {
return profile.availability === Profile. | |||||
57 | // NOTE: model resets (i.e. profiles property changes) will reset | 60 | // NOTE: model resets (i.e. profiles property changes) will reset | ||
58 | // the currentIndex, so force it to be set on model changes, otherwise | 61 | // the currentIndex, so force it to be set on model changes, otherwise | ||
59 | // it would eventually become 0 when it shouldn't be. | 62 | // it would eventually become 0 when it shouldn't be. | ||
60 | onModelChanged: currentIndex = ActiveProfileIndex | 63 | onModelChanged: currentIndex = model.indexOf(Profiles[ActiveProfileIndex]) | ||
61 | textRole: "description" | 64 | textRole: "description" | ||
62 | currentIndex: ActiveProfileIndex | 65 | onActivated: ActiveProfileIndex = Profiles.indexOf(model[index]) | ||
63 | onActivated: ActiveProfileIndex = index | | |||
64 | } | 66 | } | ||
65 | } | 67 | } | ||
66 | 68 | | |||
67 | ListItemSeperator { view: delegate.ListView.view } | 69 | ListItemSeperator { view: delegate.ListView.view } | ||
68 | } | 70 | } |