2018-03-23 21:42:18 +01:00
|
|
|
From 74a4eff529e6b71f6a822841d9112d9b71b44d24 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Fabian Vogt <fabian@ritter-vogt.de>
|
|
|
|
Date: Sat, 13 Jan 2018 15:16:39 +0100
|
|
|
|
Subject: [PATCH] Warning for FlatHub
|
|
|
|
|
|
|
|
---
|
|
|
|
.../backends/FlatpakBackend/FlatpakSourcesBackend.cpp | 14 +++++++++++++-
|
|
|
|
1 file changed, 13 insertions(+), 1 deletion(-)
|
|
|
|
|
2023-02-12 10:28:49 +01:00
|
|
|
Index: discover-5.17.80git.20230205T022020~5f7a4d0/libdiscover/backends/FlatpakBackend/FlatpakSourcesBackend.cpp
|
2018-05-21 11:07:06 +02:00
|
|
|
===================================================================
|
2023-02-12 10:28:49 +01:00
|
|
|
--- discover-5.17.80git.20230205T022020~5f7a4d0.orig/libdiscover/backends/FlatpakBackend/FlatpakSourcesBackend.cpp 2023-02-05 03:20:20.000000000 +0100
|
|
|
|
+++ discover-5.17.80git.20230205T022020~5f7a4d0/libdiscover/backends/FlatpakBackend/FlatpakSourcesBackend.cpp 2023-02-05 09:36:13.879836533 +0100
|
2021-05-15 18:16:59 +02:00
|
|
|
@@ -12,6 +12,8 @@
|
|
|
|
#include <KLocalizedString>
|
2018-05-21 11:07:06 +02:00
|
|
|
#include <KSharedConfig>
|
2018-03-23 21:42:18 +01:00
|
|
|
#include <QDebug>
|
|
|
|
+#include <QAbstractButton>
|
|
|
|
+#include <QMessageBox>
|
|
|
|
#include <QNetworkAccessManager>
|
|
|
|
#include <QNetworkReply>
|
2023-02-12 10:28:49 +01:00
|
|
|
|
|
|
|
@@ -96,7 +98,17 @@
|
2021-01-24 22:11:01 +01:00
|
|
|
m_flathubAction->setObjectName(QStringLiteral("flathub"));
|
|
|
|
m_flathubAction->setToolTip(i18n("Makes it possible to easily install the applications listed in https://flathub.org"));
|
2021-05-15 18:16:59 +02:00
|
|
|
connect(m_flathubAction, &DiscoverAction::triggered, this, [this]() {
|
2023-02-12 10:28:49 +01:00
|
|
|
- addSource(QStringLiteral("https://dl.flathub.org/repo/flathub.flatpakrepo"));
|
2018-03-23 21:42:18 +01:00
|
|
|
+ auto *warnBox = new QMessageBox(QMessageBox::Information, i18n("Adding a third-party source"),
|
|
|
|
+ i18n("FlatHub is not part of the openSUSE distribution.\n"
|
|
|
|
+ "It contains packages of unknown quality which might not be tested to work correctly "
|
2022-05-03 17:57:16 +02:00
|
|
|
+ "on openSUSE."),
|
2018-03-23 21:42:18 +01:00
|
|
|
+ QMessageBox::Ok | QMessageBox::Abort);
|
|
|
|
+ connect(warnBox, &QMessageBox::buttonClicked, this, [this, warnBox](QAbstractButton *button) {
|
|
|
|
+ if (warnBox->standardButton(button) == QMessageBox::Ok)
|
2023-02-12 10:28:49 +01:00
|
|
|
+ addSource(QStringLiteral("https://dl.flathub.org/repo/flathub.flatpakrepo"));
|
2022-05-03 17:57:16 +02:00
|
|
|
+ });
|
2018-03-23 21:42:18 +01:00
|
|
|
+ warnBox->setAttribute(Qt::WA_DeleteOnClose);
|
|
|
|
+ warnBox->show();
|
2022-05-03 17:57:16 +02:00
|
|
|
});
|
2023-02-12 10:28:49 +01:00
|
|
|
|
2022-05-03 17:57:16 +02:00
|
|
|
m_noSourcesItem->setEnabled(false);
|