summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleix Pol <[email protected]>2016-11-15 18:45:20 +0100
committerAleix Pol <[email protected]>2016-11-15 18:45:20 +0100
commitf6bef735485b56fe5eacccf20af264733d9e684d (patch)
tree8eab79e86e415076ae81b3e64e21cf38b1527000
parentff3388a6899a901c8ec315e2f58026a534844ff0 (diff)
Show a Kirigami passiveNotification when a pk transaction fails
-rw-r--r--discover/qml/DiscoverWindow.qml5
-rw-r--r--libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp1
-rw-r--r--libdiscover/resources/AbstractResourcesBackend.h2
-rw-r--r--libdiscover/resources/ResourcesModel.h1
4 files changed, 9 insertions, 0 deletions
diff --git a/discover/qml/DiscoverWindow.qml b/discover/qml/DiscoverWindow.qml
index 3a8d994..5318874 100644
--- a/discover/qml/DiscoverWindow.qml
+++ b/discover/qml/DiscoverWindow.qml
@@ -120,6 +120,11 @@ Kirigami.ApplicationWindow
}
}
+ Connections {
+ target: ResourcesModel
+ onPassiveMessage: showPassiveNotification(message, 3000)
+ }
+
Component {
id: proceedDialog
Kirigami.OverlaySheet {
diff --git a/libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp b/libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp
index 9bf63af..a4e1785 100644
--- a/libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp
+++ b/libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp
@@ -306,6 +306,7 @@ void PackageKitBackend::includePackagesToAdd()
void PackageKitBackend::transactionError(PackageKit::Transaction::Error, const QString& message)
{
qWarning() << "Transaction error: " << message << sender();
+ Q_EMIT passiveMessage(message);
}
void PackageKitBackend::packageDetails(const PackageKit::Details& details)
diff --git a/libdiscover/resources/AbstractResourcesBackend.h b/libdiscover/resources/AbstractResourcesBackend.h
index d2e7a98..393781c 100644
--- a/libdiscover/resources/AbstractResourcesBackend.h
+++ b/libdiscover/resources/AbstractResourcesBackend.h
@@ -222,6 +222,8 @@ class DISCOVERCOMMON_EXPORT AbstractResourcesBackend : public QObject
void resourcesChanged(AbstractResource* resource, const QVector<QByteArray> &properties);
void resourceRemoved(AbstractResource* resource);
+ void passiveMessage(const QString &message);
+
private:
QString m_name;
};
diff --git a/libdiscover/resources/ResourcesModel.h b/libdiscover/resources/ResourcesModel.h
index 1bf9257..755c9e4 100644
--- a/libdiscover/resources/ResourcesModel.h
+++ b/libdiscover/resources/ResourcesModel.h
@@ -109,6 +109,7 @@ class DISCOVERCOMMON_EXPORT ResourcesModel : public QObject
void backendDataChanged(AbstractResourcesBackend* backend, const QVector<QByteArray>& properties);
void resourceDataChanged(AbstractResource* resource, const QVector<QByteArray>& properties);
void resourceRemoved(AbstractResource* resource);
+ void passiveMessage(const QString &message);
private Q_SLOTS:
void callerFetchingChanged();