Krita Source Code Documentation
Loading...
Searching...
No Matches
KisSupporterBundleWidget.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: GPL-3.0-or-later
3 */
4#ifndef __KISSUPPORTERBUNDLEWIDGET_H_
5#define __KISSUPPORTERBUNDLEWIDGET_H_
6
7#include <QPointer>
8#include <QVector>
9#include <QWidget>
10#include <functional>
11
12#include "KisSupporterBundle.h"
14#include "ui_KisSupporterBundleWidget.h"
15#include <KisSupporterProduct.h>
16
17class QNetworkReply;
18class QProgressDialog;
19
20class KisSupporterBundleWidget : public QWidget, public Ui::KisSupporterBundleWidget
21{
22 Q_OBJECT
23public:
26 const QVector<KisSupporterProduct> &bundleProducts,
27 QWidget *parent = nullptr);
28
30 {
31 return m_bundle;
32 }
33
34 bool isProductOwned() const
35 {
36 return m_productOwned;
37 }
38
39 bool canImport() const
40 {
41 return m_canImport;
42 }
43
44private Q_SLOTS:
45 void slotStartDownload();
46 void slotUpdateDownloadProgress(qint64 bytesReceived, qint64 bytesTotal);
47
48private:
49 void
50 addContentEntry(QStringList &outContentList, const QString &key, const std::function<QString(int)> &formatFn) const;
51
52 void handleDownloadFinished(QNetworkReply *reply);
53 void showFinishedDownload(bool success, bool cancel, const QString &errorMessage);
54 void closeProgressDlg();
55
57 QProgressDialog *m_progressDlg{nullptr};
59 bool m_productOwned{false};
61};
62
63#endif
void handleDownloadFinished(QNetworkReply *reply)
void showFinishedDownload(bool success, bool cancel, const QString &errorMessage)
KisSupporterBundleWidget(KisSupporterBundlesFetcher *fetcher, const KisSupporterBundle &bundle, const QVector< KisSupporterProduct > &bundleProducts, QWidget *parent=nullptr)
const KisSupporterBundle & bundle() const
QPointer< KisSupporterBundlesFetcher > m_fetcher
void addContentEntry(QStringList &outContentList, const QString &key, const std::function< QString(int)> &formatFn) const
void slotUpdateDownloadProgress(qint64 bytesReceived, qint64 bytesTotal)