Changeset View
Changeset View
Standalone View
Standalone View
discover/qml/ApplicationPage.qml
Show All 39 Lines | 31 | DiscoverPage { | |||
---|---|---|---|---|---|
40 | ReviewsPage { | 40 | ReviewsPage { | ||
41 | id: reviewsSheet | 41 | id: reviewsSheet | ||
42 | model: ReviewsModel { | 42 | model: ReviewsModel { | ||
43 | id: reviewsModel | 43 | id: reviewsModel | ||
44 | resource: appInfo.application | 44 | resource: appInfo.application | ||
45 | } | 45 | } | ||
46 | } | 46 | } | ||
47 | 47 | | |||
48 | Kirigami.OverlaySheet { | 48 | contextualActions: [originsMenuAction] | ||
49 | id: originsOverlay | 49 | | ||
50 | bottomPadding: Kirigami.Units.largeSpacing | 50 | Kirigami.Action { | ||
51 | topPadding: Kirigami.Units.largeSpacing | 51 | id: originsMenuAction | ||
52 | readonly property alias model: alternativeResourcesView.model | 52 | | ||
53 | function listBackends() { | 53 | text: i18n("Sources") | ||
54 | var first = true; | 54 | visible: children.length>1 | ||
55 | var ret = ""; | 55 | readonly property var r0: Instantiator { | ||
56 | var m = alternativeResourcesView.model; | | |||
57 | for(var i=0, count=m.rowCount(); i<count; ++i) { | | |||
58 | var res = m.resourceAt(i) | | |||
59 | if (res != appInfo.application) { | | |||
60 | if (!first) { | | |||
61 | ret += ", " | | |||
62 | } | | |||
63 | ret += "<a href='" + i + "'>" + res.displayOrigin + "</a>" | | |||
64 | first = false | | |||
65 | } | | |||
66 | } | | |||
67 | return ret | | |||
68 | } | | |||
69 | readonly property string sentence: alternativeResourcesView.count <= 1 ? "" : i18n("\nAlso available in %1", listBackends()) | | |||
70 | ListView { | | |||
71 | id: alternativeResourcesView | | |||
72 | model: ResourcesProxyModel { | 56 | model: ResourcesProxyModel { | ||
57 | id: alternativeResourcesModel | ||||
73 | allBackends: true | 58 | allBackends: true | ||
74 | resourcesUrl: appInfo.application.url | 59 | resourcesUrl: appInfo.application.url | ||
75 | } | 60 | } | ||
76 | delegate: Kirigami.BasicListItem { | 61 | delegate: Kirigami.Action { | ||
77 | label: displayOrigin | 62 | text: displayOrigin | ||
63 | icon.name: sourceIcon | ||||
78 | checked: appInfo.application == model.application | 64 | checked: appInfo.application == model.application | ||
79 | onClicked: if(index>=0) { | 65 | onTriggered: if(index>=0) { | ||
80 | var res = model.application | 66 | var res = model.application | ||
81 | console.assert(res) | 67 | console.assert(res) | ||
82 | window.stack.pop() | 68 | window.stack.pop() | ||
83 | Navigation.openApplication(res) | 69 | Navigation.openApplication(res) | ||
84 | } | 70 | } | ||
85 | } | 71 | } | ||
72 | onObjectAdded: originsMenuAction.children.push(object) | ||||
86 | } | 73 | } | ||
87 | } | 74 | } | ||
88 | 75 | | |||
89 | actions { | 76 | actions { | ||
90 | main: appbutton.action | 77 | main: appbutton.action | ||
91 | right: Kirigami.Action { | 78 | right: Kirigami.Action { | ||
92 | visible: application.isInstalled && application.canExecute | 79 | visible: application.isInstalled && application.canExecute | ||
93 | text: application.executeLabel | 80 | text: application.executeLabel | ||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Line(s) | 136 | QQC2.ScrollBar { | |||
150 | id: screenshotsScrollbar | 137 | id: screenshotsScrollbar | ||
151 | Layout.fillWidth: true | 138 | Layout.fillWidth: true | ||
152 | } | 139 | } | ||
153 | 140 | | |||
154 | QQC2.Label { | 141 | QQC2.Label { | ||
155 | Layout.topMargin: Kirigami.Units.largeSpacing | 142 | Layout.topMargin: Kirigami.Units.largeSpacing | ||
156 | Layout.fillWidth: true | 143 | Layout.fillWidth: true | ||
157 | wrapMode: Text.WordWrap | 144 | wrapMode: Text.WordWrap | ||
158 | text: appInfo.application.longDescription + originsOverlay.sentence | 145 | text: appInfo.application.longDescription | ||
159 | onLinkActivated: { | | |||
160 | var idx = parseInt(link, 10) | | |||
161 | var res = originsOverlay.model.resourceAt(idx) | | |||
162 | window.stack.pop() | | |||
163 | Navigation.openApplication(res) | | |||
164 | } | | |||
165 | } | 146 | } | ||
166 | 147 | | |||
167 | Kirigami.Heading { | 148 | Kirigami.Heading { | ||
168 | Layout.topMargin: Kirigami.Units.largeSpacing | 149 | Layout.topMargin: Kirigami.Units.largeSpacing | ||
169 | text: i18n("What's New") | 150 | text: i18n("What's New") | ||
170 | level: 2 | 151 | level: 2 | ||
171 | visible: changelogLabel.text.length > 0 | 152 | visible: changelogLabel.text.length > 0 | ||
172 | } | 153 | } | ||
▲ Show 20 Lines • Show All 120 Lines • ▼ Show 20 Line(s) | 271 | QQC2.Label { | |||
293 | text: i18n("%1", appInfo.application.sizeDescription) | 274 | text: i18n("%1", appInfo.application.sizeDescription) | ||
294 | } | 275 | } | ||
295 | 276 | | |||
296 | // Source row | 277 | // Source row | ||
297 | QQC2.Label { | 278 | QQC2.Label { | ||
298 | Layout.alignment: Qt.AlignRight | 279 | Layout.alignment: Qt.AlignRight | ||
299 | text: i18n("Source:") | 280 | text: i18n("Source:") | ||
300 | } | 281 | } | ||
301 | LinkButton { | 282 | QQC2.Label { | ||
302 | Layout.fillWidth: true | 283 | Layout.fillWidth: true | ||
303 | horizontalAlignment: Text.AlignLeft | 284 | horizontalAlignment: Text.AlignLeft | ||
304 | enabled: alternativeResourcesView.count > 1 | | |||
305 | text: appInfo.application.displayOrigin | 285 | text: appInfo.application.displayOrigin | ||
306 | elide: Text.ElideRight | 286 | elide: Text.ElideRight | ||
307 | onClicked: originsOverlay.open() | | |||
308 | } | 287 | } | ||
309 | 288 | | |||
310 | // License row | 289 | // License row | ||
311 | QQC2.Label { | 290 | QQC2.Label { | ||
312 | Layout.alignment: Qt.AlignRight | 291 | Layout.alignment: Qt.AlignRight | ||
313 | text: i18n("License:") | 292 | text: i18n("License:") | ||
314 | visible: appInfo.application.license.length>0 | 293 | visible: appInfo.application.license.length>0 | ||
315 | } | 294 | } | ||
▲ Show 20 Lines • Show All 82 Lines • Show Last 20 Lines |