Changeset View
Changeset View
Standalone View
Standalone View
smsapp/qml/ConversationList.qml
Show All 28 Lines | |||||
29 | Kirigami.ScrollablePage | 29 | Kirigami.ScrollablePage | ||
30 | { | 30 | { | ||
31 | footer: ComboBox { | 31 | footer: ComboBox { | ||
32 | id: devicesCombo | 32 | id: devicesCombo | ||
33 | enabled: count > 0 | 33 | enabled: count > 0 | ||
34 | model: DevicesSortProxyModel { | 34 | model: DevicesSortProxyModel { | ||
35 | id: devicesModel | 35 | id: devicesModel | ||
36 | //TODO: make it possible to filter if they can do sms | 36 | //TODO: make it possible to filter if they can do sms | ||
37 | sourceModel: DevicesModel { displayFilter: DevicesModel.Paired | DevicesModel.Reachable } | 37 | readonly property var devicesModel: DevicesModel { displayFilter: DevicesModel.Paired | DevicesModel.Reachable } | ||
38 | sourceModel: devicesModel | ||||
38 | onRowsInserted: if (devicesCombo.currentIndex < 0) { | 39 | onRowsInserted: if (devicesCombo.currentIndex < 0) { | ||
39 | devicesCombo.currentIndex = 0 | 40 | devicesCombo.currentIndex = 0 | ||
40 | } | 41 | } | ||
41 | } | 42 | } | ||
42 | textRole: "display" | 43 | textRole: "display" | ||
43 | } | 44 | } | ||
44 | 45 | | |||
45 | Label { | 46 | Label { | ||
Show All 12 Lines | |||||
58 | ListView { | 59 | ListView { | ||
59 | id: view | 60 | id: view | ||
60 | currentIndex: 0 | 61 | currentIndex: 0 | ||
61 | 62 | | |||
62 | model: QSortFilterProxyModel { | 63 | model: QSortFilterProxyModel { | ||
63 | sortOrder: Qt.DescendingOrder | 64 | sortOrder: Qt.DescendingOrder | ||
64 | sortRole: ConversationListModel.DateRole | 65 | sortRole: ConversationListModel.DateRole | ||
65 | filterCaseSensitivity: Qt.CaseInsensitive | 66 | filterCaseSensitivity: Qt.CaseInsensitive | ||
66 | sourceModel: ConversationListModel { | 67 | readonly property var convsModel: ConversationListModel { | ||
67 | deviceId: device ? device.id() : "" | 68 | deviceId: device ? device.id() : "" | ||
68 | } | 69 | } | ||
70 | sourceModel: convsModel | ||||
69 | } | 71 | } | ||
70 | 72 | | |||
71 | header: TextField { | 73 | header: TextField { | ||
72 | id: filter | 74 | id: filter | ||
73 | placeholderText: i18n("Filter...") | 75 | placeholderText: i18n("Filter...") | ||
74 | width: parent.width | 76 | width: parent.width | ||
75 | onTextChanged: { | 77 | onTextChanged: { | ||
76 | view.model.setFilterFixedString(filter.text); | 78 | view.model.setFilterFixedString(filter.text); | ||
Show All 31 Lines |