From 4e5d70d8b5d1d4595ad0975c77b06ef2cb6fa0e1 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 5 Oct 2016 15:52:39 +0200 Subject: [PATCH 1/4] make sure allTimezones is set Summary: on Qt 5.6/5.7 changed signal was emitted at startup as well, triggering plasmoid.configuration.onSelectedTimeZonesChanged in Qt 5.8 this doesn't happen, giving an empty clock at startup this makes sure allTimezones gets built Test Plan: with Qt 5.8 the clock is shown correctly Reviewers: #plasma, broulik Reviewed By: #plasma, broulik Subscribers: broulik, plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D2946 --- .../digital-clock/package/contents/ui/main.qml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/applets/digital-clock/package/contents/ui/main.qml b/applets/digital-clock/package/contents/ui/main.qml index f117ea45c..66e8420fa 100644 --- a/applets/digital-clock/package/contents/ui/main.qml +++ b/applets/digital-clock/package/contents/ui/main.qml @@ -41,6 +41,14 @@ Item { return new Date(msUTC + (dataSource.data[plasmoid.configuration.lastSelectedTimezone]["Offset"] * 1000)); } + function initTimezones() { + var tz = Array() + if (plasmoid.configuration.selectedTimeZones.indexOf("Local") === -1) { + tz.push("Local"); + } + root.allTimezones = tz.concat(plasmoid.configuration.selectedTimeZones); + } + Plasmoid.preferredRepresentation: Plasmoid.compactRepresentation Plasmoid.compactRepresentation: DigitalClock { } Plasmoid.fullRepresentation: CalendarView { } @@ -61,14 +69,7 @@ Item { property var allTimezones Connections { target: plasmoid.configuration - onSelectedTimeZonesChanged: { - var tz = Array() - if (plasmoid.configuration.selectedTimeZones.indexOf("Local") === -1) { - tz.push("Local"); - } - root.allTimezones = tz.concat(plasmoid.configuration.selectedTimeZones); - - } + onSelectedTimeZonesChanged: root.initTimezones(); } PlasmaCore.DataSource { @@ -98,6 +99,7 @@ Item { } Component.onCompleted: { + root.initTimezones(); if (KCMShell.authorize("clock.desktop").length > 0) { plasmoid.setAction("clockkcm", i18n("Adjust Date and Time..."), "preferences-system-time"); } From fcc806c09859faee0942186dafa2904b3365cf0b Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Thu, 6 Oct 2016 10:59:50 +0200 Subject: [PATCH 2/4] [Notification Data Engine] Don't group notification if it should replace an existing one If an application explicitly requests a notification to replace another one (replaces_id set), don't group it with another notification. When creating a KNotification object and then updating it by calling e.g. setText it would just append it to the already shown notification. Differential Revision: https://phabricator.kde.org/D2954 --- dataengines/notifications/notificationsengine.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dataengines/notifications/notificationsengine.cpp b/dataengines/notifications/notificationsengine.cpp index 6c7e286fa..2bc4dc25e 100644 --- a/dataengines/notifications/notificationsengine.cpp +++ b/dataengines/notifications/notificationsengine.cpp @@ -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; From 77aaa88eb2a148f0955eb35b3043d3f0f81fae5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Wed, 5 Oct 2016 09:07:08 +0200 Subject: [PATCH 3/4] [klipper] Move notification from tray to Klipper Summary: Klipper shows a notification when the shortcuts next/prev history item gets triggered. This notification used to be implemented in the class KlipperTray. With the switch from SNI based clipper to a Plasmoid the notification got lost as the Plasmoid doesn't use the KlipperTray class at all. This change moves the notification handling from KlipperTray to Klipper so that it gets emitted for both SNI and Plasmoid based klipper. BUG: 368808 FIXED-IN: 5.8.1 Test Plan: Set the shortcuts, triggered them and verified the notification gets shown. Reviewers: #plasma Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D2942 --- klipper/CMakeLists.txt | 1 + klipper/klipper.cpp | 12 ++++++++++++ klipper/klipper.h | 3 +++ klipper/tray.cpp | 13 ------------- klipper/tray.h | 5 ----- 5 files changed, 16 insertions(+), 18 deletions(-) diff --git a/klipper/CMakeLists.txt b/klipper/CMakeLists.txt index d152d0f80..d9538fd25 100644 --- a/klipper/CMakeLists.txt +++ b/klipper/CMakeLists.txt @@ -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 diff --git a/klipper/klipper.cpp b/klipper/klipper.cpp index 79060d81f..8de19fb0f 100644 --- a/klipper/klipper.cpp +++ b/klipper/klipper.cpp @@ -36,6 +36,7 @@ #include #include +#include #include #include #include @@ -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() diff --git a/klipper/klipper.h b/klipper/klipper.h index f6e5da6b5..99c71f339 100644 --- a/klipper/klipper.h +++ b/klipper/klipper.h @@ -26,6 +26,7 @@ #include #include #include +#include #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 m_notification; }; #endif diff --git a/klipper/tray.cpp b/klipper/tray.cpp index 48a96616d..75fbe7fc0 100644 --- a/klipper/tray.cpp +++ b/klipper/tray.cpp @@ -23,7 +23,6 @@ #include "tray.h" #include -#include #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))); - } -} - diff --git a/klipper/tray.h b/klipper/tray.h index 388674c87..d4b071625 100644 --- a/klipper/tray.h +++ b/klipper/tray.h @@ -20,11 +20,8 @@ #ifndef TRAY_H #define TRAY_H -#include - #include -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 m_notification; }; #endif From 0b144147d5c36dcdf16560d5dd702f7f8ea6ffd0 Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Thu, 6 Oct 2016 12:25:00 +0000 Subject: [PATCH 4/4] SVN_SILENT made messages (.desktop file) - always resolve ours In case of conflict in i18n, keep the version of the branch "ours" To resolve a particular conflict, "git checkout --ours path/to/file.desktop" --- templates/ion-dataengine/ion-dataengine.kdevtemplate | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/ion-dataengine/ion-dataengine.kdevtemplate b/templates/ion-dataengine/ion-dataengine.kdevtemplate index 35b521cde..483ccd438 100644 --- a/templates/ion-dataengine/ion-dataengine.kdevtemplate +++ b/templates/ion-dataengine/ion-dataengine.kdevtemplate @@ -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