43 lines
1.6 KiB
Diff
43 lines
1.6 KiB
Diff
|
From: Stephan Kulow <coolo@suse.de>
|
||
|
Subject: Avoid popup message boxes for locked or masked PK
|
||
|
|
||
|
Index: apper-0.9.1/libapper/PkTransaction.cpp
|
||
|
===================================================================
|
||
|
--- apper-0.9.1.orig/libapper/PkTransaction.cpp
|
||
|
+++ apper-0.9.1/libapper/PkTransaction.cpp
|
||
|
@@ -28,6 +28,7 @@
|
||
|
#include <KService>
|
||
|
#include <KPixmapSequence>
|
||
|
#include <KPixmapSequenceOverlayPainter>
|
||
|
+#include <KNotification>
|
||
|
|
||
|
#include <KDebug>
|
||
|
|
||
|
@@ -765,11 +766,26 @@ void PkTransaction::showSorry(const QStr
|
||
|
{
|
||
|
PkTransactionWidget *widget = qobject_cast<PkTransactionWidget *>(d->parentWindow);
|
||
|
if (!widget || widget->isCancelVisible()) {
|
||
|
+ // for background jobs like getupdates (triggered by a timer) we don't want a popup
|
||
|
+ if (role() == Transaction::RoleGetUpdates) {
|
||
|
+ KNotification *notify;
|
||
|
+ notify = new KNotification("TransactionMessage", 0, KNotification::Persistent);
|
||
|
+ notify->setComponentData(KComponentData("apperd"));
|
||
|
+ notify->setTitle(title);
|
||
|
+ if (details.isEmpty())
|
||
|
+ notify->setText(description);
|
||
|
+ else
|
||
|
+ notify->setText(details);
|
||
|
+
|
||
|
+ notify->setPixmap(KIcon("dialog-warning").pixmap(KPK_ICON_SIZE, KPK_ICON_SIZE));
|
||
|
+ notify->sendEvent();
|
||
|
+ } else {
|
||
|
if (details.isEmpty()) {
|
||
|
KMessageBox::sorry(d->parentWindow, description, title);
|
||
|
} else {
|
||
|
KMessageBox::detailedSorry(d->parentWindow, description, details, title);
|
||
|
}
|
||
|
+ }
|
||
|
} else {
|
||
|
emit sorry(title, description, details);
|
||
|
}
|