28 addContentEntry(contentList, QStringLiteral(
"paintoppresets"), [](
int count) {
29 return i18np(
"%1 brush preset",
"%1 brush presets", count);
32 return i18np(
"%1 brush tips",
"%1 brush tips", count);
34 addContentEntry(contentList, QStringLiteral(
"patterns"), [](
int count) {
35 return i18np(
"%1 texture patterns",
"%1 texture patterns", count);
37 addContentEntry(contentList, QStringLiteral(
"workspaces"), [](
int count) {
38 return i18np(
"%1 workspace layout",
"%1 workspace layouts", count);
43 switch (product.availability) {
44 case KisSupporterProductAvailability::Missing:
48 case KisSupporterProductAvailability::Available:
49 productList.append(product.title);
51 case KisSupporterProductAvailability::Owned:
52 if (product.type == KisSupporterProductType::Subscription) {
53 productList.append(i18n(
"%1 (subscribed)").arg(product.title));
55 productList.append(i18n(
"%1 (owned)").arg(product.title));
70 author = QStringLiteral(
"<a href=\"%1\">%2</a>").arg(
m_bundle.
source.toHtmlEscaped(), author);
72 m_lblTitle->setText(QStringLiteral(
"<strong>%1</strong> by %2").arg(
m_bundle.
title.toHtmlEscaped(), author));
76 QString productsText = QStringLiteral(
78 "ul { margin-top: 0px; margin-bottom: 4px; margin-left: -10px; }\n"
79 "li { margin: 0px; padding: 0px; }\n"
81 if (!contentList.isEmpty()) {
83 i18nc(
"in-app purchases, prefix for a list of what a bundle contains",
"Contains:").toHtmlEscaped());
84 productsText.append(QStringLiteral(
"<ul>"));
85 for (
const QString &content : contentList) {
86 productsText.append(QStringLiteral(
"<li>%1</li>").arg(content.toHtmlEscaped()));
88 productsText.append(QStringLiteral(
"</ul>"));
91 if (productList.isEmpty()) {
92 productsText.append(i18nc(
"in-app purchases, a bundle that the user can't acquire",
"Not available."));
95 i18nc(
"in-app purchases, prefix for a list of which purchases make a bundle available",
"Available with:")
97 productsText.append(QStringLiteral(
"<ul>"));
98 for (
const QString &product : productList) {
99 productsText.append(QStringLiteral(
"<li>%1</li>").arg(product.toHtmlEscaped()));
101 productsText.append(QStringLiteral(
"</ul>"));
104 m_lblProducts->setText(productsText);
109 m_stkDownload->setCurrentWidget(m_pgDone);
111 m_stkDownload->setCurrentWidget(m_pgGet);
113 m_stkDownload->setCurrentWidget(m_pgSupport);
119 if (androidDonations) {
122 m_btnSupport->setEnabled(
false);
175 if (reply->error() == QNetworkReply::OperationCanceledError) {
180 QString errorMessage;
187 QCoreApplication::processEvents();
189 QByteArray bytes = reply->readAll();
190 long long sizeInBytes = bytes.size();
198 QString hash = QCryptographicHash::hash(bytes, QCryptographicHash::Md5).toHex();
199 if (hash !=
bundle().checksum) {
208 QCoreApplication::processEvents();
211 QGuiApplication::setOverrideCursor(Qt::WaitCursor);
213 QGuiApplication::restoreOverrideCursor();