11#include <QDesktopServices>
15#include <QTemporaryFile>
17#include <QNetworkAccessManager>
19#include <QDomDocument>
29#include "KConfigGroup"
30#include "KSharedConfig"
33#include <QListWidgetItem>
51#include <QCoreApplication>
57#include "config-updaters.h"
67#include <klocalizedstring.h>
86#include <QFontMetrics>
87#include <QPaintDevice>
89#include <QPainterPath>
90#include <QRandomGenerator>
100 : QStyledItemDelegate(parent)
109 QSize
sizeHint(
const QStyleOptionViewItem &option,
const QModelIndex &)
const override
111 return QSize(option.rect.width(),
itemHeight);
123 devBuildLabel->setVisible(
false);
124 updaterFrame->setVisible(
false);
125 versionNotificationLabel->setVisible(
false);
126 bnVersionUpdate->setVisible(
false);
127 bnErrorDetails->setVisible(
false);
130 recentDocumentsListView->setDragEnabled(
false);
131 recentDocumentsListView->viewport()->setAutoFillBackground(
false);
132 recentDocumentsListView->setSpacing(2);
133 recentDocumentsListView->installEventFilter(
this);
134 recentDocumentsListView->setViewMode(QListView::IconMode);
135 recentDocumentsListView->setSelectionMode(QAbstractItemView::NoSelection);
136 recentDocumentsListView->setVerticalScrollMode(QListView::ScrollPerPixel);
137 recentDocumentsListView->verticalScrollBar()->setSingleStep(50);
144 recentDocumentsListView->setContextMenuPolicy(Qt::CustomContextMenu);
149 QMenu *newsOptionsMenu =
new QMenu(
this);
150 newsOptionsMenu->setToolTipsVisible(
true);
151 m_enableNewsAction = newsOptionsMenu->addAction(i18n(
"Automatically check for updates"));
152 m_enableNewsAction->setToolTip(i18n(
"Show news about Krita: this needs internet to retrieve information from the krita.org website"));
155 newsOptionsMenu->addSection(i18n(
"Language"));
156 QAction *newsInfoAction = newsOptionsMenu->addAction(i18n(
"English news is always up to date."));
157 newsInfoAction->setEnabled(
false);
160 btnNewsOptions->setMenu(newsOptionsMenu);
166 connect(btnDismisAll, SIGNAL(clicked()), newsWidget, SLOT(dismissAll()));
172 connect(checkNowButton, SIGNAL(clicked()),
this, SLOT(
slotCheckNews()));
174 supporterBadge->hide();
175 wdgAndroidSupportBanner->hide();
183 bool newsCheckEnabled, newsFirstStartup;
192 enableNewsBox->setChecked(newsCheckEnabled);
194#ifdef ENABLE_UPDATERS
204#if defined Q_OS_LINUX
205 if (!qEnvironmentVariableIsSet(
"SteamAppId")) {
206 if (qEnvironmentVariableIsSet(
"APPIMAGE")) {
210 if (m_versionUpdater.isNull() || !m_versionUpdater->hasUpdateCapability()) {
214#elif defined Q_OS_WIN
225 if (!m_versionUpdater.isNull()) {
226 connect(bnVersionUpdate, SIGNAL(clicked()),
this, SLOT(slotRunVersionUpdate()));
227 connect(bnErrorDetails, SIGNAL(clicked()),
this, SLOT(slotShowUpdaterErrorDetails()));
228 connect(m_versionUpdater.data(), SIGNAL(sigUpdateCheckStateChange(
KisUpdaterStatus)),
234 if (newsCheckEnabled && !newsFirstStartup) {
241 setAcceptDrops(
true);
257 connect(recentDocumentsListView, SIGNAL(clicked(QModelIndex)),
this, SLOT(
recentDocumentClicked(QModelIndex)));
262 connect(clearRecentFilesLink, SIGNAL(clicked(
bool)), mainWin, SLOT(clearRecentFiles()));
265 connect(pasteAction, SIGNAL(triggered()),
this, SLOT(
slotPaste()));
274 recentDocumentsListView->setModel(&recentFilesModel->
model());
283 QString dropFrameStyle = QStringLiteral(
"QFrame#dropAreaIndicator { border: 2px solid transparent }");
284 dropFrameBorder->setStyleSheet(dropFrameStyle);
286 QColor
textColor = qApp->palette().color(QPalette::Text);
291 QString dropFrameStyle = QString(
"QFrame#dropAreaIndicator { border: 2px dotted ").append(
blendedColor.name()).append(
" }") ;
292 dropFrameBorder->setStyleSheet(dropFrameStyle);
298 textColor = qApp->palette().color(QPalette::Text);
325 dropFrameBorder->setObjectName(
"dropAreaIndicator");
326 QString dropFrameStyle = QString(
"QFrame#dropAreaIndicator { border: 4px dotted ").append(
blendedColor.name()).append(
"}");
327 dropFrameBorder->setStyleSheet(dropFrameStyle);
333 openFileLink->setIconSize(QSize(48, 48));
334 newFileLink->setIconSize(QSize(48, 48));
340 btnNewsOptions->setFlat(
true);
353 userCommunityLink->setText(QString(
"<a style=\"color: " +
blendedColor.name() +
" \" href=\"https://krita-artists.org\">")
354 .append(i18n(
"User Community")).append(
"</a>"));
356 gettingStartedLink->setText(QString(
"<a style=\"color: " +
blendedColor.name() +
" \" href=\"https://docs.krita.org/user_manual/getting_started.html\">")
357 .append(i18n(
"Getting Started")).append(
"</a>"));
359 manualLink->setText(QString(
"<a style=\"color: " +
blendedColor.name() +
" \" href=\"https://docs.krita.org\">")
360 .append(i18n(
"User Manual")).append(
"</a>"));
362 supportKritaLink->setText(QString(
"<a style=\"color: " +
blendedColor.name() +
" \" href=\"https://krita.org/support-us/donations?" +
analyticsString +
"donations" +
"\">")
363 .append(i18n(
"Support Krita")).append(
"</a>"));
365 kritaWebsiteLink->setText(QString(
"<a style=\"color: " +
blendedColor.name() +
" \" href=\"https://www.krita.org?" +
analyticsString +
"marketing-site" +
"\">")
366 .append(i18n(
"Krita Website")).append(
"</a>"));
368 sourceCodeLink->setText(QString(
"<a style=\"color: " +
blendedColor.name() +
" \" href=\"https://invent.kde.org/graphics/krita\">")
369 .append(i18n(
"Source Code")).append(
"</a>"));
371 poweredByKDELink->setText(QString(
"<a style=\"color: " +
blendedColor.name() +
" \" href=\"https://userbase.kde.org/What_is_KDE\">")
372 .append(i18n(
"Powered by KDE")).append(
"</a>"));
375 const QString &frameQss =
"{border: 1px solid " + frameColor.name() +
"}";
376 recentDocsStackedWidget->setStyleSheet(
"QStackedWidget#recentDocsStackedWidget" + frameQss);
377 newsFrame->setStyleSheet(
"QFrame#newsFrame" + frameQss);
382#ifdef ENABLE_UPDATERS
383 updateVersionUpdaterFrame();
389 supportKritaLink->hide();
390 supportKritaIcon->hide();
391 labelSupportText->hide();
392 kritaWebsiteLink->hide();
393 kritaWebsiteIcon->hide();
401 if (event->mimeData()->hasUrls() ||
402 event->mimeData()->hasFormat(
"application/x-krita-node-internal-pointer") ||
403 event->mimeData()->hasFormat(
"application/x-qt-image")) {
404 return event->accept();
407 return event->ignore();
414 if (event->mimeData()->hasUrls() && !event->mimeData()->urls().empty()) {
415 Q_FOREACH (
const QUrl &url, event->mimeData()->urls()) {
416 if (url.toLocalFile().endsWith(
".bundle", Qt::CaseInsensitive)) {
419 qWarning() <<
"Could not install bundle" << url.toLocalFile();
421 }
else if (!url.isLocalFile()) {
422 QScopedPointer<QTemporaryFile>
tmp(
new QTemporaryFile());
423 tmp->setFileName(url.fileName());
428 qWarning() <<
"Fetching" << url <<
"failed";
431 const auto localUrl = QUrl::fromLocalFile(
tmp->fileName());
445 if (event->mimeData()->hasUrls() ||
446 event->mimeData()->hasFormat(
"application/x-krita-node-internal-pointer") ||
447 event->mimeData()->hasFormat(
"application/x-qt-image")) {
448 return event->accept();
451 return event->ignore();
462 if (event->type() == QEvent::FontChange) {
469 if (watched == recentDocumentsListView && event->type() == QEvent::Leave) {
470 recentDocumentsListView->clearSelection();
471 }
else if (watched == recentDocumentsListView && event->type() == QEvent::Resize) {
474 return QWidget::eventFilter(watched, event);
479QString getAutoNewsLang()
482 const QStringList uiLangs = KLocalizedString::languages();
483 QString autoNewsLang = uiLangs.first();
484 if (autoNewsLang.isEmpty()) {
486 autoNewsLang = QString(
"en");
487 }
else if (autoNewsLang ==
"jp") {
488 return QString(
"ja");
489 }
else if (autoNewsLang ==
"zh_CN") {
490 return QString(
"zh-cn");
491 }
else if (autoNewsLang ==
"zh_TW") {
492 return QString(
"zh-tw");
493 }
else if (autoNewsLang ==
"zh_HK") {
494 return QString(
"zh-hk");
495 }
else if (autoNewsLang ==
"en" || autoNewsLang ==
"en_US" || autoNewsLang ==
"en_GB") {
496 return QString(
"en");
512 const QString siteCode;
515 static const std::array<Lang, 22> newsLangs = {{
516 {QString(
"en"), QStringLiteral(
"English")},
517 {QString(
"ja"), QStringLiteral(
"日本語")},
518 {QString(
"zh-cn"), QStringLiteral(
"中文 (简体)")},
519 {QString(
"zh-tw"), QStringLiteral(
"中文 (台灣正體)")},
520 {QString(
"zh-hk"), QStringLiteral(
"廣東話 (香港)")},
521 {QString(
"ca"), QStringLiteral(
"Català")},
522 {QString(
"ca@valencia"), QStringLiteral(
"Català de Valencia")},
523 {QString(
"cs"), QStringLiteral(
"Čeština")},
524 {QString(
"de"), QStringLiteral(
"Deutsch")},
525 {QString(
"eo"), QStringLiteral(
"Esperanto")},
526 {QString(
"es"), QStringLiteral(
"Español")},
527 {QString(
"eu"), QStringLiteral(
"Euskara")},
528 {QString(
"fr"), QStringLiteral(
"Français")},
529 {QString(
"it"), QStringLiteral(
"Italiano")},
530 {QString(
"lt"), QStringLiteral(
"lietuvių")},
531 {QString(
"nl"), QStringLiteral(
"Nederlands")},
532 {QString(
"pt"), QStringLiteral(
"Português")},
533 {QString(
"sk"), QStringLiteral(
"Slovenský")},
534 {QString(
"sl"), QStringLiteral(
"Slovenski")},
535 {QString(
"sv"), QStringLiteral(
"Svenska")},
536 {QString(
"tr"), QStringLiteral(
"Türkçe")},
537 {QString(
"uk"), QStringLiteral(
"Українська")}
540 static const QString newsLangConfigName = QStringLiteral(
"FetchNewsLanguages");
546 auto languagesList = cfg.
readList<QString>(newsLangConfigName);
547 *enabledNewsLangs = QSet(languagesList.begin(), languagesList.end());
551 if (enabledNewsLangs->isEmpty()) {
552 enabledNewsLangs->insert(QString(getAutoNewsLang()));
555 for (
const auto &lang : newsLangs) {
556 QAction *langItem = newsOptionsMenu->addAction(lang.name);
557 langItem->setCheckable(
true);
560 const QString code = lang.siteCode;
561 connect(langItem, &QAction::toggled, newsWidget, [=](
bool checked) {
562 newsWidget->toggleNewsLanguage(code, checked);
566 if (enabledNewsLangs->contains(code)) {
567 langItem->setChecked(
true);
572 connect(langItem, &QAction::toggled, qApp, [=](
bool checked) {
578 enabledNewsLangs->insert(QString(code));
580 enabledNewsLangs->remove(QString(code));
582 cfg.
writeList(newsLangConfigName, enabledNewsLangs->values());
591 QString devBuildLabelText = QString(
"<a style=\"color: " +
593 " \" href=\"https://docs.krita.org/en/untranslatable_pages/triaging_bugs.html?"
595 .append(i18n(
"DEV BUILD")).append(
"</a>");
597 devBuildLabel->setText(devBuildLabelText);
598 devBuildIcon->setVisible(
true);
599 devBuildLabel->setVisible(
true);
601 devBuildIcon->setVisible(
false);
602 devBuildLabel->setVisible(
false);
609 QString shortcutText = action->shortcut().toString(QKeySequence::NativeText);
610 if (shortcutText.isEmpty()) {
611 label->setText(QString());
613 label->setText(QStringLiteral(
"(%1)").arg(shortcutText));
625 QString fileUrl = index.data(Qt::ToolTipRole).toString();
632 QModelIndex index = recentDocumentsListView->indexAt(pos);
633 QAction *actionForget = 0;
634 if (index.isValid()) {
635 actionForget =
new QAction(i18n(
"Forget \"%1\"", index.data(Qt::DisplayRole).toString()), &contextMenu);
636 contextMenu.addAction(actionForget);
638 QAction *triggered = contextMenu.exec(recentDocumentsListView->mapToGlobal(pos));
640 if (index.isValid() && triggered == actionForget) {
662 if (!this->isVisible())
679 const bool modelIsEmpty = recentFilesModel->
model().rowCount() == 0;
682 recentDocsStackedWidget->setCurrentWidget(labelNoRecentDocs);
684 recentDocsStackedWidget->setCurrentWidget(recentDocumentsListView);
686 clearRecentFilesLink->setVisible(!modelIsEmpty);
691 enableNewsBox->setChecked(newsEnabled);
698 checkNowButton->setEnabled(
false);
699 noNewsWidget->hide();
701 newsWidget->toggleNews(
true);
702#ifdef ENABLE_UPDATERS
703 if (m_versionUpdater) {
704 m_versionUpdater->checkForUpdate();
705 updateVersionUpdaterFrame();
710#ifdef ENABLE_UPDATERS
711void KisWelcomePageWidget::slotRunVersionUpdate()
713 if (!m_versionUpdater.isNull()) {
714 m_versionUpdater->doUpdate();
718void KisWelcomePageWidget::slotSetUpdateStatus(
KisUpdaterStatus updateStatus)
720 m_updaterStatus = updateStatus;
721 updateVersionUpdaterFrame();
724void KisWelcomePageWidget::slotShowUpdaterErrorDetails()
726 QMessageBox::warning(qApp->activeWindow(), i18nc(
"@title:window",
"Krita"), m_updaterStatus.updaterOutput());
729void KisWelcomePageWidget::updateVersionUpdaterFrame()
731 updaterFrame->setVisible(
false);
732 versionNotificationLabel->setVisible(
false);
733 versionNotificationLabel->setEnabled(
false);
734 updateWidget->setVisible(
false);
735 bnVersionUpdate->setVisible(
false);
736 bnErrorDetails->setVisible(
false);
738 if (m_versionUpdater.isNull()) {
742 QString versionLabelText;
745 updaterFrame->setVisible(
true);
746 updaterFrame->setEnabled(
true);
747 versionLabelText = i18n(
"New version of Krita is available.");
748 versionNotificationLabel->setEnabled(
true);
749 versionNotificationLabel->setVisible(
true);
752 if (m_versionUpdater->hasUpdateCapability()) {
753 bnVersionUpdate->setVisible(
true);
754 updateWidget->setVisible(
true);
757 QString downloadLink = QString(
" <a style=\"color: %1; text-decoration: underline\" href=\"%2?%3\">Download Krita %4</a>")
759 .arg(m_updaterStatus.downloadLink())
761 .arg(m_updaterStatus.availableVersion());
763 versionLabelText.append(downloadLink);
774 updaterFrame->setVisible(
false);
777 updaterFrame->setVisible(
true);
778 versionLabelText = i18n(
"An error occurred during the update");
779 versionNotificationLabel->setVisible(
true);
780 bnErrorDetails->setVisible(
true);
781 updateWidget->setVisible(
true);
784 updaterFrame->setVisible(
true);
785 versionLabelText = QString(
"<b>%1</b> %2").arg(i18n(
"Restart is required.")).arg(m_updaterStatus.details());
786 versionNotificationLabel->setVisible(
true);
790 versionNotificationLabel->setText(versionLabelText);
798void KisWelcomePageWidget::initDonations()
801 if (!androidDonations) {
802 qWarning(
"KisWelcomePage::initDonations: androidDonations is null");
807 int bannerIndex = QRandomGenerator::global()->bounded(1, 5);
812 qreal rh = 1.0 - ry * 2.0;
815 switch (bannerIndex) {
819 rw = 1.0 - rx - rwpad;
827 qWarning(
"Unhandled banner index %d", bannerIndex);
829 rw = 1.0 - rwpad * 2.0;
833 QString welcomeBannerPath =
834 QStandardPaths::locate(QStandardPaths::AppDataLocation,
835 QStringLiteral(
"share/krita/donation/welcomebanner%1.jpg").arg(bannerIndex));
836 QPixmap welcomeBannerPixmap(welcomeBannerPath);
838 if (welcomeBannerPixmap.isNull()) {
839 qWarning(
"KisWelcomePage::initDonations: failed to load welcome banner from '%s'",
840 qUtf8Printable(welcomeBannerPath));
844 i18n(
"Become a Supporter!"),
845 i18n(
"Support Krita!"),
848 i18n(
"Supporters get brush packs and more."),
849 i18n(
"Contributions keep development going."),
851 QString headline = headlines[QRandomGenerator::global()->bounded(headlines.size())];
852 QString subtitle = subtitles[QRandomGenerator::global()->bounded(subtitles.size())];
860 QPainter painter(&welcomeBannerPixmap);
861 painter.setRenderHint(QPainter::Antialiasing);
862 painter.setRenderHint(QPainter::TextAntialiasing);
864 QPen pen(Qt::black, 12.0, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
865 QBrush brush(Qt::white);
867 qreal verticalSeparation = 40.0;
870 QFont currentFont = font();
871 currentFont.setPointSize(100);
872 currentFont.setBold(
false);
873 QPainterPath topPath;
874 topPath.addText(0, 0, currentFont, headline);
875 QRectF topBounds = topPath.boundingRect();
878 currentFont.setPointSize(60);
879 currentFont.setBold(
true);
880 QPainterPath bottomPath;
881 bottomPath.addText(0, 0, currentFont, subtitle);
882 QRectF bottomBounds = bottomPath.boundingRect();
886 qreal maxWidth = qMax(topBounds.width(), bottomBounds.width());
887 qreal topOffsetX = (maxWidth - topBounds.width()) / 2.0;
888 qreal bottomOffsetX = (maxWidth - bottomBounds.width()) / 2.0;
890 QTransform topTransform;
891 topTransform.translate(topOffsetX - topBounds.left(), -topBounds.top());
892 topPath = topTransform.map(topPath);
893 topPath.setFillRule(Qt::WindingFill);
895 QTransform bottomTransform;
896 bottomTransform.translate(bottomOffsetX - bottomBounds.left(),
897 topBounds.height() + verticalSeparation - bottomBounds.top());
898 bottomPath = bottomTransform.map(bottomPath);
899 bottomPath.setFillRule(Qt::WindingFill);
901 QPainterPath combinedPath;
902 combinedPath.addPath(topPath);
903 combinedPath.addPath(bottomPath);
908 qreal
w = painter.device()->width();
909 qreal
h = painter.device()->height();
910 QRect rect(w * rx, h * ry, w * rw, h * rh);
912 QRectF combinedBounds = combinedPath.boundingRect();
913 qreal scaleX = rect.width() / combinedBounds.width();
914 qreal scaleY = rect.height() / combinedBounds.height();
915 qreal
scale = qMin(scaleX, scaleY);
916 qreal combinedOffsetX = (rect.width() - (combinedBounds.width() *
scale)) / 2.0;
917 qreal combinedOffsetY = (rect.height() - (combinedBounds.height() *
scale)) / 2.0;
919 QTransform combinedTransform;
920 combinedTransform.translate(rect.left() + combinedOffsetX, rect.top() + combinedOffsetY);
921 combinedTransform.scale(scale, scale);
922 combinedTransform.translate(-combinedBounds.left(), -combinedBounds.top());
923 combinedPath = combinedTransform.map(combinedPath);
924 combinedPath.setFillRule(Qt::WindingFill);
930 painter.setBrush(Qt::NoBrush);
931 painter.drawPath(combinedPath);
933 painter.setPen(Qt::NoPen);
934 painter.setBrush(brush);
935 painter.drawPath(combinedPath);
937 QSize welcomeBannerSize = welcomeBannerPixmap.size().scaled(500, 100, Qt::KeepAspectRatio);
938 bnAndroidSupport->setFlat(
false);
939 bnAndroidSupport->setText(QString());
940 bnAndroidSupport->setContentsMargins(0, 0, 0, 0);
941 bnAndroidSupport->setIcon(QIcon(welcomeBannerPixmap));
942 bnAndroidSupport->setIconSize(welcomeBannerSize);
943 bnAndroidSupport->setFixedSize(welcomeBannerSize);
947 connect(bnAndroidSupporterManage,
948 &QPushButton::clicked,
952 QString badgePath = QStandardPaths::locate(QStandardPaths::AppDataLocation,
"share/krita/donation/banner.png");
953 QPixmap badgePixmap(badgePath);
954 if (badgePixmap.isNull()) {
955 qWarning(
"KisWelcomePage::initDonations: failed to load badge from '%s'", qUtf8Printable(badgePath));
957 supporterBadge->setPixmap(badgePixmap);
960 connect(androidDonations, SIGNAL(sigStateChanged()),
this, SLOT(slotUpdateDonationState()));
961 slotUpdateDonationState();
964void KisWelcomePageWidget::slotUpdateDonationState()
966 bool badgeVisible =
false;
967 QWidget *pageVisible = pgSupportMessage;
970 if (androidDonations) {
972 switch (androidDonations->
state()) {
974 pageVisible = pgAndroidSupporter;
977 pageVisible =
nullptr;
983 qWarning(
"KisWelcomePageWidget::slotUpdateDonationState: android donations is null");
987 stkSupport->setCurrentWidget(pageVisible);
988 wdgAndroidSupportBanner->hide();
992 wdgAndroidSupportBanner->show();
995 supporterBadge->setVisible(badgeVisible);
1001 QFont larger = font();
1004 if (larger.pixelSize() == -1) {
1005 larger.setPointSizeF(larger.pointSizeF() * ratio);
1007 larger.setPixelSize(qRound(larger.pixelSize() * ratio));
1014 int scrollSize = qApp->style()->pixelMetric(QStyle::PM_SliderThickness);
1019 int currentSize = recentDocumentsListView->size().width()-scrollSize-2;
1020 int iconAmount = floor(currentSize/iconLength);
1021 int length = floor(currentSize / iconAmount)-spacing;
1023 recentDocumentsListView->setIconSize(QSize(
length,
length));
1028 btnDismisAll->setVisible(hasNews);
1029 notifyIcon->setVisible(hasNews);
1034 QSizePolicy sizePolicy = notifyIcon->sizePolicy();
1036 sizePolicy.setHorizontalPolicy(QSizePolicy::Preferred);
1038 sizePolicy.setHorizontalPolicy(QSizePolicy::Ignored);
1040 notifyIcon->setSizePolicy(sizePolicy);
1043 btnDismisAll->setSizePolicy(sizePolicy);
qreal length(const QPointF &vec)
A KisActionManager class keeps track of KisActions. These actions are always associated with the GUI....
KisAction * actionByName(const QString &name) const
void slotStartDonationFlow()
bool shouldShowSupporterBadge() const
static KisAndroidDonations * instance()
void sigShowDonationManagementDialogRequested()
static KisClipboard * instance()
void writeList(const QString &name, const QList< T > &value)
QList< T > readList(const QString &name, const QList< T > &defaultValue=QList< T >())
bool newsFirstStartup() const
void setNewsCheckEnabled(bool value)
void setNewsFirstStartup(bool value)
bool newsCheckEnabled() const
void SelectPage(Page page)
bool installBundle(const QString &fileName) const
Copy the given file into the bundle directory.
bool openDocument(const QString &path, OpenFlags flags)
KisViewManager * viewManager
void slotFileOpen(bool isImporting=false)
void removeRecentFile(QString url)
void dragMoveEvent(QDragMoveEvent *event) override
static constexpr const int DEFALT_ICON_SIZE_LENGTH
QStandardItemModel & model()
static KisRecentDocumentsModelWrapper * instance()
The KisRemoteFileFetcher class can fetch a remote file and blocks until the file is downloaded.
bool fetchFile(const QUrl &remote, QIODevice *io)
fetch the image. Shows a progress dialog
static void log(const QString &message)
Logs with date/time.
KisActionManager * actionManager() const
void recentDocumentClicked(QModelIndex index)
KisWelcomePageWidget(QWidget *parent)
void recentFilesResized()
void dragEnterEvent(QDragEnterEvent *event) override
void slotSetNewsEnabled(bool newsEnabled)
void setupNewsLangSelection(QMenu *newsOptionMenu)
QAction * m_enableNewsAction
bool isDevelopmentBuild()
void slotNewFileClicked()
bool eventFilter(QObject *watched, QEvent *event) override
static void updateShortcutLink(QToolButton *button, QLabel *label, QAction *action)
void dropEvent(QDropEvent *event) override
void slotUpdateThemeColors()
void slotScrollerStateChanged(QScroller::State state)
void newsStateChanged(bool hasNews)
void slotOpenFileClicked()
void dragLeaveEvent(QDragLeaveEvent *event) override
void changeEvent(QEvent *event) override
KisMainWindow * m_mainWindow
void showDevVersionHighlight()
void slotRecentFilesModelIsUpToDate()
const QString analyticsString
void setMainWindow(KisMainWindow *m_mainWindow)
void slotRecentDocContextMenuRequest(const QPoint &pos)
void showDropAreaIndicator(bool show)
~KisWelcomePageWidget() override
void dragMoveEvent(QDragMoveEvent *event) override
RecentItemDelegate(QObject *parent=0)
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &) const override
void setItemHeight(int itemHeight)
QString button(const QWheelEvent &ev)
QIcon loadIcon(const QString &name)
void updateIcon(QAbstractButton *button)
QColor blendColors(const QColor &c1, const QColor &c2, qreal r1)
bool isRunningInPackage()
KRITAVERSION_EXPORT bool isDevelopersBuild()