21 : QWidget(parent)
24{
25 setupUi(this);
26
28 addContentEntry(contentList, QStringLiteral(
"paintoppresets"), [](
int count) {
29 return i18np("%1 brush preset", "%1 brush presets", count);
30 });
32 return i18np("%1 brush tips", "%1 brush tips", count);
33 });
34 addContentEntry(contentList, QStringLiteral(
"patterns"), [](
int count) {
35 return i18np("%1 texture patterns", "%1 texture patterns", count);
36 });
37 addContentEntry(contentList, QStringLiteral(
"workspaces"), [](
int count) {
38 return i18np("%1 workspace layout", "%1 workspace layouts", count);
39 });
40
43 switch (product.availability) {
44 case KisSupporterProductAvailability::Missing:
45
46
47 break;
48 case KisSupporterProductAvailability::Available:
49 productList.append(product.title);
50 break;
51 case KisSupporterProductAvailability::Owned:
52 if (product.type == KisSupporterProductType::Subscription) {
53 productList.append(i18n("%1 (subscribed)").arg(product.title));
54 } else {
55 productList.append(i18n("%1 (owned)").arg(product.title));
56 }
58 break;
59 }
60 }
61
63 m_lblPreview->hide();
64 } else {
66 }
67
70 author = QStringLiteral(
"<a href=\"%1\">%2</a>").arg(
m_bundle.
source.toHtmlEscaped(), author);
71 }
72 m_lblTitle->setText(QStringLiteral(
"<strong>%1</strong> by %2").arg(
m_bundle.
title.toHtmlEscaped(), author));
74
75
76 QString productsText = QStringLiteral(
77 "<style>\n"
78 "ul { margin-top: 0px; margin-bottom: 4px; margin-left: -10px; }\n"
79 "li { margin: 0px; padding: 0px; }\n"
80 "</style>");
81 if (!contentList.isEmpty()) {
82 productsText.append(
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()));
87 }
88 productsText.append(QStringLiteral("</ul>"));
89 }
90
91 if (productList.isEmpty()) {
92 productsText.append(i18nc("in-app purchases, a bundle that the user can't acquire", "Not available."));
93 } else {
94 productsText.append(
95 i18nc("in-app purchases, prefix for a list of which purchases make a bundle available", "Available with:")
96 .toHtmlEscaped());
97 productsText.append(QStringLiteral("<ul>"));
98 for (const QString &product : productList) {
99 productsText.append(QStringLiteral("<li>%1</li>").arg(product.toHtmlEscaped()));
100 }
101 productsText.append(QStringLiteral("</ul>"));
102 }
103
104 m_lblProducts->setText(productsText);
105
109 m_stkDownload->setCurrentWidget(m_pgDone);
111 m_stkDownload->setCurrentWidget(m_pgGet);
112 } else {
113 m_stkDownload->setCurrentWidget(m_pgSupport);
114 }
115
117
119 if (androidDonations) {
121 } else {
122 m_btnSupport->setEnabled(false);
123 }
124}
void slotStartDonationFlow()
static KisAndroidDonations * instance()
static KisStorageModel * instance()
bool canImportStorage(const QString &filename) const