Merge branch 'Plasma/5.8'

wilder-5.14
Marco Martin 10 years ago
commit 612cb8b26c
  1. 3
      dataengines/notifications/notificationsengine.cpp
  2. 1
      klipper/CMakeLists.txt
  3. 12
      klipper/klipper.cpp
  4. 3
      klipper/klipper.h
  5. 13
      klipper/tray.cpp
  6. 5
      klipper/tray.h
  7. 2
      templates/ion-dataengine/ion-dataengine.kdevtemplate

@ -193,10 +193,9 @@ uint NotificationsEngine::Notify(const QString &app_name, uint replaces_id,
// group notifications that have the same title coming from the same app
// or if they are on the "blacklist", honor the skipGrouping hint sent
if (m_activeNotifications.values().contains(app_name + summary) && !skipGrouping && !m_alwaysReplaceAppsList.contains(app_name)) {
if (!replaces_id && m_activeNotifications.values().contains(app_name + summary) && !skipGrouping && !m_alwaysReplaceAppsList.contains(app_name)) {
// cut off the "notification " from the source name
partOf = m_activeNotifications.key(app_name + summary).midRef(13).toUInt();
}
qDebug() << "Currrent active notifications:" << m_activeNotifications;

@ -82,6 +82,7 @@ target_link_libraries(plasma_engine_clipboard
KF5::IconThemes
KF5::KIOWidgets # PreviewJob
KF5::Plasma
KF5::Notifications
KF5::Service
KF5::TextWidgets # KTextEdit
KF5::WidgetsAddons # KMessageBox

@ -36,6 +36,7 @@
#include <KGlobalAccel>
#include <KMessageBox>
#include <KNotification>
#include <KActionCollection>
#include <KToggleAction>
#include <KTextEdit>
@ -227,6 +228,17 @@ Klipper::Klipper(QObject* parent, const KSharedConfigPtr& config, KlipperMode mo
if (m_mode == KlipperMode::Standalone) {
connect(qApp, &QGuiApplication::commitDataRequest, this, &Klipper::saveSession);
}
connect(this, &Klipper::passivePopup, this,
[this] (const QString &caption, const QString &text) {
if (m_notification) {
m_notification->setTitle(caption);
m_notification->setText(text);
} else {
m_notification = KNotification::event(KNotification::Notification, caption, text, QStringLiteral("klipper"));
}
}
);
}
Klipper::~Klipper()

@ -26,6 +26,7 @@
#include <QTime>
#include <QTimer>
#include <QClipboard>
#include <QPointer>
#include "urlgrabber.h"
@ -39,6 +40,7 @@ class QAction;
class QMenu;
class QMimeData;
class HistoryItem;
class KNotification;
enum class KlipperMode {
Standalone,
@ -207,6 +209,7 @@ private:
KActionCollection* m_collection;
KlipperMode m_mode;
QTimer *m_saveFileTimer = nullptr;
QPointer<KNotification> m_notification;
};
#endif

@ -23,7 +23,6 @@
#include "tray.h"
#include <KLocalizedString>
#include <KNotification>
#include "klipper.h"
#include "history.h"
@ -46,7 +45,6 @@ KlipperTray::KlipperTray()
setAssociatedWidget( m_klipper->popup() );
connect( m_klipper->history(), &History::changed, this, &KlipperTray::slotSetToolTipFromHistory);
slotSetToolTipFromHistory();
connect(m_klipper, &Klipper::passivePopup, this, &KlipperTray::slotPassivePopup);
}
void KlipperTray::slotSetToolTipFromHistory()
@ -64,15 +62,4 @@ void KlipperTray::slotSetToolTipFromHistory()
}
}
void KlipperTray::slotPassivePopup(const QString& caption, const QString& text)
{
if (m_notification) {
m_notification->setTitle(caption);
m_notification->setText(text);
} else {
m_notification = KNotification::event(KNotification::Notification, caption, text,
QIcon::fromTheme(QStringLiteral("klipper")).pixmap(QSize(16, 16)));
}
}

@ -20,11 +20,8 @@
#ifndef TRAY_H
#define TRAY_H
#include <QPointer>
#include <KStatusNotifierItem>
class KNotification;
class Klipper;
class KlipperTray : public KStatusNotifierItem
@ -36,11 +33,9 @@ public:
public Q_SLOTS:
void slotSetToolTipFromHistory();
void slotPassivePopup(const QString& caption, const QString& text);
private:
Klipper* m_klipper;
QPointer<KNotification> m_notification;
};
#endif

@ -13,6 +13,7 @@ Name[sv]=Plasma-datagränssnitt för väderjon
Name[uk]=Рушій даних прогнозу погоди Плазми Ion
Name[x-test]=xxPlasma Weather Ion Dataenginexx
Name[zh_CN]=Plasma 天气离子数据引擎
Name[zh_TW]=Plasma 天氣 Ion 資料引擎
Comment=A special Plasma sub-dataengine for the Plasma Weather dataengine, providing access to one weather data service provider
Comment[ca]=Un submotor de dades especial del Plasma pel motor de dades meteorològiques del Plasma Weather, que proporciona accés a un proveïdor del servei de dades meteorològiques
Comment[ca@valencia]=Un submotor de dades especial del Plasma pel motor de dades meteorològiques del Plasma Weather, que proporciona accés a un proveïdor del servei de dades meteorològiques
@ -26,5 +27,6 @@ Comment[sv]=Ett särskilt undergränssnitt för Plasmas datagränssnitt för vä
Comment[uk]=Спеціалізований допоміжний рушій даних Плазми для рушія даних прогнозу погоди, який надає доступ до даних одного з надавачів даних прогнозу погоди
Comment[x-test]=xxA special Plasma sub-dataengine for the Plasma Weather dataengine, providing access to one weather data service providerxx
Comment[zh_CN]=一个特殊的 Plasma 子数据引擎,用于辅助 Plasma 天气数据引擎,提供了对一个天气数据服务提供商的访问功能
Comment[zh_TW]=一個專為 Plasma 天氣資料引擎所設計的 Plasma 子資料引擎,提供存取一個天氣資料服務提供者的能力
ShowFilesAfterGeneration=%{PROJECTDIR}/src/ion-%{APPNAMELC}.cpp
Category=Plasma/Dataengine

Loading…
Cancel
Save