Changeset View
Changeset View
Standalone View
Standalone View
src/qtquick/qml/EntryDetails.qml
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Line(s) | 41 | KCM.SimpleKCM { | |||
---|---|---|---|---|---|
55 | property int downloadCount | 55 | property int downloadCount | ||
56 | property var downloadLinks | 56 | property var downloadLinks | ||
57 | property string providerId | 57 | property string providerId | ||
58 | 58 | | |||
59 | NewStuff.DownloadItemsSheet { | 59 | NewStuff.DownloadItemsSheet { | ||
60 | id: downloadItemsSheet | 60 | id: downloadItemsSheet | ||
61 | onItemPicked: { | 61 | onItemPicked: { | ||
62 | var entryName = newStuffModel.data(newStuffModel.index(entryId, 0), NewStuff.ItemsModel.NameRole); | 62 | var entryName = newStuffModel.data(newStuffModel.index(entryId, 0), NewStuff.ItemsModel.NameRole); | ||
63 | applicationWindow().showPassiveNotification(i18nc("A passive notification shown when installation of an item is initiated", "Installing %1 from %2").arg(downloadName).arg(entryName), 1500); | 63 | applicationWindow().showPassiveNotification(i18nc("A passive notification shown when installation of an item is initiated", "Installing %1 from %2", downloadName, entryName), 1500); | ||
64 | newStuffModel.installItem(entryId, downloadItemId); | 64 | newStuffModel.installItem(entryId, downloadItemId); | ||
65 | } | 65 | } | ||
66 | } | 66 | } | ||
67 | 67 | | |||
68 | Connections { | 68 | Connections { | ||
69 | target: newStuffModel | 69 | target: newStuffModel | ||
70 | onEntryChanged: { | 70 | onEntryChanged: { | ||
71 | var status = newStuffModel.data(newStuffModel.index(index, 0), NewStuff.ItemsModel.StatusRole); | 71 | var status = newStuffModel.data(newStuffModel.index(index, 0), NewStuff.ItemsModel.StatusRole); | ||
72 | if (status == NewStuff.ItemsModel.DownloadableStatus | 72 | if (status == NewStuff.ItemsModel.DownloadableStatus | ||
73 | || status == NewStuff.ItemsModel.InstalledStatus | 73 | || status == NewStuff.ItemsModel.InstalledStatus | ||
74 | || status == NewStuff.ItemsModel.UpdateableStatus | 74 | || status == NewStuff.ItemsModel.UpdateableStatus | ||
75 | || status == NewStuff.ItemsModel.DeletedStatus) { | 75 | || status == NewStuff.ItemsModel.DeletedStatus) { | ||
76 | statusCard.message = ""; | 76 | statusCard.message = ""; | ||
77 | } else if (status == NewStuff.ItemsModel.InstallingStatus) { | 77 | } else if (status == NewStuff.ItemsModel.InstallingStatus) { | ||
78 | statusCard.message = i18nc("Status message to be shown when the entry is in the process of being installed", "Currently installing the item %1 by %2. Please wait...").arg(component.name).arg(entryAuthor.name); | 78 | statusCard.message = i18nc("Status message to be shown when the entry is in the process of being installed", "Currently installing the item %1 by %2. Please wait...", component.name, entryAuthor.name); | ||
79 | } else if (status == NewStuff.ItemsModel.UpdatingStatus) { | 79 | } else if (status == NewStuff.ItemsModel.UpdatingStatus) { | ||
80 | statusCard.message = i18nc("Status message to be shown when the entry is in the process of being updated", "Currently updating the item %1 by %2. Please wait...").arg(component.name).arg(entryAuthor.name); | 80 | statusCard.message = i18nc("Status message to be shown when the entry is in the process of being updated", "Currently updating the item %1 by %2. Please wait...", component.name, entryAuthor.name); | ||
81 | } else { | 81 | } else { | ||
82 | statusCard.message = i18nc("Status message which should only be shown when the entry has been given some unknown or invalid status.", "This item is currently in an invalid or unknown state. Please report this to the KDE Community in a bug report."); | 82 | statusCard.message = i18nc("Status message which should only be shown when the entry has been given some unknown or invalid status.", "This item is currently in an invalid or unknown state. Please report this to the KDE Community in a bug report."); | ||
83 | } | 83 | } | ||
84 | } | 84 | } | ||
85 | } | 85 | } | ||
86 | 86 | | |||
87 | NewStuff.Author { | 87 | NewStuff.Author { | ||
88 | id: entryAuthor | 88 | id: entryAuthor | ||
89 | engine: component.newStuffModel.engine | 89 | engine: component.newStuffModel.engine | ||
90 | providerId: component.providerId | 90 | providerId: component.providerId | ||
91 | username: author.name | 91 | username: author.name | ||
92 | } | 92 | } | ||
93 | title: i18nc("Combined title for the entry details page made of the name of the entry, and the author's name", "%1 by %2").arg(component.name).arg(entryAuthor.name) | 93 | title: i18nc("Combined title for the entry details page made of the name of the entry, and the author's name", "%1 by %2", component.name, entryAuthor.name) | ||
94 | actions { | 94 | actions { | ||
95 | contextualActions: [ | 95 | contextualActions: [ | ||
96 | Kirigami.Action { | 96 | Kirigami.Action { | ||
97 | text: component.downloadCount == 1 ? i18nc("Request installation of this item, available when there is exactly one downloadable item", "Install") : i18nc("Show installation options, where there is more than one downloadable item", "Install..."); | 97 | text: component.downloadCount == 1 ? i18nc("Request installation of this item, available when there is exactly one downloadable item", "Install") : i18nc("Show installation options, where there is more than one downloadable item", "Install..."); | ||
98 | icon.name: "install" | 98 | icon.name: "install" | ||
99 | onTriggered: { | 99 | onTriggered: { | ||
100 | if (component.downloadCount == 1) { | 100 | if (component.downloadCount == 1) { | ||
101 | newStuffModel.installItem(component.index); | 101 | newStuffModel.installItem(component.index); | ||
▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Line(s) | 169 | Kirigami.Heading { | |||
170 | id: shortSummaryItem | 170 | id: shortSummaryItem | ||
171 | QtLayouts.Layout.fillWidth: true | 171 | QtLayouts.Layout.fillWidth: true | ||
172 | } | 172 | } | ||
173 | Kirigami.FormLayout { | 173 | Kirigami.FormLayout { | ||
174 | QtLayouts.Layout.fillWidth: true | 174 | QtLayouts.Layout.fillWidth: true | ||
175 | Kirigami.LinkButton { | 175 | Kirigami.LinkButton { | ||
176 | Kirigami.FormData.label: i18n("Comments and Reviews:") | 176 | Kirigami.FormData.label: i18n("Comments and Reviews:") | ||
177 | enabled: component.commentsCount > 0 | 177 | enabled: component.commentsCount > 0 | ||
178 | text: i18nc("A link which, when clicked, opens a new sub page with comments (comments with or without ratings) for this entry", "%1 Reviews and Comments").arg(component.commentsCount) | 178 | text: i18nc("A link which, when clicked, opens a new sub page with comments (comments with or without ratings) for this entry", "%1 Reviews and Comments", component.commentsCount) | ||
179 | onClicked: pageStack.push(commentsPage) | 179 | onClicked: pageStack.push(commentsPage) | ||
180 | } | 180 | } | ||
181 | Private.Rating { | 181 | Private.Rating { | ||
182 | id: ratingsItem | 182 | id: ratingsItem | ||
183 | Kirigami.FormData.label: i18n("Rating:") | 183 | Kirigami.FormData.label: i18n("Rating:") | ||
184 | rating: Math.floor(component.rating / 10) | 184 | rating: Math.floor(component.rating / 10) | ||
185 | } | 185 | } | ||
186 | Kirigami.LinkButton { | 186 | Kirigami.LinkButton { | ||
187 | Kirigami.FormData.label: i18n("Homepage:") | 187 | Kirigami.FormData.label: i18n("Homepage:") | ||
188 | text: i18nc("A link which, when clicked, opens the website associated with the entry (this could be either one specific to the project, the author's homepage, or any other website they have chosen for the purpose)", "Open the homepage for %2").arg(component.name) | 188 | text: i18nc("A link which, when clicked, opens the website associated with the entry (this could be either one specific to the project, the author's homepage, or any other website they have chosen for the purpose)", "Open the homepage for %1", component.name) | ||
189 | onClicked: Qt.openUrlExternally(component.homepage) | 189 | onClicked: Qt.openUrlExternally(component.homepage) | ||
190 | } | 190 | } | ||
191 | Kirigami.LinkButton { | 191 | Kirigami.LinkButton { | ||
192 | Kirigami.FormData.label: i18n("How To Donate:") | 192 | Kirigami.FormData.label: i18n("How To Donate:") | ||
193 | text: i18nc("A link which, when clicked, opens a website with information on donation in support of the entry", "Find out how to donate to this project") | 193 | text: i18nc("A link which, when clicked, opens a website with information on donation in support of the entry", "Find out how to donate to this project") | ||
194 | onClicked: Qt.openUrlExternally(component.donationLink) | 194 | onClicked: Qt.openUrlExternally(component.donationLink) | ||
195 | } | 195 | } | ||
196 | } | 196 | } | ||
Show All 19 Lines |