Changeset View
Changeset View
Standalone View
Standalone View
discover/qml/SourcesPage.qml
Show All 34 Lines | 30 | section.delegate: Kirigami.AbstractListItem { | |||
---|---|---|---|---|---|
35 | readonly property QtObject resourcesBackend: backend.resourcesBackend | 35 | readonly property QtObject resourcesBackend: backend.resourcesBackend | ||
36 | readonly property bool isDefault: ResourcesModel.currentApplicationBackend == resourcesBackend | 36 | readonly property bool isDefault: ResourcesModel.currentApplicationBackend == resourcesBackend | ||
37 | 37 | | |||
38 | RowLayout { | 38 | RowLayout { | ||
39 | Layout.fillHeight: true | 39 | Layout.fillHeight: true | ||
40 | Connections { | 40 | Connections { | ||
41 | target: backendItem.backend | 41 | target: backendItem.backend | ||
42 | onPassiveMessage: window.showPassiveNotification(message) | 42 | onPassiveMessage: window.showPassiveNotification(message) | ||
43 | onProceedRequest: { | ||||
44 | var dialog = sourceProceedDialog.createObject(window, {sourcesBackend: sourcesBackend, title: title, description: description}) | ||||
45 | dialog.open() | ||||
46 | } | ||||
43 | } | 47 | } | ||
44 | 48 | | |||
45 | Kirigami.Heading { | 49 | Kirigami.Heading { | ||
46 | Layout.fillWidth: true | 50 | Layout.fillWidth: true | ||
47 | Layout.leftMargin: Kirigami.Units.smallSpacing | 51 | Layout.leftMargin: Kirigami.Units.smallSpacing | ||
48 | Layout.alignment: Qt.AlignVCenter | 52 | Layout.alignment: Qt.AlignVCenter | ||
49 | text: backendItem.isDefault ? i18n("%1 (Default)", resourcesBackend.displayName) : resourcesBackend.displayName | 53 | text: backendItem.isDefault ? i18n("%1 (Default)", resourcesBackend.displayName) : resourcesBackend.displayName | ||
50 | level: 3 | 54 | level: 3 | ||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | 95 | Instantiator { | |||
101 | onObjectAdded: { | 105 | onObjectAdded: { | ||
102 | settingsMenu.insertItem(index, object) | 106 | settingsMenu.insertItem(index, object) | ||
103 | } | 107 | } | ||
104 | onObjectRemoved: { | 108 | onObjectRemoved: { | ||
105 | object.destroy() | 109 | object.destroy() | ||
106 | } | 110 | } | ||
107 | } | 111 | } | ||
108 | } | 112 | } | ||
109 | } | 113 | } | ||
apol: Remove unrelated patch | |||||
abhijeet2096: Actually, I modified this file to show EULA on setting page. | |||||
110 | } | 114 | } | ||
111 | } | 115 | } | ||
112 | 116 | | |||
117 | Component { | ||||
118 | id: sourceProceedDialog | ||||
119 | Kirigami.OverlaySheet { | ||||
120 | id: sheet | ||||
121 | showCloseButton: false | ||||
122 | property QtObject sourcesBackend | ||||
123 | property alias title: heading.text | ||||
124 | property alias description: desc.text | ||||
125 | property bool acted: false | ||||
126 | ColumnLayout { | ||||
127 | Kirigami.Heading { | ||||
128 | id: heading | ||||
129 | } | ||||
130 | Label { | ||||
131 | id: desc | ||||
132 | Layout.fillWidth: true | ||||
133 | textFormat: Text.StyledText | ||||
134 | wrapMode: Text.WordWrap | ||||
135 | } | ||||
136 | RowLayout { | ||||
137 | Layout.alignment: Qt.AlignRight | ||||
138 | Button { | ||||
139 | text: i18n("Proceed") | ||||
140 | icon.name: "dialog-ok" | ||||
141 | onClicked: { | ||||
142 | sourcesBackend.proceed() | ||||
143 | sheet.acted = true | ||||
144 | sheet.close() | ||||
145 | } | ||||
146 | } | ||||
147 | Button { | ||||
148 | Layout.alignment: Qt.AlignRight | ||||
149 | text: i18n("Cancel") | ||||
150 | icon.name: "dialog-cancel" | ||||
151 | onClicked: { | ||||
152 | sourcesBackend.cancel() | ||||
153 | sheet.acted = true | ||||
154 | sheet.close() | ||||
155 | } | ||||
156 | } | ||||
157 | } | ||||
158 | } | ||||
159 | onSheetOpenChanged: if(!sheetOpen) { | ||||
160 | sheet.destroy(1000) | ||||
161 | if (!sheet.acted) | ||||
162 | sourcesBackend.cancel() | ||||
163 | } | ||||
164 | } | ||||
165 | } | ||||
166 | | ||||
113 | delegate: Kirigami.SwipeListItem { | 167 | delegate: Kirigami.SwipeListItem { | ||
114 | Layout.fillWidth: true | 168 | Layout.fillWidth: true | ||
115 | enabled: display.length>0 | 169 | enabled: display.length>0 | ||
116 | highlighted: ListView.isCurrentItem | 170 | highlighted: ListView.isCurrentItem | ||
117 | onClicked: Navigation.openApplicationListSource(sourceId) | 171 | onClicked: Navigation.openApplicationListSource(sourceId) | ||
118 | 172 | | |||
119 | Keys.onReturnPressed: clicked() | 173 | Keys.onReturnPressed: clicked() | ||
120 | actions: [ | 174 | actions: [ | ||
▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines |
Remove unrelated patch