generic: adjust to KNotification changes

some notification files, such as the style KCM one, were not even used

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-08-25 01:19:39 +03:00
parent 5530bc18f3
commit f47177f876
79 changed files with 202 additions and 4608 deletions

View file

@ -455,7 +455,7 @@ void PlacesPanel::emptyTrash()
QDataStream stream(&packedArgs, QIODevice::WriteOnly);
stream << int(1);
KIO::Job *job = KIO::special(KUrl("trash:/"), packedArgs);
KNotification::event("Trash: emptied", QString() , QPixmap() , 0, KNotification::DefaultEvent);
KNotification::event("kde/TrashEmptied");
job->ui()->setWindow(parentWidget());
connect(job, SIGNAL(result(KJob*)), SLOT(slotTrashUpdated(KJob*)));
}

View file

@ -27,7 +27,6 @@ add_subdirectory( workspaceoptions )
add_subdirectory( icons )
add_subdirectory( locale )
add_subdirectory( kded )
add_subdirectory( knotify )
add_subdirectory( componentchooser )
add_subdirectory( mediaplayer )
add_subdirectory( menus )

View file

@ -4,7 +4,7 @@ kde4_add_plugin(kcm_access kcmaccess.cpp)
target_link_libraries(kcm_access
KDE4::kio
KDE4::knotifyconfig
KDE4::kdeui
${X11_LIBRARIES}
)
@ -43,5 +43,5 @@ install(
)
install(
FILES kaccess.notifyrc
DESTINATION ${KDE4_DATA_INSTALL_DIR}/kaccess
DESTINATION ${KDE4_CONFIG_INSTALL_DIR}/notifications
)

View file

@ -394,23 +394,23 @@ void KAccessApp::xkbStateNotify () {
&& ( (((mods >> i) & 0x101) != 0) != (((state >> i) & 0x101) != 0) ))
{
if ((mods >> i) & 1) {
KNotification::event ("lockkey-locked", i18n(modifierKeys[keys[i]].lockedText));
KNotification::event("kaccess/lockkey-locked", QString(), i18n(modifierKeys[keys[i]].lockedText));
}
else {
KNotification::event ("lockkey-unlocked", i18n(modifierKeys[keys[i]].unlatchedText));
KNotification::event("kaccess/lockkey-unlocked", QString(), i18n(modifierKeys[keys[i]].unlatchedText));
}
}
else if (strcmp(modifierKeys[keys[i]].latchedText, "")
&& ( ((mods >> i) & 0x101) != ((state >> i) & 0x101) ))
{
if ((mods >> i) & 0x100) {
KNotification::event ("modifierkey-locked", i18n(modifierKeys[keys[i]].lockedText));
KNotification::event ("kaccess/modifierkey-locked", QString(), i18n(modifierKeys[keys[i]].lockedText));
}
else if ((mods >> i) & 1) {
KNotification::event ( "modifierkey-latched", i18n(modifierKeys[keys[i]].latchedText));
KNotification::event("kaccess/modifierkey-latched", QString(), i18n(modifierKeys[keys[i]].latchedText));
}
else {
KNotification::event ("modifierkey-unlatched", i18n(modifierKeys[keys[i]].unlatchedText));
KNotification::event("kaccess/modifierkey-unlatched", QString(), i18n(modifierKeys[keys[i]].unlatchedText));
}
}
}
@ -789,24 +789,24 @@ void KAccessApp::notifyChanges() {
unsigned int disabled = features & ~requestedFeatures;
if (enabled & XkbSlowKeysMask)
KNotification::event ("slowkeys", i18n("Slow keys has been enabled. From now on, you need to press each key for a certain length of time before it gets accepted."));
KNotification::event("kaccess/slowkeys", QString(), i18n("Slow keys has been enabled. From now on, you need to press each key for a certain length of time before it gets accepted."));
else if (disabled & XkbSlowKeysMask)
KNotification::event ("slowkeys", i18n("Slow keys has been disabled."));
KNotification::event("kaccess/slowkeys", QString(), i18n("Slow keys has been disabled."));
if (enabled & XkbBounceKeysMask)
KNotification::event ("bouncekeys", i18n("Bounce keys has been enabled. From now on, each key will be blocked for a certain length of time after it was used."));
KNotification::event("kaccess/bouncekeys", QString(), i18n("Bounce keys has been enabled. From now on, each key will be blocked for a certain length of time after it was used."));
else if (disabled & XkbBounceKeysMask)
KNotification::event ("bouncekeys", i18n("Bounce keys has been disabled."));
KNotification::event("kaccess/bouncekeys", QString(), i18n("Bounce keys has been disabled."));
if (enabled & XkbStickyKeysMask)
KNotification::event ("stickykeys", i18n("Sticky keys has been enabled. From now on, modifier keys will stay latched after you have released them."));
KNotification::event("kaccess/stickykeys", QString(), i18n("Sticky keys has been enabled. From now on, modifier keys will stay latched after you have released them."));
else if (disabled & XkbStickyKeysMask)
KNotification::event ("stickykeys", i18n("Sticky keys has been disabled."));
KNotification::event("kaccess/stickykeys", QString(), i18n("Sticky keys has been disabled."));
if (enabled & XkbMouseKeysMask)
KNotification::event ("mousekeys", i18n("Mouse keys has been enabled. From now on, you can use the number pad of your keyboard in order to control the mouse."));
KNotification::event("kaccess/mousekeys", QString(), i18n("Mouse keys has been enabled. From now on, you can use the number pad of your keyboard in order to control the mouse."));
else if (disabled & XkbMouseKeysMask)
KNotification::event ("mousekeys", i18n("Mouse keys has been disabled."));
KNotification::event("kaccess/mousekeys", QString(), i18n("Mouse keys has been disabled."));
}
void KAccessApp::applyChanges() {

View file

@ -1,4 +1,4 @@
[Global]
[kaccess]
IconName=preferences-desktop-accessibility
Comment=Accessibility
Comment[af]=Toeganklikheid
@ -92,7 +92,7 @@ Comment[x-test]=xxAccessibilityxx
Comment[zh_CN]=辅助
Comment[zh_TW]=無障礙輔助
[Event/modifierkey-latched]
[kaccess/modifierkey-latched]
Name=A modifier key has become active
Name[af]='n Verandering sleutel was geaktiveer
Name[ar]=تم تفعيل مفتاح مغيِّر
@ -249,9 +249,7 @@ Comment[zh_CN]=修饰键(如 Shift 或 Ctrl)更改了其状态,现已激活
Comment[zh_TW]=一個組合鍵(如 Shift 或 Ctrl 等)已改變了它的狀態成為啟動
Sound=KDE-Sys-Special.ogg
nopresentation=236
[Event/modifierkey-unlatched]
[kaccess/modifierkey-unlatched]
Name=A modifier key has become inactive
Name[af]='n Verandering sleutel was gedeaktiveer
Name[ar]=تم إلغاء مفتاح مغيِّر
@ -408,9 +406,7 @@ Comment[zh_CN]=修饰键(如 Shift 或 Ctrl)更改了其状态,现已停用
Comment[zh_TW]=一個組合鍵(如 Shift 或 Ctrl 等)已改變了它的狀態成為放開
Sound=KDE-Sys-Special.ogg
nopresentation=236
[Event/modifierkey-locked]
[kaccess/modifierkey-locked]
Name=A modifier key has been locked
Name[af]='n Verandering sleutel was gesluit
Name[ar]=تم قفل مفتاح مغيِّر
@ -567,9 +563,7 @@ Comment[zh_CN]=修饰键(如 Shift 或 Ctrl)已被锁定,现在将适用于后
Comment[zh_TW]=一個組合鍵(如 Shift 或 Ctrl 等)已被鎖定,現在再按任何鍵都視為快捷鍵組合
Sound=KDE-Sys-Special.ogg
nopresentation=236
[Event/lockkey-locked]
[kaccess/lockkey-locked]
Name=A lock key has been activated
Name[af]='n Sluitsleutel is geaktiveer
Name[ar]=تم تفعيل مفتاح قفل
@ -727,9 +721,7 @@ Comment[zh_CN]=锁定键(如 Caps Lock 或 Num Lock)更改了其状态,现已
Comment[zh_TW]=一個鎖定鍵(如 CapsLock 或 NumLock已改變它的狀態為啟用
Sound=KDE-Sys-Special.ogg
nopresentation=236
[Event/lockkey-unlocked]
[kaccess/lockkey-unlocked]
Name=A lock key has been deactivated
Name[af]='n Sluit sleutel was gedeaktiveer
Name[ar]=تم إلغاء تفعيل مفتاح قفل
@ -887,9 +879,7 @@ Comment[zh_CN]=锁定键(如 Caps Lock 或 Num Lock)更改了其状态,现已
Comment[zh_TW]=一個鎖定鍵(如 CapsLock 或 NumLock已改變它的狀態成為未啟用
Sound=KDE-Sys-Special.ogg
nopresentation=236
[Event/stickykeys]
[kaccess/stickykeys]
Name=Sticky keys has been enabled or disabled
Name[af]=Sticky sleutels was geaktiveer of gedeaktiveer
Name[ar]=تم تفعيل أو إلغاء تفعيل المفاتيح المثبتة
@ -1047,10 +1037,9 @@ Comment[x-test]=xxSticky keys has been enabled or disabledxx
Comment[zh_CN]=启用或禁用了粘滞键
Comment[zh_TW]=相黏鍵已啟動或關閉。
Sound=KDE-Sys-Special.ogg
Action=Popup
nopresentation=236
Actions=Popup
[Event/slowkeys]
[kaccess/slowkeys]
Name=Slow keys has been enabled or disabled
Name[af]=Stadige sleutels was geaktiveer of gedeaktiveer
Name[ar]=تم تفعيل أو إلغاء تفعيل المفاتيح البطيئة
@ -1206,10 +1195,9 @@ Comment[x-test]=xxSlow keys has been enabled or disabledxx
Comment[zh_CN]=启用或禁用了筛选键
Comment[zh_TW]=慢速鍵已啟動或關閉。
Sound=KDE-Sys-Special.ogg
Action=Popup
nopresentation=236
Actions=Popup
[Event/bouncekeys]
[kaccess/bouncekeys]
Name=Bounce keys has been enabled or disabled
Name[af]=Hopsleutels is geaktiveer of gedeaktiveer
Name[ar]=تم تفعيل أو إلغاء تفعيل المفاتيح المكررة
@ -1367,10 +1355,9 @@ Comment[x-test]=xxBounce keys has been enabled or disabledxx
Comment[zh_CN]=启用或禁用了撞击键
Comment[zh_TW]=彈回鍵已啟動或關閉。
Sound=KDE-Sys-Special.ogg
Action=PassivePopup
nopresentation=236
Actions=PassivePopup
[Event/mousekeys]
[kaccess/mousekeys]
Name=Mouse keys has been enabled or disabled
Name[af]=Muis sleutels was geaktiveer of gedeaktiveer
Name[ar]=تم تفعيل أو إلغاء تفعيل فأرة لوحة المفاتيح
@ -1528,5 +1515,4 @@ Comment[x-test]=xxMouse keys has been enabled or disabledxx
Comment[zh_CN]=启用或禁用了鼠标键
Comment[zh_TW]=滑鼠鍵已啟動或關閉。
Sound=KDE-Sys-Special.ogg
Action=PassivePopup
nopresentation=236
Actions=PassivePopup

View file

@ -32,7 +32,7 @@
#include <kapplication.h>
#include <kaboutdata.h>
#include <kshortcut.h>
#include <knotifyconfigwidget.h>
#include <knotificationconfigwidget.h>
#include <kkeyserver.h>
#include <X11/Xlib.h>
@ -538,7 +538,7 @@ KAccessConfig::~KAccessConfig()
void KAccessConfig::configureKNotify()
{
KNotifyConfigWidget::configure (this, "kaccess");
KNotificationConfigWidget::configure("kaccess", this);
}
void KAccessConfig::changeFlashScreenColor()

View file

@ -1,26 +0,0 @@
########### next target ###############
set(kcm_knotify_PART_SRCS knotify.cpp playersettings.ui)
kde4_add_plugin(kcm_knotify ${kcm_knotify_PART_SRCS})
target_link_libraries(kcm_knotify
KDE4::kio
KDE4::knotifyconfig
${QT_QTGUI_LIBRARY}
)
########### install files ###############
install(
TARGETS kcm_knotify
DESTINATION ${KDE4_PLUGIN_INSTALL_DIR}
)
install(
FILES kcmnotify.desktop
DESTINATION ${KDE4_SERVICES_INSTALL_DIR}
)

View file

@ -1,3 +0,0 @@
#!/bin/bash
$EXTRACTRC *.ui >> rc.cpp
$XGETTEXT *.cpp -o $podir/kcmnotify.pot

View file

@ -1,2 +0,0 @@
This is a KDE Control Center Module for configuring system notifications

View file

@ -1,237 +0,0 @@
[Desktop Entry]
Exec=kcmshell4 kcmnotify
Icon=preferences-desktop-notification
Type=Service
X-KDE-ServiceTypes=KCModule
X-DocPath=kcontrol/kcmnotify/index.html
X-KDE-Library=kcm_knotify
X-KDE-ParentApp=kcontrol
X-KDE-System-Settings-Parent-Category=application-and-system-notifications
X-KDE-Weight=50
Name=Manage Notifications
Name[ar]=أدر التنبيهات
Name[ast]=Xestionar notificaciones
Name[bg]=Управление на уведомяването
Name[bn]=িি
Name[bs]=Upravljanje obavještenjima
Name[ca]=Gestiona les notificacions
Name[ca@valencia]=Gestiona les notificacions
Name[cs]=Oznamování hardwaru
Name[da]=Håndtér bekendtgørelser
Name[de]=Benachrichtigungen verwalten
Name[el]=Διαχείριση ειδοποιήσεων
Name[en_GB]=Manage Notifications
Name[eo]=Mastrumi atentigojn
Name[es]=Gestionar notificaciones
Name[et]=Märguannete haldamine
Name[eu]=Jakinarazpenak kudeatzea
Name[fa]=مدیریت اخطارها
Name[fi]=Ilmoitusten asetukset
Name[fr]=Gérer les notifications
Name[ga]=Bainistigh Fógairt
Name[gl]=Xestión das notificacións
Name[gu]=
Name[he]=ניהול הודעות
Name[hi]= ि
Name[hr]=Upravljanje obavijestima
Name[hu]=Értesítések kezelése
Name[ia]=Administra notificationes
Name[id]=Atur Notifikasi
Name[is]=Sýsla með kerfistilkynningar
Name[it]=Gestisci le notifiche
Name[ja]=
Name[kk]=Құлақтандыруларды басқару
Name[km]=
Name[kn]= ಿಿ
Name[ko]=
Name[lt]=Tvarkyti pranešimus
Name[lv]=Pārvaldīt paziņojumus
Name[mai]= ि
Name[ml]=ിി
Name[mr]= ि
Name[nb]=Håndter varslinger
Name[nds]=Bescheden plegen
Name[nl]=Meldingen beheren
Name[nn]=Handsam varslingar
Name[pa]=ਿ
Name[pl]=Zarządzanie powiadomieniami
Name[pt]=Gerir as Notificações
Name[pt_BR]=Gerenciar notificações
Name[ro]=Gestiune notificări
Name[ru]=Системные уведомления
Name[si]=
Name[sk]=Správa upozornení
Name[sl]=Upravljanje obvestil
Name[sr]=Управљање обавештењима
Name[sr@ijekavian]=Управљање обавјештењима
Name[sr@ijekavianlatin]=Upravljanje obavještenjima
Name[sr@latin]=Upravljanje obaveštenjima
Name[sv]=Hantera underrättelser
Name[tg]=Идоракунии огоҳиномаҳо
Name[th]=
Name[tr]=Bildirimleri Yönet
Name[ug]=باشقۇرۇش ئۇقتۇرۇشى
Name[uk]=Керування сповіщеннями
Name[vi]=Qun lý các thông báo
Name[wa]=Manaedjî les notifiaedjes
Name[x-test]=xxManage Notificationsxx
Name[zh_CN]=
Name[zh_TW]=
Comment=System Notification Configuration
Comment[af]=Stelsel Inkennisstelling Opstelling
Comment[ar]=ضبط تنبيهات النظام
Comment[ast]=Configuración de les notificaciones del sistema
Comment[be]=Настаўленні сістэмных абвяшчэнняў
Comment[be@latin]=Naładžvańnie systemnaha infarmavańnia
Comment[bg]=Настройване на системата за уведомяване
Comment[bn]=ি িি ি
Comment[bn_IN]=ি ি
Comment[br]=Kefluniañ kemenn ar reizhiad
Comment[bs]=Postava sistemskih obavještenja
Comment[ca]=Configuració de les notificacions del sistema
Comment[ca@valencia]=Configuració de les notificacions del sistema
Comment[cs]=Nastavení systémových hlášení
Comment[csb]=Kònfigùracëjô systemòwegò dôwaniô wiédzë
Comment[cy]=Ffurfweddu Hysbysiadau Cysawd
Comment[da]=Konfiguration af systembekendtgørelser
Comment[de]=Einrichtung der Systemnachrichten
Comment[el]=Διαμόρφωση ειδοποιήσεων συστήματος
Comment[en_GB]=System Notification Configuration
Comment[eo]=Agordoj de sistemaj atentigoj
Comment[es]=Configuración de las notificaciones del sistema
Comment[et]=Süsteemsete märguannete seadistamine
Comment[eu]=Sistemaren jakinarazpenaren konfigurazioa
Comment[fa]=پیکربندی اخطارهای سیستم
Comment[fi]=Järjestelmäilmoitusten asetukset
Comment[fr]=Configuration du système de notifications
Comment[fy]=Ynstellings fan de systeemoankundigingen
Comment[ga]=Cumraíocht Fhógairt an Chórais
Comment[gl]=Configuración das notificacións do sistema
Comment[gu]=િ
Comment[he]=שינוי הגדרות של הודעות המערכת
Comment[hi]= ि
Comment[hne]= ि
Comment[hr]=Konfiguriranje obavijesti sustava
Comment[hsb]=Připrawjenje systemowych powěsćow
Comment[hu]=A rendszerüzenetek beállítása
Comment[ia]=Configuration de notification de systema
Comment[id]=Konfigurasi Notifikasi Sistem
Comment[is]=Stillingar tilkynninga frá kerfinu
Comment[it]=Configurazione delle notifiche di sistema
Comment[ja]=
Comment[ka]=
Comment[kk]=Жүйелік құлақтандыруларды баптау
Comment[km]=
Comment[kn]=
Comment[ko]=
Comment[ku]=Mîhengên Hişyarkirinên Pergalê
Comment[lt]=Sistemos pranešimų derinimas
Comment[lv]=Sistēmas paziņojumu konfigurēšana
Comment[mai]= ि
Comment[mk]=Конфигурација на системските известувања
Comment[ml]=ി ിി
Comment[mr]=
Comment[ms]=Konfigurasi Pemberitahuan Sistem
Comment[nb]=Oppsett av systemvarsling
Comment[nds]=Systeemnarichten instellen
Comment[ne]= ि
Comment[nl]=Systeemnotificatie instellen
Comment[nn]=Oppsett av systemvarslingar
Comment[or]= ିି
Comment[pa]=ਿ
Comment[pl]=Ustawienia powiadamiania systemowego
Comment[pt]=Configuração das mensagens do sistema
Comment[pt_BR]=Configuração das notificações do sistema
Comment[ro]=Configurează notificările de sistem
Comment[ru]=Настройка системных уведомлений
Comment[se]=Heivet vuogádatmuittuhusat
Comment[si]=
Comment[sk]=Nastavenie systémových upozornení
Comment[sl]=Nastavitev sistemskih obvestil
Comment[sr]=Постава системских обавештења
Comment[sr@ijekavian]=Постава системских обавјештења
Comment[sr@ijekavianlatin]=Postava sistemskih obavještenja
Comment[sr@latin]=Postava sistemskih obaveštenja
Comment[sv]=Anpassa systemunderrättelser
Comment[ta]= ி
Comment[te]=ి
Comment[tg]=Танзимоти огоҳиномаҳои система
Comment[th]=
Comment[tr]=Sistem Bildirimi Yapılandırması
Comment[ug]=سىستېما ئۇقتۇرۇش سەپلىمە
Comment[uk]=Налаштування системних сповіщень
Comment[uz]=Tizimning xabarnomalarini moslash
Comment[uz@cyrillic]=Тизимнинг хабарномаларини мослаш
Comment[vi]=Cu hình Thông báo H thng
Comment[wa]=Apontiaedje po les notifiaedjes do sistinme
Comment[xh]=Uqwalaselo Lwezaziso Zendlela yokusebenza
Comment[x-test]=xxSystem Notification Configurationxx
Comment[zh_CN]=
Comment[zh_TW]=
X-KDE-Keywords=System sounds,Audio,Sound,Notify,Alerts,Notification,popups
X-KDE-Keywords[ar]=اصوات النظام,سمعي,صوت,تبليغ,إنذارات,تنبيهات,قوائم منبثة
X-KDE-Keywords[bg]=System sounds,Audio,Sound,Notify,Alerts,Notification,popups,Системни звуци,Звук,Уведомление
X-KDE-Keywords[bn]=System sounds,Audio,Sound,Notify,Alerts,Notification,popups
X-KDE-Keywords[bs]=System sounds,Audio,Sound,Notify,Alerts,Notification,popups,sistemski zvukovi,zvuk,alarmi
X-KDE-Keywords[ca]=Sons del sistema,Àudio,So,Notificar,Alertes,Notificació,missatges emergents
X-KDE-Keywords[ca@valencia]=Sons del sistema,Àudio,So,Notificar,Alertes,Notificació,missatges emergents
X-KDE-Keywords[cs]=Systémové zvuky,Audio,Zvuk,Oznámení,vyskakovací okna
X-KDE-Keywords[da]=Systemlyde,audio,lyd,meddelelser,alarmer,bekendtgørelse,pop-op
X-KDE-Keywords[de]=Klänge,Systemklänge,Audio,Sound,Benachrichtigung,Nachricht,Alarm,Signalton,Beep
X-KDE-Keywords[el]=Ήχοι συστήματος,ήχος,ήχος,ειδοποιώ,συναγερμός,ειδοποίηση,αναδυόμενα
X-KDE-Keywords[en_GB]=System sounds,Audio,Sound,Notify,Alerts,Notification,popups
X-KDE-Keywords[eo]=Sistemaj sonoj,Aŭdo,Sono,Atentigi,Avertoj,Atentigo,sprucfenestroj
X-KDE-Keywords[es]=Sonidos del sistema,Audio,Sonido,Notificar,Alertas,Notificación,emergentes
X-KDE-Keywords[et]=Süsteemsed helid,heli,audio,märguanne,märguanded,hüpikaknad
X-KDE-Keywords[eu]=Sistema-soinuak,audioa,soinua,jakinarazi,alertak,jakinarazpena,pop-upak
X-KDE-Keywords[fa]=System sounds,Audio,Sound,Notify,Alerts,Notification,popups
X-KDE-Keywords[fi]=Järjestelmä-äänet,Ääni,Huomautukset,Ilmoitukset,Varoitukset,Hälytykset,Huomautus,Ilmoitus,Varoitus,Hälytys,ponnahdusikkunat
X-KDE-Keywords[fr]=Sons du système, Audio, Son, Notifier, Alertes, Notification, fenêtres contextuelles
X-KDE-Keywords[ga]=Fuaimeanna an chórais,Fuaim,Fógairt,Fógraí,preabfhuinneoga
X-KDE-Keywords[gl]=Sons do sistema, Son, Audio, Notificación, Alertar, Notificar, emerxentes
X-KDE-Keywords[gu]=િ ,િ,, ,,,
X-KDE-Keywords[he]=System sounds,Audio,Sound,Notify,Alerts,Notification,popups,צלילים,הודעות,שמע,תפריטים מוקפצים,הודעות
X-KDE-Keywords[hi]= ि,, ि, ि, , ि,
X-KDE-Keywords[hu]=Rendszerhangok,Hang,Hang,Értesítés,Figyelmeztetés,Értesítés,felugró
X-KDE-Keywords[ia]=Sonos de systema,Audio,Sono,Notifica,Alertas,Notification,popups
X-KDE-Keywords[id]=Suara sistem,Audio,Suara,Beritahu,Peringatan,Notifikasi,popup
X-KDE-Keywords[is]=Kerfishljóð,hljóð,hljóðkerfi,tilkynningar,aðvörun,tilkynning,sprettgluggi
X-KDE-Keywords[it]=Suoni di sistema,audio,suono,notifica,avvisi,notifiche,avvisi a comparsa
X-KDE-Keywords[ja]=System sounds,Audio,Sound,Notify,Alerts,Notification,popups
X-KDE-Keywords[kk]=System sounds,Audio,Sound,Notify,Alerts,Notification,popups
X-KDE-Keywords[km]=
X-KDE-Keywords[ko]=System sounds,Audio,Sound,Notify,Alerts,Notification,popups, ,,,
X-KDE-Keywords[lv]=Sistēmas skaņas,audio,skaņa,paziņot,brīdinājumi,paziņojums,uzlecošais logs
X-KDE-Keywords[mr]= , , , ,
X-KDE-Keywords[nb]=Systemlyder,Audio,Lyd,Varsle,Alarm,Varslinger,oppsprett
X-KDE-Keywords[nds]=Systeemkläng,Klang,Kläng,Systeembescheden,Alarms,Bescheden,Opdukers
X-KDE-Keywords[nl]=Systeemgeluiden,audio,geluid,melden,alarmmelding,meldingen,pop-ups
X-KDE-Keywords[nn]=Systemlydar,Audio,Lyd,Varsling,Meldingar,Varslingar,sprettoppvindauge
X-KDE-Keywords[pa]=ਿ ,,,,,,ਿ,
X-KDE-Keywords[pl]=Dźwięki systemowe,Audio,Dźwięk,Powiadomienie,Alarmy,Powiadom,okna wyskakujące
X-KDE-Keywords[pt]=Sons do sistema,Áudio,Som,Notificar,Alertas,Notificação,Mensagens
X-KDE-Keywords[pt_BR]=Sons do sistema,Áudio,Som,Notificar,Alertas,Notificação,mensagens
X-KDE-Keywords[ro]=Sunete sistem,audio,sunet,notificare,alerte,notifică,popup
X-KDE-Keywords[ru]=System sounds,Audio,Sound,Notify,Alerts,Notification,popups,звуковая система,звук,аудио,уведомление,предупреждения,всплывающие окна
X-KDE-Keywords[sk]=Systémové zvuky,Audio,Zvuk,Notify,Alerts,Notification,popups
X-KDE-Keywords[sl]=sistemski zvoki,audio,zvok,obvestila,obvestilo,obveščanje,alarmi,alarm,pojavna okna,pojavno okno
X-KDE-Keywords[sr]=System sounds,Audio,Sound,Notify,Alerts,Notification,popups,системски звукови,аудио,звук,обавештење,аларм,искакач
X-KDE-Keywords[sr@ijekavian]=System sounds,Audio,Sound,Notify,Alerts,Notification,popups,системски звукови,аудио,звук,обавештење,аларм,искакач
X-KDE-Keywords[sr@ijekavianlatin]=System sounds,Audio,Sound,Notify,Alerts,Notification,popups,sistemski zvukovi,audio,zvuk,obaveštenje,alarm,iskakač
X-KDE-Keywords[sr@latin]=System sounds,Audio,Sound,Notify,Alerts,Notification,popups,sistemski zvukovi,audio,zvuk,obaveštenje,alarm,iskakač
X-KDE-Keywords[sv]=Systemljud,Ljud,Underrätta,Varningar,Underrättelser
X-KDE-Keywords[tg]=Системаҳои овозӣ,Аудио,Овоз,Хабар,Ҳушдор,Огоҳӣ,пайдошаванда
X-KDE-Keywords[tr]=Sistem sesleri,Ses,Uyarı,Uyarılar,Bildirimler
X-KDE-Keywords[ug]=سىستېما ئاۋازلىرى، ئۈن، بىلدۈرۈش، كۆرسەتمە، ئۇقتۇرۇشلار، سەكرىمىلەر
X-KDE-Keywords[uk]=System sounds;Audio;Sound;Notify;Alerts;Notification;popups;звук;система;системні звуки;звуки системи;сповіщення;нагадування;підказки;контекст
X-KDE-Keywords[vi]=Âm thanh h thng,Âm,Âm thanh,Thông báo,Cnh báo,Thông báo,System sounds,Audio,Sound,Notify,Alerts,Notification,popups
X-KDE-Keywords[wa]=Sons sistinme,Sons do sistinme,Odio,Son,Notifyî,Abranles,Notifiaedje,aspitants purneas
X-KDE-Keywords[x-test]=xxSystem sounds,Audio,Sound,Notify,Alerts,Notification,popupsxx
X-KDE-Keywords[zh_CN]=System sounds,Audio,Sound,Notify,Alerts,Notification,popups,,,,,,
X-KDE-Keywords[zh_TW]=System sounds,Audio,Sound,Notify,Alerts,Notification,popups
Categories=Qt;KDE;X-KDE-settings-sound;

View file

@ -1,273 +0,0 @@
/*
Copyright (C) 2000,2002 Carsten Pfeiffer <pfeiffer@kde.org>
Copyright (C) 2005,2006 Olivier Goffart <ogoffart at kde.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "knotify.h"
#include <QLabel>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QDBusInterface>
#include <QSortFilterProxyModel>
#include <QStandardItemModel>
#include <kapplication.h>
#include <kaboutdata.h>
#include <kcombobox.h>
#include <kconfiggroup.h>
#include <knotifyconfigwidget.h>
#include <kpluginfactory.h>
#include <kpluginloader.h>
#include <kstandarddirs.h>
#include <kurlcompletion.h>
#include <kurlrequester.h>
#include "ui_playersettings.h"
K_PLUGIN_FACTORY( NotifyFactory, registerPlugin<KCMKNotify>(); )
K_EXPORT_PLUGIN( NotifyFactory("kcmnotify") )
KCMKNotify::KCMKNotify(QWidget *parent, const QVariantList & )
: KCModule(NotifyFactory::componentData(), parent/*, name*/),
m_playerSettings( 0L )
{
setButtons( Help | Default | Apply );
setQuickHelp( i18n("<h1>System Notifications</h1>"
"KDE allows for a great deal of control over how you "
"will be notified when certain events occur. There are "
"several choices as to how you are notified:"
"<ul><li>As the application was originally designed.</li>"
"<li>With a beep or other noise.</li>"
"<li>Via a popup dialog box with additional information.</li>"
"<li>By recording the event in a logfile without "
"any additional visual or audible alert.</li>"
"</ul>"));
QVBoxLayout *layout = new QVBoxLayout( this );
layout->setMargin( 0 );
QTabWidget *tab = new QTabWidget(this);
layout->addWidget(tab);
QWidget * app_tab = new QWidget(tab);
QVBoxLayout *app_layout = new QVBoxLayout( app_tab );
QLabel *label = new QLabel( i18n( "Event source:" ), app_tab );
m_appCombo = new KComboBox( false, app_tab );
m_appCombo->setSizeAdjustPolicy( QComboBox::AdjustToContents );
m_appCombo->setObjectName( QLatin1String( "app combo" ) );
// We want to sort the combo box
QSortFilterProxyModel *proxyModel = new QSortFilterProxyModel(this);
proxyModel->setSourceModel(new QStandardItemModel(0, 1, proxyModel));
// Now configure and set our sort model
proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
m_appCombo->setModel(proxyModel);
QHBoxLayout *hbox = new QHBoxLayout();
app_layout->addLayout( hbox );
hbox->addWidget( label );
hbox->addWidget( m_appCombo, 10 );
m_notifyWidget = new KNotifyConfigWidget( app_tab );
app_layout->addWidget( m_notifyWidget );
connect( m_notifyWidget, SIGNAL(changed(bool)), this, SIGNAL(changed(bool)));
m_playerSettings = new PlayerSettingsDialog(tab);
connect(m_playerSettings, SIGNAL(changed(bool)) , this, SIGNAL(changed(bool)));
/* general->layout()->setMargin( KDialog::marginHint() );
hardware->layout()->setMargin( KDialog::marginHint() );*/
tab->addTab(app_tab, i18n("&Applications"));
tab->addTab(m_playerSettings, i18n("&Player Settings"));
m_appCombo->setFocus();
connect( m_appCombo, SIGNAL( activated( int ) ),
SLOT( slotAppActivated( int )) );
KAboutData* ab = new KAboutData(
"kcmknotify", 0, ki18n("KNotify"), "4.0",
ki18n("System Notification Control Panel Module"),
KAboutData::License_GPL, ki18n("(c) 2002-2006 KDE Team"));
ab->addAuthor( ki18n("Olivier Goffart"), KLocalizedString(), "ogoffart@kde.org" );
ab->addAuthor( ki18n("Carsten Pfeiffer"), KLocalizedString(), "pfeiffer@kde.org" );
ab->addCredit( ki18n("Charles Samuels"), ki18n("Original implementation"),
"charles@altair.dhs.org" );
setAboutData( ab );
}
KCMKNotify::~KCMKNotify()
{
KConfig _config("knotifyrc", KConfig::NoGlobals);
KConfigGroup config(&_config, "Misc" );
config.writeEntry( "LastConfiguredApp", m_appCombo->currentText() );
config.sync();
}
void KCMKNotify::slotAppActivated(const int &index)
{
QString text( m_appCombo->itemData(index).toString() );
m_notifyWidget->save();
m_notifyWidget->setApplication( text );
}
void KCMKNotify::slotPlayerSettings()
{
}
void KCMKNotify::defaults()
{
// m_notifyWidget->resetDefaults( true ); // ask user
m_playerSettings->defaults();
}
void KCMKNotify::load()
{
//setEnabled( false );
// setCursor( KCursor::waitCursor() );
m_appCombo->clear();
// m_notifyWidget->clear();
QStringList fullpaths =
KGlobal::dirs()->findAllResources("data", "*/*.notifyrc", KStandardDirs::NoDuplicates );
foreach (const QString &fullPath, fullpaths )
{
int slash = fullPath.lastIndexOf( '/' ) - 1;
int slash2 = fullPath.lastIndexOf( '/', slash );
QString appname= slash2 < 0 ? QString() : fullPath.mid( slash2+1 , slash-slash2 );
if ( !appname.isEmpty() )
{
KConfig config(fullPath, KConfig::NoGlobals, "data" );
KConfigGroup globalConfig( &config, QString::fromLatin1("Global") );
QString icon = globalConfig.readEntry(QString::fromLatin1("IconName"), QString::fromLatin1("misc"));
QString description = globalConfig.readEntry( QString::fromLatin1("Comment"), appname );
m_appCombo->addItem( SmallIcon( icon ), description, appname );
}
}
m_appCombo->model()->sort(0);
/*
KConfig config( "knotifyrc", true, false );
config.setGroup( "Misc" );
QString appDesc = config.readEntry( "LastConfiguredApp", "KDE System Notifications" );
if this code gets enabled again, make sure to apply r494965
if ( !appDesc.isEmpty() )
m_appCombo->setCurrentItem( appDesc );
// sets the applicationEvents for KNotifyWidget
slotAppActivated( m_appCombo->currentText() );
// unsetCursor(); // unsetting doesn't work. sigh.
setEnabled( true );
emit changed( false );
*/
m_playerSettings->load();
if ( m_appCombo->count() > 0 ) {
m_appCombo->setCurrentIndex(0);
m_notifyWidget->setApplication( m_appCombo->itemData( 0 ).toString() );
}
emit changed(false);
}
void KCMKNotify::save()
{
if ( m_playerSettings )
m_playerSettings->save();
m_notifyWidget->save(); // will dcop knotify about its new config
emit changed( true );
}
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
PlayerSettingsDialog::PlayerSettingsDialog( QWidget *parent )
: QWidget(parent), m_change(false)
{
m_ui = new Ui_PlayerSettingsUI();
m_ui->setupUi( this );
load();
connect( m_ui->cbSoundSystem, SIGNAL(clicked(bool)), this, SLOT(slotChanged()));
connect( m_ui->cbNone, SIGNAL(clicked(bool)), this, SLOT(slotChanged()));
}
void PlayerSettingsDialog::load()
{
KConfig _config( "knotifyrc", KConfig::NoGlobals );
KConfigGroup config(&_config, "Sounds" );
m_ui->cbNone->setChecked( config.readEntry( "No sound", false ) );
emit changed( false );
m_change=false;
}
void PlayerSettingsDialog::save()
{
if(!m_change)
return;
// see kdebase/runtime/knotify/notifybysound.h
KConfig _config("knotifyrc", KConfig::NoGlobals);
KConfigGroup config(&_config, "Sounds" );
config.writeEntry( "No sound", m_ui->cbNone->isChecked() );
config.sync();
QDBusInterface itr("org.kde.knotify", "/Notify", "org.kde.KNotify", QDBusConnection::sessionBus(), this);
itr.call("reconfigure");
m_change=false;
}
void PlayerSettingsDialog::slotChanged()
{
m_change=true;
emit changed(true);
}
void PlayerSettingsDialog::defaults()
{
m_ui->cbSoundSystem->setChecked(true);
m_change=true;
emit changed(true);
}
PlayerSettingsDialog::~ PlayerSettingsDialog( )
{
delete m_ui;
}
#include "moc_knotify.cpp"

View file

@ -1,84 +0,0 @@
/*
Copyright (C) 2000,2002 Carsten Pfeiffer <pfeiffer@kde.org>
Copyright (C) 2005,2006 Olivier Goffart <ogoffart at kde.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KNOTIFY_H
#define KNOTIFY_H
#include <kcmodule.h>
#include <QPushButton>
class KComboBox;
class PlayerSettingsDialog;
class KNotifyConfigWidget;
QT_BEGIN_NAMESPACE
class Ui_PlayerSettingsUI;
QT_END_NAMESPACE
class KCMKNotify : public KCModule
{
Q_OBJECT
public:
KCMKNotify(QWidget *parent, const QVariantList &);
virtual ~KCMKNotify();
virtual void defaults();
virtual void save();
public Q_SLOTS:
virtual void load();
private Q_SLOTS:
void slotAppActivated( const int &);
void slotPlayerSettings();
private:
KComboBox *m_appCombo;
KNotifyConfigWidget *m_notifyWidget;
PlayerSettingsDialog *m_playerSettings;
};
class PlayerSettingsDialog : public QWidget
{
Q_OBJECT
public:
PlayerSettingsDialog( QWidget *parent );
~PlayerSettingsDialog();
void load();
void save();
void defaults();
protected Q_SLOTS:
void slotChanged();
signals:
void changed(bool);
private:
Ui_PlayerSettingsUI* m_ui;
bool m_change;
};
#endif

View file

@ -1,47 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PlayerSettingsUI</class>
<widget class="QWidget" name="PlayerSettingsUI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>407</width>
<height>83</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QRadioButton" name="cbSoundSystem">
<property name="text">
<string>Use the &amp;KDE sound system</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="cbNone">
<property name="text">
<string>&amp;No audio output</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<connections/>
</ui>

View file

@ -26,5 +26,7 @@ install(TARGETS kcm_style DESTINATION ${KDE4_PLUGIN_INSTALL_DIR})
########### install files ###############
install( FILES kcmstyle.notifyrc DESTINATION ${KDE4_DATA_INSTALL_DIR}/kcmstyle )
install( FILES style.desktop DESTINATION ${KDE4_SERVICES_INSTALL_DIR} )
install(
FILES style.desktop
DESTINATION ${KDE4_SERVICES_INSTALL_DIR}
)

View file

@ -41,7 +41,6 @@
#include <kstyle.h>
#include <kstandarddirs.h>
#include <KDebug>
#include <KNotification>
#include <KColorScheme>
#include <KStandardDirs>
#ifdef Q_WS_X11

View file

@ -1,179 +0,0 @@
[Global]
IconName=show-menu
Name=Menubar manager
Name[bs]=Menadžer menija
Name[ca]=Gestor de barra de menús
Name[ca@valencia]=Gestor de barra de menús
Name[cs]=Správce hlavní nabídky
Name[da]=Håndtering af menulinje
Name[de]=Menüleistenverwaltung
Name[el]=Διαχειριστής γραμμής μενού
Name[en_GB]=Menubar manager
Name[es]=Gestor de la barra de menú
Name[et]=Menüüriba haldur
Name[eu]=Menu-barra kudeatzailea
Name[fi]=Valikkorivin hallinta
Name[fr]=Gestionnaire de barre de menus
Name[gl]=Xestor da barra de menú
Name[he]=מנהל שורת תפריט
Name[hu]=Menüsor kezelő
Name[ia]=Gerente de barra de menu
Name[it]=Gestione della barra dei menu
Name[kk]=Мәзір панелінің менеджері
Name[ko]=메뉴 표시줄 관리자
Name[lt]=Meniu juostos tvarkyklė
Name[mr]=मेन्यू पट्टी व्यवस्थापक
Name[nb]=Menylinjebehandler
Name[nds]=Menübalkenpleger
Name[nl]=Beheerder van menubalk
Name[pa]=ਮੇਨੂਬਾਰ ਮੈਨੇਜਰ
Name[pl]=Zarządzanie paskiem menu
Name[pt]=Gestor do menu
Name[pt_BR]=Gerenciador da barra de menus
Name[ro]=Administrator al barei de meniu
Name[ru]=Менеджер панели меню
Name[sk]=Správca panelu ponuky
Name[sl]=Upravljalnik menijske vrstice
Name[sr]=Менаџер трака менија
Name[sr@ijekavian]=Менаџер трака менија
Name[sr@ijekavianlatin]=Menadžer traka menija
Name[sr@latin]=Menadžer traka menija
Name[sv]=Menyradshanterare
Name[tr]=Menü çubuğu yöneticisi
Name[uk]=Керування смужкою меню
Name[x-test]=xxMenubar managerxx
Name[zh_CN]=Menubar manager,菜单栏管理器
Name[zh_TW]=選單列管理程式
Comment=Menubar exporter
Comment[bs]=Izvoz menija
Comment[ca]=Exportador de barra de menús
Comment[ca@valencia]=Exportador de barra de menús
Comment[cs]=Export hlavní nabídky
Comment[da]=Menulinje-eksportør
Comment[de]=Menüleisten-Export
Comment[el]=Εξαγωγέας γραμμής μενού
Comment[en_GB]=Menubar exporter
Comment[es]=Exportador de la barra de menú
Comment[et]=Menüüriba eksportimine
Comment[eu]=Menu-barra esportatzailea
Comment[fi]=Valikkorivin vienti
Comment[fr]=Exportateur de barre de menus
Comment[gl]=Exportador da barra de menú
Comment[he]=מייצא של תפריטים
Comment[hu]=Menüsor exportáló
Comment[ia]=Exportator de barra de menu
Comment[it]=Esportatore della barra dei menu
Comment[kk]=Мәзір панелін экспорттағышы
Comment[ko]=메뉴 표시줄 내보내기
Comment[lt]=Meniu juostos eksportavimo programa
Comment[mr]=मेन्यू पट्टी निर्यात करणारा
Comment[nb]=Menylinje-eksporterer
Comment[nds]=Menübalken-Export
Comment[nl]=Exportprogramma van menubalk
Comment[pl]=Eksporter paska menu
Comment[pt]=Exportador do menu
Comment[pt_BR]=Exportador da barra de menus
Comment[ro]=Exportator al barei de meniu
Comment[ru]=Экспортёр панели меню
Comment[sk]=Exportovač panelu ponuky
Comment[sl]=Izvoznik menijske vrstice
Comment[sr]=Извозник трака менија
Comment[sr@ijekavian]=Извозник трака менија
Comment[sr@ijekavianlatin]=Izvoznik traka menija
Comment[sr@latin]=Izvoznik traka menija
Comment[sv]=Menyradsexport
Comment[tr]=Menü çubuğu aktarıcı
Comment[uk]=Експортування смужки меню
Comment[x-test]=xxMenubar exporterxx
Comment[zh_CN]=菜单栏导出器
Comment[zh_TW]=選單列匯出器
[Event/reload]
Name=Menubar changed
Name[bs]=Meni promijenjen
Name[ca]=La barra de menús ha canviat
Name[ca@valencia]=La barra de menús ha canviat
Name[cs]=Hlavní nabídka změněna
Name[da]=Menulinje ændret
Name[de]=Menüleiste geändert
Name[el]=Η γραμμή μενού άλλαξε
Name[en_GB]=Menubar changed
Name[es]=La barra de menú ha cambiado
Name[et]=Menüüriba on muudetud
Name[eu]=Menu-barra aldatu da
Name[fi]=Valikkorivi muuttui
Name[fr]=Barre de menus modifiée
Name[gl]=Cambiouse a barra de menú
Name[he]=תפריט שונה
Name[hu]=A menüsor megváltozott
Name[ia]=Barra de menu cambiava
Name[it]=Barra dei menu cambiata
Name[kk]=Мәзір панелі өзгертілді
Name[ko]=메뉴 표시줄 변경됨
Name[lt]=Meniu juosta pakeista
Name[mr]=मेन्यू पट्टी बदलली आहे
Name[nb]=Menylinje er endret
Name[nds]=Menübalken ännert
Name[nl]=Menubalk is gewijzigd
Name[pa]=ਮੇਨੂਬਾਰ ਬਦਲੀ
Name[pl]=Pasek menu uległ zmianie
Name[pt]=O menu foi alterado
Name[pt_BR]=Barra de menus alterada
Name[ro]=Bara de meniu s-a schimbat
Name[ru]=Панель меню изменена
Name[sk]=Panel ponuky zmenený
Name[sl]=Menijska vrstica spremenjena
Name[sr]=Трака менија измењена
Name[sr@ijekavian]=Трака менија измењена
Name[sr@ijekavianlatin]=Traka menija izmenjena
Name[sr@latin]=Traka menija izmenjena
Name[sv]=Menyrad ändrad
Name[tr]=Menü çubuğu değiştirildi
Name[uk]=До смужки меню внесено зміни
Name[x-test]=xxMenubar changedxx
Name[zh_CN]=菜单栏设置更改
Name[zh_TW]=選單列已變更
Comment=Settings changes will take effect only on application restart
Comment[bs]=Postavke će imati efekta samo pri ponovnom startu programa
Comment[ca]=Els canvis d'arranjament només tindran efecte en reiniciar l'aplicació
Comment[ca@valencia]=Els canvis d'arranjament només tindran efecte en reiniciar l'aplicació
Comment[cs]=Změny se projeví až po opětovném spuštění aplikace
Comment[da]=Ændring af indstillinger vil først få virkning efter programmet genstartes
Comment[de]=Änderungen der Einstellungen werden erst nach dem Neustart der Anwendung wirksam
Comment[el]=Οι αλλαγές των ρυθμίσεων θα ενεργοποιηθούν μόνο με την επανεκκίνηση της εφαρμογής
Comment[en_GB]=Settings changes will take effect only on application restart
Comment[es]=Los cambios en las preferencias solo tendrán efecto cuando se reinicie la aplicación
Comment[et]=Muudetud seadistused rakenduvad alles rakenduse taaskäivitamise järel
Comment[eu]=Ezarpen aldaketak gauzatuko dira soilik aplikazioa berrabiarazi ondoren
Comment[fi]=Asetusten muutokset tulevat voimaan vasta, kun sovellus käynnistetään uudelleen.
Comment[fr]=Les modifications de paramètres ne prendront effet qu'après le redémarrage de l'application
Comment[gl]=Os cambios na configuración só se han aplicar ao reiniciar o programa
Comment[he]=השינויים יחולו רק בהפעלה מחודשת של יישומים
Comment[hu]=A beállítások változásai csak az alkalmazás újraindításakor lépnek életbe
Comment[ia]=Modificationes de preferentias habera effectos solmente quando on reinitia le application
Comment[it]=Le modifiche alla configurazione avranno effetto solo al riavvio delle applicazioni
Comment[kk]=Параметр өзгерістері бағдарлама жүмысын жаңадан бастағанда іске асады
Comment[ko]=프로그램을 다시 시작하면 설정이 적용됩니다
Comment[lt]=Nustatymų pakeitimai pradės galioti tik iš naujo paleidus programą
Comment[mr]=संयोजनेतील बदल अनुप्रयोग पुन्हा सुरु केल्यावरच कार्यान्वित होतील
Comment[nb]=Innstillinger som er endret får bare virkning når programmet startes på nytt
Comment[nds]=Ännern warrt eerst bi den nakamen Start vun't Programm övernahmen
Comment[nl]=Wijzigingen in instellingen zullen alleen effectief zijn na het herstarten van de toepassing
Comment[pl]=Zmiany ustawień dojdą do skutku tylko po ponownym uruchomieniu programu
Comment[pt]=As mudanças de configuração farão efeito ao reiniciar a aplicação
Comment[pt_BR]=As alterações na configuração somente terão efeito ao reiniciar o aplicativo
Comment[ro]=Modificările opțiunilor vor intra în vigoare după repornirea aplicației
Comment[ru]=Изменения параметров вступят в силу только после перезапуска приложения
Comment[sk]=Zmeny nastavení sa prejavia iba pri reštarte aplikácie
Comment[sl]=Spremembe nastavitev bodo stopile v veljavo po ponovnem zagonu programa
Comment[sr]=Промене поставки ступиће на снагу по наредном покретању програма
Comment[sr@ijekavian]=Промене поставки ступиће на снагу по наредном покретању програма
Comment[sr@ijekavianlatin]=Promene postavki stupiće na snagu po narednom pokretanju programa
Comment[sr@latin]=Promene postavki stupiće na snagu po narednom pokretanju programa
Comment[sv]=Ändringar av inställningar får inte någon effekt förrän programmet startas om
Comment[tr]=Ayar değişiklikleri sadece uygulama yeniden başlatıldıktan sonra uygulanacaktır
Comment[uk]=Зміни у параметрах набудуть чинності лише після перезапуску програми
Comment[x-test]=xxSettings changes will take effect only on application restartxx
Comment[zh_CN]=只有重启程序后一些设置才能生效
Comment[zh_TW]=設定變更會在下次應用程式啟動時生效
Action=Popup

View file

@ -31,5 +31,5 @@ install(
install(
FILES kcrash.notifyrc
DESTINATION ${KDE4_DATA_INSTALL_DIR}/kcrash
DESTINATION ${KDE4_CONFIG_INSTALL_DIR}/notifications
)

View file

@ -1,10 +1,10 @@
[Global]
[kcrash]
Name=kcrash
Comment=Crash notifier
IconName=tools-report-bug
[Event/Crash]
[kcrash/Crash]
Name=Application crashed
Action=Sound|Popup
Actions=Sound,Popup
Sound=KDE-Sys-App-Error-Serious-Very.ogg
IconName=tools-report-bug

View file

@ -102,15 +102,16 @@ void KCrashModule::slotDirty(const QString &path)
if (kcrashflags & KCrash::Notify) {
kDebug() << "Sending notification for" << kcrashfilepath;
// NOTE: when the notification is closed/deleted the actions become non-operational
KNotification* knotification = new KNotification("Crash", KNotification::Persistent, this);
knotification->setComponentData(KComponentData("kcrash"));
KNotification* knotification = new KNotification(this);
knotification->setEventID("kcrash/Crash");
knotification->setFlags(KNotification::Persistent);
knotification->setTitle(i18n("%1 crashed", kcrashappname));
knotification->setText(i18n("For details about the crash look into the system log."));
knotification->setActions(QStringList() << i18n("Report"));
m_notifications.append(knotification);
connect(knotification, SIGNAL(closed()), this, SLOT(slotClosed()));
connect(knotification, SIGNAL(action1Activated()), this, SLOT(slotReport()));
knotification->sendEvent();
knotification->send();
}
if (kcrashflags & KCrash::Log) {
// NOTE: this goes to the system log by default

View file

@ -9,5 +9,5 @@ add_subdirectory(kded)
install(
FILES kdirshare.notifyrc
DESTINATION ${KDE4_DATA_INSTALL_DIR}/kdirshare
DESTINATION ${KDE4_CONFIG_INSTALL_DIR}/notifications
)

View file

@ -184,11 +184,7 @@ void KDirShareModule::slotDelayedRestore()
}
if (requiresauth) {
if (!m_passwdstore.openStore()) {
KNotification *knotification = new KNotification("AuthError");
knotification->setComponentData(KComponentData("kdirshare"));
knotification->setTitle(i18n("Directory share"));
knotification->setText(i18n("Authorization is required but could not open password store"));
knotification->sendEvent();
KNotification::event("kdirshare/AuthError");
return;
}
}
@ -220,10 +216,6 @@ void KDirShareModule::slotDelayedRestore()
}
}
if (shareerror) {
KNotification *knotification = new KNotification("ShareError");
knotification->setComponentData(KComponentData("kdirshare"));
knotification->setTitle(i18n("Directory share"));
knotification->setText(i18n("Unable to share one or more directories"));
knotification->sendEvent();
KNotification::event("kdirshare/ShareError");
}
}

View file

@ -1,16 +1,16 @@
[Global]
[kdirshare]
Name=kdirshare
Comment=Directory share
IconName=network-server
[Event/AuthError]
[kdirshare/AuthError]
Name=Authorization is required but could not open password store
Action=Sound|Popup
Actions=Sound,Popup
Sound=KDE-Sys-App-Error-Serious.ogg
IconName=dialog-error
[Event/ShareError]
[kdirshare/ShareError]
Name=Unable to share one or more directories
Action=Sound|Popup
Actions=Sound,Popup
Sound=KDE-Sys-App-Error-Serious.ogg
IconName=dialog-error

View file

@ -11,5 +11,5 @@ add_subdirectory(kded)
install(
FILES kfreespace.notifyrc
DESTINATION ${KDE4_DATA_INSTALL_DIR}/kfreespace
DESTINATION ${KDE4_CONFIG_INSTALL_DIR}/notifications
)

View file

@ -104,11 +104,7 @@ void KFreeSpaceModule::slotInit()
}
}
if (watcherror) {
KNotification *knotification = new KNotification("WatchError");
knotification->setComponentData(KComponentData("kfreespace"));
knotification->setTitle(i18n("Free Space Notifier"));
knotification->setText(i18n("Unable to watch one or more devices"));
knotification->sendEvent();
KNotification::event("kfreespace/WatchError");
}
}

View file

@ -82,11 +82,10 @@ void KFreeSpaceImpl::timerEvent(QTimerEvent *event)
kDebug() << "Current" << m_soliddevice.udi()
<< "space is" << freespacestring;
if (freespace <= m_freespace) {
KNotification *knotification = new KNotification("WatchLow");
knotification->setComponentData(KComponentData("kfreespace"));
knotification->setTitle(i18n("Low Disk Space"));
KNotification *knotification = new KNotification();
knotification->setEventID("kfreespace/WatchLow");
knotification->setText(i18n("%1 has %2 free space", m_soliddevice.description(), freespacestring));
knotification->sendEvent();
knotification->send();
}
} else {
event->ignore();

View file

@ -1,16 +1,16 @@
[Global]
[kfreespace]
Name=kfreespace
Comment=Free Space Notifier
IconName=drive-harddisk
[Event/WatchError]
[kfreespace/WatchError]
Name=Unable to watch one or more devices
Action=Sound|Popup
Actions=Sound,Popup
Sound=KDE-Sys-App-Error-Serious.ogg
IconName=dialog-error
[Event/WatchLow]
[kfreespace/WatchLow]
Name=Low Disk Space
Action=Sound|Popup
Actions=Sound,Popup
Sound=KDE-Sys-App-Error-Serious.ogg
IconName=dialog-warning

View file

@ -39,7 +39,7 @@ install(
# KNotify configuration
install(
FILES kglobalaccel.notifyrc
DESTINATION ${KDE4_DATA_INSTALL_DIR}/kglobalaccel
DESTINATION ${KDE4_CONFIG_INSTALL_DIR}/notifications
)
kde4_add_dbus_service(org.kde.kglobalaccel.service.in)

View file

@ -193,10 +193,10 @@ bool GlobalShortcutsRegistry::keyPressed(int keyQt)
shortcut->context()->component()->emitGlobalShortcutPressed( *shortcut );
// Then do anything else
KNotification *notification = new KNotification("globalshortcutpressed", KNotification::CloseOnTimeout);
KNotification *notification = new KNotification(this);
notification->setEventID("kglobalaccel/globalshortcutpressed");
notification->setText(i18n("The global shortcut for %1 was issued.", shortcut->friendlyName()));
notification->addContext( "application", shortcut->context()->component()->friendlyName() );
notification->sendEvent();
notification->send();
return true;
}

View file

@ -1,4 +1,4 @@
[Global]
[kglobalaccel]
IconName=preferences-desktop-keyboard
Comment=Global Keyboard Shortcuts
Comment[ar]=اختصارات لوحة المفاتيح العمومية
@ -143,164 +143,7 @@ Name[x-test]=xxkglobalaccelxx
Name[zh_CN]=kglobalaccel
Name[zh_TW]=kglobalaccel
[Context/Application]
Name=Application
Name[ar]=تطبيق
Name[as]=অনুপ্ৰয়োগ
Name[ast]=Aplicación
Name[be@latin]=Aplikacyja
Name[bg]=Програма
Name[bn]=অ্যাপলিকেশন
Name[bn_IN]=অ্যাপ্লিকেশন
Name[bs]=Program
Name[ca]=Aplicació
Name[ca@valencia]=Aplicació
Name[cs]=Aplikace
Name[csb]=Programa
Name[da]=Program
Name[de]=Programm
Name[el]=Εφαρμογή
Name[en_GB]=Application
Name[eo]=Aplikaĵo
Name[es]=Aplicación
Name[et]=Rakendus
Name[eu]=Aplikazioa
Name[fa]=برنامه
Name[fi]=Sovellus
Name[fr]=Application
Name[fy]=Applikaasje
Name[ga]=Feidhmchlár
Name[gl]=Programa
Name[gu]=કાર્યક્રમ
Name[he]=יישום
Name[hi]=अनुप्रयोग
Name[hne]=अनुपरयोग
Name[hr]=Aplikacija
Name[hsb]=Aplikacija
Name[hu]=Alkalmazás
Name[ia]=Application
Name[id]=Aplikasi
Name[is]=Forrit
Name[it]=Applicazione
Name[ja]=アプリケーション
Name[kk]=Қолданба
Name[km]=កម្មវិធី
Name[kn]=ಅನ್ವಯ
Name[ko]=프로그램
Name[ku]=Sepan
Name[lt]=Programa
Name[lv]=Programma
Name[mai]=अनुप्रयोग
Name[mk]=Апликација
Name[ml]=പ്രയോഗം
Name[mr]=अनुप्रयोग
Name[nb]=Program
Name[nds]=Programm
Name[nl]=Programma
Name[nn]=Program
Name[or]=ପ୍ରୟୋଗ
Name[pa]=ਐਪਲੀਕੇਸ਼ਨ
Name[pl]=Program
Name[pt]=Aplicação
Name[pt_BR]=Aplicativo
Name[ro]=Aplicație
Name[ru]=Приложение
Name[si]=යෙදුම්
Name[sk]=Aplikácia
Name[sl]=Program
Name[sr]=Програм
Name[sr@ijekavian]=Програм
Name[sr@ijekavianlatin]=Program
Name[sr@latin]=Program
Name[sv]=Program
Name[ta]=பயன்பாடுகள்
Name[te]=అనువర్తనము
Name[tg]=Барнома
Name[th]=โปรแกรม
Name[tr]=Uygulama
Name[ug]=پروگرامما
Name[uk]=Програма
Name[uz]=Dastur
Name[uz@cyrillic]=Дастур
Name[vi]=Ứng dụng
Name[wa]=Programe
Name[x-test]=xxApplicationxx
Name[zh_CN]=应用程序
Name[zh_TW]=應用程式
Comment=The application name
Comment[ar]=اسم التطبيق
Comment[ast]=Nome de l'aplicación
Comment[bg]=Име на програма
Comment[bn]=অ্যাপলিকেশন-এর নাম
Comment[bs]=Ime programa
Comment[ca]=El nom de l'aplicació
Comment[ca@valencia]=El nom de l'aplicació
Comment[cs]=Název aplikace
Comment[csb]=Miono aplikacëji
Comment[da]=Programnavnet
Comment[de]=Der Name der Anwendung
Comment[el]=Το όνομα εφαρμογής
Comment[en_GB]=The application name
Comment[eo]=La nomo de aplikaĵo
Comment[es]=Nombre de la aplicación
Comment[et]=Rakenduse nimi
Comment[eu]=Aplikazioaren izena
Comment[fa]=نام برنامه
Comment[fi]=Sovelluksen nimi
Comment[fr]=Le nom de l'application
Comment[fy]=De applikaasje namme
Comment[ga]=Ainm an fheidhmchláir
Comment[gl]=O nome do programa
Comment[gu]=કાર્યક્રમ નામ
Comment[he]=שם היישום
Comment[hi]=अनुप्रयोग नाम
Comment[hr]=Ime aplikacije
Comment[hu]=Alkalmazásnév
Comment[ia]=Le nomine de application
Comment[id]=Nama aplikasi
Comment[is]=Heiti forrits
Comment[it]=Il nome dell'applicazione
Comment[ja]=アプリケーションの名前
Comment[kk]=Қолданбаның атауы
Comment[km]=ឈ្មោះ​កម្មវិធី​
Comment[kn]=ಅನ್ವಯದ ಹೆಸರು
Comment[ko]=프로그램 이름
Comment[lt]=Programos pavadinimas
Comment[lv]=Programmas nosaukums
Comment[mai]=अनुप्रयोगक नाम
Comment[mk]=Името на апликацијата
Comment[ml]=പ്രയോഗത്തിന്റെ പേരു്
Comment[mr]=अनुप्रयोगाचे नाव
Comment[nb]=Programnavnet
Comment[nds]=De Programmnaam
Comment[nl]=De programmanaam
Comment[nn]=Programnamnet
Comment[pa]=ਐਪਲੀਕੇਸ਼ਨ ਨਾਂ
Comment[pl]=Nazwa programu
Comment[pt]=O nome da aplicação
Comment[pt_BR]=O nome do aplicativo
Comment[ro]=Denumirea aplicației
Comment[ru]=Имя приложения
Comment[si]=යෙදුම් නාමය
Comment[sk]=Názov aplikácie
Comment[sl]=Ime programa
Comment[sr]=Име програма
Comment[sr@ijekavian]=Име програма
Comment[sr@ijekavianlatin]=Ime programa
Comment[sr@latin]=Ime programa
Comment[sv]=Programnamnet
Comment[tg]=Номи барнома
Comment[th]=ชื่อของโปรแกรม
Comment[tr]=Uygulama adı
Comment[ug]=پروگرامما ئاتى
Comment[uk]=Назва програми
Comment[vi]=Tên ứng dụng
Comment[wa]=Li no do programe
Comment[x-test]=xxThe application namexx
Comment[zh_CN]=应用程序名称
Comment[zh_TW]=應用程式名稱
[Event/newshortcutregistered]
[kglobalaccel/newshortcutregistered]
Name=Global Shortcut Registration
Name[ar]=تسجيل الاختصارات العمومية
Name[ast]=Rexistru d'accesu rápidu global
@ -444,10 +287,9 @@ Comment[wa]=On programe a eredjistré des noveas rascourtis globås.
Comment[x-test]=xxAn application registered new global shortcuts.xx
Comment[zh_CN]=用于注册新全局快捷键的应用程序。
Comment[zh_TW]=一個應用程式註冊了新的全域捷徑
Contexts=Application
Action=
Actions=
[Event/globalshortcutpressed]
[kglobalaccel/globalshortcutpressed]
Name=Global Shortcut Triggered
Name[ar]=تم إطلاق اختصار عمومي
Name[ast]=Activación d'accesu rápidu global
@ -591,5 +433,4 @@ Comment[wa]=L' uzeu a (e/dis)clitchî on rascourti po ttavå
Comment[x-test]=xxThe user triggered a global shortcutxx
Comment[zh_CN]=用户触发了一个全局快捷键
Comment[zh_TW]=使用者觸發了一個全域捷徑
Contexts=Application
Action=
Actions=

View file

@ -207,17 +207,12 @@ void KGlobalAccelDPrivate::_k_newGlobalShortcutNotification()
continue;
}
KNotification *notification = new KNotification("newshortcutregistered", KNotification::CloseOnTimeout, q->parent());
KNotification *notification = new KNotification(q->parent());
notification->setEventID("kglobalaccel/newshortcutregistered");
notification->setText(i18n("The application %1 has registered a new global shortcut", component->friendlyName()));
notification->setActions(QStringList(i18n("Open Global Shortcuts Editor")));
notification->addContext("application", component->friendlyName());
QObject::connect(notification, SIGNAL(action1Activated()), component, SLOT(showKCM()));
notification->sendEvent();
notification->send();
}
changedComponents.clear();

View file

@ -69,9 +69,9 @@ void KlipperTray::slotPassivePopup(const QString& caption, const QString& text)
if (m_notification) {
m_notification->setTitle(caption);
m_notification->setText(text);
m_notification->send();
} else {
m_notification = KNotification::event(KNotification::Notification, caption, text,
KIcon("klipper").pixmap(QSize(16, 16)));
m_notification = KNotification::event("kde/notification", caption, text, "klipper");
}
}

View file

@ -1,51 +1,8 @@
add_definitions(-DKDE_DEFAULT_DEBUG_AREA=901)
project(knotify)
add_subdirectory(sounds)
########### next target ###############
set(knotify_SRCS
main.cpp
knotify.cpp
notifybysound.cpp
notifybypopup.cpp
notifybylogfile.cpp
notifybytaskbar.cpp
notifybyexecute.cpp
imageconverter.cpp
ksolidnotify.cpp
knotifyplugin.cpp
knotifyconfig.cpp
)
add_executable(knotify4 ${knotify_SRCS})
target_link_libraries(knotify4
KDE4::kdeui
KDE4::solid
KDE4::kmediaplayer
)
install(
TARGETS knotify4
DESTINATION ${KDE4_BIN_INSTALL_DIR}
)
########### install files ###############
install(
FILES kde.notifyrc
DESTINATION ${KDE4_DATA_INSTALL_DIR}/kde
DESTINATION ${KDE4_CONFIG_INSTALL_DIR}/notifications
)
install(
FILES hardwarenotifications.notifyrc
DESTINATION ${KDE4_DATA_INSTALL_DIR}/hardwarenotifications
)
install(
FILES knotify4.desktop
DESTINATION ${KDE4_SERVICES_INSTALL_DIR}
)
########### D-Bus Autostart Services #########
kde4_add_dbus_service(org.kde.knotify.service.in)

View file

@ -1,2 +0,0 @@
#!/bin/bash
$XGETTEXT *.cpp -o $podir/knotify4.pot

View file

@ -1,564 +0,0 @@
[Global]
Name=Hardware notifications
Name[ar]=تنبيهات العتاد
Name[ast]=Notificaciones d'hardware
Name[bg]=Хардуерни wведомления
Name[bn]=হার্ডওয়্যার বিজ্ঞপ্তি
Name[bs]=Obavještenja o hardveru
Name[ca]=Notificacions de maquinari
Name[ca@valencia]=Notificacions de maquinari
Name[cs]=Oznamování hardwaru
Name[da]=Hardware-bekendtgørelser
Name[de]=Hardware-Benachrichtigungen
Name[el]=Ειδοποιήσεις υλικού
Name[en_GB]=Hardware notifications
Name[eo]=Atentigoj pri aparataro
Name[es]=Notificaciones de hardware
Name[et]=Riistvara märguanded
Name[eu]=Hardware-jakinarazpenak
Name[fa]=اخطارهای سخت‌افزار
Name[fi]=Laitteistoilmoitukset
Name[fr]=Notifications du matériel
Name[ga]=Fógairt crua-earraí
Name[gl]=Notificacións do hardware
Name[gu]=હાર્ડવેર નોંધણીઓ
Name[he]=הודעות חומרה
Name[hi]=हार्डवेयर सूचनाएँ
Name[hr]=Hardverske obavijesti
Name[hu]=Hardverértesítések
Name[ia]=Notificationes de hardware
Name[id]=Notifikasi peranti keras
Name[is]=Vélbúnaðartilkynningar
Name[it]=Notifiche sull'hardware
Name[ja]=ハードウェアの通知
Name[kk]=Жабдық құлақтандырулары
Name[km]=ការ​ជូន​ដំណឹង​របស់​ផ្នែក​រឹង
Name[kn]=ಯಂತ್ರಾಂಶ ಸೂಚನೆಗಳು
Name[ko]=하드웨어 알림
Name[lt]=Aparatinės įrangos pranešimai
Name[lv]=Aparatūras paziņojumi
Name[ml]=ഹാര്‍ഡ്‌വെയര്‍ അറിയിപ്പുകള്‍
Name[mr]=हार्डवेअर सूचना
Name[nb]=Maskinvare-varslinger
Name[nds]=Reedschappen-Bescheden
Name[nl]=Hardware-meldingen
Name[nn]=Maskinvarevarslingar
Name[pa]=ਹਾਰਡਵੇਅਰ ਨੋਟੀਫਿਕੇਸ਼ਨ
Name[pl]=Powiadomienia o sprzęcie
Name[pt]=Notificações de 'hardware'
Name[pt_BR]=Notificações de hardware
Name[ro]=Notificări de echipament
Name[ru]=Уведомления от оборудования
Name[si]=දෘඩාංග දැනුම්දීම්
Name[sk]=Hardvérové upozornenia
Name[sl]=Obvestila o strojni opremi
Name[sr]=Обавештења о хардверу
Name[sr@ijekavian]=Обавјештења о хардверу
Name[sr@ijekavianlatin]=Obavještenja o hardveru
Name[sr@latin]=Obaveštenja o hardveru
Name[sv]=Underrättelser om hårdvara
Name[tg]=Огоҳиҳои сахтафзор
Name[th]=การแจ้งให้ทราบเกี่ยวกับฮาร์ดแวร์
Name[tr]=Donanım bildirimleri
Name[ug]=قاتتىق دېتال ئۇقتۇرۇشلىرى
Name[uk]=Сповіщення щодо обладнання
Name[vi]=Thông báo phần cứng
Name[wa]=Notifiaedjes di l' éndjolreye
Name[x-test]=xxHardware notificationsxx
Name[zh_CN]=硬件通知
Name[zh_TW]=硬體通知
IconName=emblem-mounted
Comment=Notifications triggered by hardware devices
Comment[ar]=إطلاق تنبيهات الأجهزة
Comment[bg]=Уведомления от хардуерните устройства
Comment[bn]=হার্ডওয়্যার ডিভাইস দ্বারা প্রদত্ত বিজ্ঞপ্তি
Comment[bs]=Obavještenja koja stižu od hardverskih uređaji
Comment[ca]=Notificacions activades per dispositius del maquinari
Comment[ca@valencia]=Notificacions activades per dispositius del maquinari
Comment[cs]=Oznamování spuštěná zařízeními
Comment[da]=Bekendtgørelser udløst af hardware-enheder
Comment[de]=Von Hardwaregeräten ausgelöste Benachrichtigungen
Comment[el]=Ειδοποιήσεις ενεργοποιημένες από τις συσκευές υλικού
Comment[en_GB]=Notifications triggered by hardware devices
Comment[eo]=Atentigoj ekagigitaj de aparatoj
Comment[es]=Notificaciones activadas por dispositivos hardware
Comment[et]=Riistvaraseadmete käivitatud märguanded
Comment[eu]=Hardware-gailuek abiarazitako jakinarazpenak
Comment[fa]=اخطارها به وسیله‌ی دستگاه‌های سخت‌افزاری راه‌اندازی شدند
Comment[fi]=Laitteistoperäiset ilmoitukset
Comment[fr]=Notifications déclenchées par des périphériques matériels
Comment[ga]=Fógraí ardaithe ag gléasanna crua-earra
Comment[gl]=Notificacións desencadeadas por dispositivos de hardware
Comment[gu]=હાર્ડવેર ઉપકરણો દ્વારા નોંધણીઓ શરુ કરાઇ
Comment[he]=הודעות מהתקני חומרה
Comment[hi]=सूचनाएं हार्डवेयर उपकरणों के द्वारा ट्रिगर किया गया
Comment[hr]=Obavijesti koje su aktivirali hardverski uređaji
Comment[hu]=Hardvereszközök által kiváltott értesítések
Comment[ia]=Notificationes discatenate per dispositivos hardware
Comment[id]=Notifikasi dipicu oleh divasi peranti keras
Comment[is]=Tilkynningar frá vélbúnaðartækjum
Comment[it]=Notifiche attivate da dispositivi hardware
Comment[ja]=ハードウェアデバイスが通知を引き起こしました
Comment[kk]=Жабдық құрылғылар жіберген құлақтандырулары
Comment[km]=ការ​ជូន​ដំណឹង​បានកេះ​ដោយឧបករណ៍​ផ្នែករឹង
Comment[kn]=ಯಂತ್ರಾಂಶ ಸಾಧನಗಳಿಂದ ಸೂಚನೆಗಳು ಆರಂಭಿಸಲಾಗಿದೆ
Comment[ko]=하드웨어 장치에서 보낸 알림
Comment[lt]=Aparatinės įrangos siunčiami pranešimai
Comment[lv]=Paziņojumi, ko ģenerē aparatūras ierīces
Comment[mr]=हार्डवेअर साधनांनी सुरु केलेल्या सूचना
Comment[nb]=Varslinger som er utløst av maskinvareenheter
Comment[nds]=Vun Reedschappen utlööst Bescheden
Comment[nl]=Meldingen aangestuurd door hardware-apparaten
Comment[nn]=Varslingar frå maskinvareeiningar
Comment[pa]=ਹਾਰਡਵੇਅਰ ਜੰਤਰਾਂ ਵਲੋਂ ਭੇਜੇ ਨੋਟੀਫਿਕੇਸ਼ਨ
Comment[pl]=Powiadomienia wywołane urządzeniami sprzętowymi
Comment[pt]=Notificações despoletadas pelos dispositivos de 'hardware'
Comment[pt_BR]=Notificações acionadas pelos dispositivos de hardware
Comment[ro]=Notificări declanșate de dispozitive hardware
Comment[ru]=Уведомления, получаемые от устройств компьютера
Comment[si]=දෘඩාංය උපකරණය මගින් දැන්වීම් ඇරඹිනි
Comment[sk]=Upozornenia aktivované hardvérovými zariadeniami
Comment[sl]=Obvestila, ki jih sproži strojna oprema
Comment[sr]=Обавештења која стижу од хардверских уређаји
Comment[sr@ijekavian]=Обавјештења која стижу од хардверских уређаји
Comment[sr@ijekavianlatin]=Obavještenja koja stižu od hardverskih uređaji
Comment[sr@latin]=Obaveštenja koja stižu od hardverskih uređaji
Comment[sv]=Underrättelser utlösta av hårdvaruenheter
Comment[tg]=Огоҳиҳое, ки бо дастгоҳҳои сахтафзор қайд шудаанд
Comment[th]=การแจ้งให้ทราบของอุปกรณ์ฮาร์ดแวร์ใหม่
Comment[tr]=Aygıtlar tarafından tetiklenen bildirimler
Comment[ug]=ئۇقتۇرۇش تەرىپىدىن چېكىلگەن قاتتىق دېتال ئۈسكۈنىسى
Comment[uk]=Сповіщення щодо змін у переліку пристроїв
Comment[vi]=Các thông báo tạo ra vì các thiết bị phần cứng
Comment[wa]=Notifiaedjes eclitchîs pa les éndjins di l' éndjolreye
Comment[x-test]=xxNotifications triggered by hardware devicesxx
Comment[zh_CN]=硬件设备触发的通知
Comment[zh_TW]=硬體裝置觸發的通知
Contexts=devnotifier
Version=1
[Context/devnotifier]
Name=Device Notifier
Name[ar]=منبه الأجهزة
Name[ast]=Notificador de preséu
Name[be@latin]=Infarmavańnie pra novyja pryłady
Name[bg]=Уведомяване за нови устройства
Name[bn]=ডিভাইস নোটিফায়ার
Name[bn_IN]=ডিভাইসের সূচনা ব্যবস্থা
Name[bs]=izveštavač o uređajima
Name[ca]=Notificador de dispositius
Name[ca@valencia]=Notificador de dispositius
Name[cs]=Upozornění na zařízení
Name[csb]=Dôwôcz wiédzë ò ùrządzeniach
Name[da]=Enhedsbekendtgørelse
Name[de]=Geräteüberwachung
Name[el]=Ειδοποίηση νέας συσκευής
Name[en_GB]=Device Notifier
Name[eo]=Atentigilo pri aparatoj
Name[es]=Notificador de dispositivos
Name[et]=Seadmete teadustaja
Name[eu]=Gailu-jakinarazlea
Name[fa]=اخطار دهنده‌ی دستگاه
Name[fi]=Laiteilmoitin
Name[fr]=Notificateur de périphérique
Name[fy]=Apparaat meidieler
Name[ga]=Fógróir Gléis
Name[gl]=Notificador de dispositivos
Name[gu]=ઉપકરણ નોંધ કરનાર
Name[he]=מודיע על התקנים
Name[hi]=उपकरण सूचक
Name[hne]=उपकरन बतइया
Name[hr]=Glasnik uređaja
Name[hsb]=Zdźělenki wo gratach
Name[hu]=Eszközértesítő
Name[ia]=Notificator de dispositivo
Name[id]=Pemberitahu Divais
Name[is]=Tilkynningar um ný tæki
Name[it]=Notificatore dei dispositivi
Name[ja]=デバイスの通知
Name[kk]=Құрылғы құлақтандырғышы
Name[km]=កម្មវិធី​ជូនដំណឹង​ឧបករណ៍​
Name[kn]=ಹೊಸ ಸಾಧನ ಸೂಚಕ
Name[ko]=장치 알림이
Name[ku]=Hişyarkerê Cîhaz
Name[lt]=Pranešimai apie įrenginius
Name[lv]=Ierīču paziņotājs
Name[mk]=Известувач за уреди
Name[ml]=പുതിയ ഡിവൈസ് അറിയിക്കുന്നതിനുള്ള സംവിധാനം
Name[mr]=साधन निदर्शक
Name[nb]=Enhetsvarsler
Name[nds]=Bescheden över Reedschappen
Name[nl]=Apparaatmelder
Name[nn]=Einingsvarslar
Name[pa]=ਜੰਤਰ ਨੋਟੀਫਾਇਰ
Name[pl]=Powiadomienia o urządzeniach
Name[pt]=Notificação de Dispositivos
Name[pt_BR]=Notificação de dispositivos
Name[ro]=Notificare dispozitive
Name[ru]=Подключаемые устройства
Name[si]=උපාංග දැනුම් දීම
Name[sk]=Monitor zariadení
Name[sl]=Obvestila o napravah
Name[sr]=извештавач о уређајима
Name[sr@ijekavian]=извјештавач о уређајима
Name[sr@ijekavianlatin]=izvještavač o uređajima
Name[sr@latin]=izveštavač o uređajima
Name[sv]=Underrättelse om enheter
Name[ta]=கருவி நோட்டம்
Name[tg]=Огоҳкунандаи дастгоҳ
Name[th]=แจ้งให้ทราบถึงอุปกรณ์
Name[tr]=Aygıt Bildirici
Name[ug]=ئۈسكۈنە ئۇقتۇرۇشى
Name[uk]=Сповіщення про пристрої
Name[vi]=Trình thông báo thiết bị
Name[wa]=Notifiaedje d' éndjin
Name[x-test]=xxDevice Notifierxx
Name[zh_CN]=设备通知器
Name[zh_TW]=裝置通知
Comment=The Plasma device notifier is present
Comment[ar]=منبه بلازما للأجهزة حاضر
Comment[bg]=Наличен е уведомител за устройства за Plasma
Comment[bn]=প্লাসমা ডিভাইস নোটিফায়ার উপস্থিত
Comment[bs]=Plazma izveštavač o uređajima je prisutan
Comment[ca]=El notificador de dispositius del Plasma és present
Comment[ca@valencia]=El notificador de dispositius del Plasma és present
Comment[cs]=Oznamovač zařízení Plasmy je dostupný
Comment[da]=Plasma enhedsbekendtgørelse er til stede
Comment[de]=Die Plasma-Geräteüberwachung ist vorhanden
Comment[el]=Ο ειδοποιητής συσκευών είναι παρών
Comment[en_GB]=The Plasma device notifier is present
Comment[eo]=La atentigilo pri aparatoj de Plasmo ĉeestas
Comment[es]=El notificador Plasma de dispositivos está activado
Comment[et]=Plasma seadmete teadustaja on tegevuses
Comment[eu]=Plasma gailu-jakinarazlea aktibo dago
Comment[fa]=اخطاردهنده‌ی دستگاه پلاسما حاظر است
Comment[fi]=Plasman laiteilmoitin on näkyvissä
Comment[fr]=Le notificateur de périphérique est présent
Comment[ga]=Tá an fógróir gléis Plasma ann
Comment[gl]=O notificador de dispositivos de Plasma está presente
Comment[gu]=પ્લાઝમા ઉપકરણ નોંધકરનાર હાજર છે
Comment[he]=המודיע על ההתקנים של Plasma מוצג
Comment[hi]=प्लाज्मा युक्ति सूचक मौजूद है
Comment[hr]=Plasmin glasnik uređaja je prisutan
Comment[hu]=A Plazma eszközértesítő nincs jelen
Comment[ia]=Le notificator de dispositivo de Plasma es presente
Comment[id]=Pemberitahu divais Plasma ada
Comment[is]=Plasma tækjatilkynningagræjan er í gangi
Comment[it]=Il notificatore dei dispositivi di Plasma è presente
Comment[ja]=Plasma デバイス通知があります
Comment[kk]=Plasma құрылғы құлақтандырғышы бар
Comment[km]=មាន​​កម្មវិធី​​ជូនដំណឹង​ឧបករណ៍
Comment[kn]=ಪ್ಲಾಸ್ಮಾ ಸಾಧನ ಸೂಚಕವು ಇದೆ
Comment[ko]=Plasma 장치 알림이가 존재함
Comment[lt]=Yra Plasma įrenginių pranešėjas
Comment[lv]=Pasīvi iekārtu paziņotājs ir pieejams
Comment[mr]=प्लाज्मा साधन सूचक उपस्थित नाही
Comment[nb]=Plasma enhetsvarsler er tilstede
Comment[nds]=De Reedschap-Bescheden för Plasma sünd verföögbor.
Comment[nl]=De Plasma apparaatmelder is aanwezig
Comment[nn]=Plasma einingsvarslar er tilgjengeleg
Comment[pa]=ਪਲਾਜ਼ਮਾ ਜੰਤਰ ਨੋਟੀਫਾਇਰ ਮੌਜੂਦ ਹੈਪp
Comment[pl]=Powiadamianie o sprzęcie jest obecne
Comment[pt]=O sistema de notificações de dispositivos do Plasma está presente
Comment[pt_BR]=O sistema de notificações de dispositivos do Plasma está presente
Comment[ro]=Mecanismul de notificare dispozitive este prezent
Comment[ru]=Виджет Plasma «Подключаемые устройства» присутствует
Comment[si]=ප්ලාස්මා උපකරණ දැනවීම පවති
Comment[sk]=Monitor zariadení Plasmy je dostupný
Comment[sl]=Obvestila o napravah so prisotna
Comment[sr]=Плазма извештавач о уређајима је присутан
Comment[sr@ijekavian]=Плазма извјештавач о уређајима је присутан
Comment[sr@ijekavianlatin]=Plasma izvještavač o uređajima je prisutan
Comment[sr@latin]=Plasma izveštavač o uređajima je prisutan
Comment[sv]=Plasma enhetsunderrättelser är tillgänglig
Comment[tg]=Огоҳкунандаи дастгоҳи Plasma ҳозир аст
Comment[tr]=Plasma aygıt bildiricisi mevcut
Comment[ug]=پلازما ئۈسكۈنىسىنىڭ بىلدۈرگۈسى مەۋجۇت
Comment[uk]=Сповіщувач Плазми про пристрої увімкнено
Comment[vi]=Trình thông báo thiết bị Plasma hiện đang hoạt động
Comment[wa]=Li notifieu des éndjins di Plasma est la
Comment[x-test]=xxThe Plasma device notifier is presentxx
Comment[zh_CN]=显示 Plasma 设备通知
Comment[zh_TW]=Plasma 裝置通知器已可使用
Icon=highlight
[Event/mounterror]
Name=Mount or unmount error
Name[ar]=خطأ في الوصل أو الفصل
Name[ast]=Fallu al montar o desmontar
Name[bg]=Грешка при монтиране или демонтиране
Name[bn]=মাউন্ট বা আনমাউন্ট করাকালীন সমস্যা
Name[bs]=Greška u montiranju ili demontiranju
Name[ca]=Error en muntar o desmuntar
Name[ca@valencia]=Error en muntar o desmuntar
Name[cs]=Chyba při připojení nebo odpojení
Name[da]=Fejl ved montering eller afmontering
Name[de]=Fehler beim Einbinden oder Lösen
Name[el]=Σφάλμα προσάρτησης ή αποπροσάρτησης
Name[en_GB]=Mount or unmount error
Name[eo]=Eraro de muntado aŭ malmuntado
Name[es]=Error al montar o desmontar
Name[et]=Ühendamise või lahutamise viga
Name[eu]=Muntatze- edo desmuntatze-errorea
Name[fa]=خطای سوارکردن با پیاده‌کردن
Name[fi]=Liittämisvirhe
Name[fr]=Erreur de montage ou de démontage
Name[ga]=Earráid fheistithe/dífheistithe
Name[gl]=Erro ao montar ou desmontar
Name[gu]=માઉન્ટ અથવા અનમાઉન્ટ ક્ષતિ
Name[he]=שגיאת עיגון או הסרת עיגון
Name[hi]=माउन्ट या अनमाउन्ट त्रुटि
Name[hr]=Pogreška montiranja ili demontiranja
Name[hu]=Csatolási vagy leválasztási hiba
Name[ia]=Error de montar o dismontar
Name[id]=Galat kait atau lepas kait
Name[is]=Villa við tengingar/aftengingar í skráakerfi
Name[it]=Errore di montaggio o smontaggio
Name[ja]=マウントかアンマウントのエラー
Name[kk]=Тіркеу не одан шығару қатесі
Name[km]=កំហុស​ក្នុងការ​ម៉ោន ឬ​អាន់ម៉ោន
Name[kn]=ಆರೋಹಣ(ಮೌಂಟ್) ಅಥವಾ ಅವರೋಹಣ(ಅನ್ ಮೌಂಟ್) ದೋಷ
Name[ko]=마운트/마운트 해제 오류
Name[lt]=Montavimo arba išmontavimo klaida
Name[lv]=Montēšanas vai nomontēšanas kļūda
Name[ml]=മൌണ്ടു് ചെയ്യുമ്പോഴോ അണ്‍മൌണ്ട് ചെയ്യുമ്പോഴോ വരുന്ന തെറ്റുകള്‍
Name[mr]=जोडताना किंवा काढताना त्रुटी
Name[nb]=Monter- eller avmonter-feil
Name[nds]=Fehler bi't In- oder Afhangen
Name[nl]=Fout bij aan- of afkoppelen
Name[nn]=Feil ved montering eller avmontering
Name[pa]=ਮਾਊਂਟ ਜਾਂ ਅਣ-ਮਾਊਂਟ ਗਲਤੀ
Name[pl]=Błędy montowania i odmontowywania
Name[pt]=Erro de montagem ou desmontagem
Name[pt_BR]=Erro de montagem ou desmontagem
Name[ro]=Eroare de montare sau demontare
Name[ru]=Ошибка монтирования или размонтирования
Name[si]=සවි කිරීමේ හෝ ඉවත් කිරීමේ දෝෂය
Name[sk]=Chyba pri pripojení alebo odpojení
Name[sl]=Napaka med priklopom ali odklopom
Name[sr]=Грешка у монтирању или демонтирању
Name[sr@ijekavian]=Грешка у монтирању или демонтирању
Name[sr@ijekavianlatin]=Greška u montiranju ili demontiranju
Name[sr@latin]=Greška u montiranju ili demontiranju
Name[sv]=Monterings- eller avmonteringsfel
Name[tg]=Хатоҳои васлкунӣ ва ҷудокунӣ
Name[th]=ความผิดพลาดเกี่ยวกับการเมานท์
Name[tr]=Bağlama veya ayırma hatası
Name[ug]=ئېگەرلەش ياكى ئېگەرسىزلەش خاتالىقى
Name[uk]=Помилка монтування або демонтування
Name[vi]=Lỗi gắn hoặc bỏ gắn
Name[wa]=Aroke di montaedje ou d' dismontaedje
Name[x-test]=xxMount or unmount errorxx
Name[zh_CN]=挂载或卸载错误
Name[zh_TW]=掛載或卸載時發生錯誤
Comment=There has been a problem mounting or unmounting a device
Comment[ar]=حصلت مشكلة أثناء وصل أو فصل جهاز
Comment[ast]=Hebo un fallu al montar o desmontar un preséu
Comment[bg]=Възникна грешка при монтиране или демонтиране на устройство
Comment[bn]=একটি ডিভাইস মাউন্ট বা আনমাউন্ট করতে সমস্যা দেখা দিয়েছে
Comment[bs]=Problem pri montiranju ili demontiranju uređaja
Comment[ca]=S'ha produït un problema en muntar o desmuntar un dispositiu
Comment[ca@valencia]=Hi ha hagut un problema en muntar o desmuntar un dispositiu
Comment[cs]=Při připojování nebo odpojování zařízení došlo k chybě
Comment[da]=Der opstod et problem ved montering eller afmontering af en enhed
Comment[de]=Beim Einbinden oder Lösen eines Gerätes ist ein Problem aufgetreten
Comment[el]=Υπήρξε ένα πρόβλημα προσάρτησης ή αποπροσάρτησης μίας συσκευής
Comment[en_GB]=There has been a problem mounting or unmounting a device
Comment[eo]=Eraro okazis dum muntado aŭ malmuntado de aparato
Comment[es]=Ha ocurrido un error al montar o desmontar un dispositivo
Comment[et]=Seadme ühendamisel või lahutamisel tekkis probleem
Comment[eu]=Errorea gertatu da gailu bat muntatzean edo desmuntatzean
Comment[fa]=مشکلی در سوار یا پیاده کردن دستگاهی هست
Comment[fi]=Laitteen liittämisessä tai liitoksen poistamisessa oli ongelma.
Comment[fr]=Il y a eu un problème lors du montage ou du démontage d'un périphérique
Comment[ga]=Bhí fadhb ann agus gléas á fheistiú nó á dhífheistiú
Comment[gl]=Aconteceu un problema ao montar ou desmontar un dispositivo
Comment[gu]=ઉપકરણને માઉન્ટ અથવા અનમાઉન્ટ કરવામાં મુશ્કેલી છે
Comment[he]=ארעה שגיאה בניסיון לעגן או להסיר עיגון של התקן
Comment[hi]=युक्ति को माउन्ट या या अनमाउंट करने में एक समस्या है
Comment[hr]=Dogodio se problem s montiranjem ili demontiranjem uređaja
Comment[hu]=Hiba történt egy eszköz csatolásakor vagy leválasztásakor
Comment[ia]=Il habeva un problema durante que il montava o dismontava un dispositivo
Comment[id]=Terjadi masalah ketika mengaitkan atau melepaskan divais
Comment[is]=Það hefur komið upp vandamál við tengingu eða aftengingu tækis í skráakerfi
Comment[it]=C'è stato un problema nel montare o smontare un dispositivo
Comment[ja]=デバイスをマウントかアンマウントするのに問題がありました
Comment[kk]=Құрылғыны тіркеу не одан шығару қатесі пайда болды
Comment[km]=មាន​បញ្ហា​ខណៈពេល​ម៉ោន​ ឬ​អាន់ម៉ោន​ឧបករណ៍
Comment[kn]=ಒಂದು ಸಾಧನವನ್ನು ಮೌಂಟ್ ಅಥವಾ ಅನ್ ಮೌಂಟ್ ಮಾಡುವಲ್ಲಿ ತೊಂದರೆ ಉಂಟಾಗಿದೆ
Comment[ko]=장치를 마운트하거나 마운트 해제하는 데 문제가 발생하였습니다
Comment[lt]=Montuojant arba išmontuojant įrenginį įvyko klaida
Comment[lv]=Ir gadījusies kļūme, veicot iekārtas piemontēšanu/nomontēšanu
Comment[ml]=മൌണ്ടു് ചെയ്യുമ്പോഴോ അണ്‍മൌണ്ട് ചെയ്യുമ്പോഴോ ഒരു പ്രശ്നമുണ്ടായി
Comment[mr]=एक साधन जोडताना किंवा काढताना समस्या निर्माण झालेली आहे
Comment[nb]=Det har oppstått et problem ved montering eller avmontering av en enhet
Comment[nds]=Dat geev en Problem bi't In- oder Afhangen vun en Reedschap.
Comment[nl]=Er is een probleem geweest met het aan- of afkoppelen van een apparaat
Comment[nn]=Det har oppstått eit problem med montering eller avmontering av ei eining
Comment[pa]=ਜੰਤਰ ਮਾਊਂਟ ਜਾਂ ਅਣ-ਮਾਊਂਟ ਕਰਨ ਦੌਰਾਨ ਸਮੱਸਿਆ ਆਈ ਹੈ
Comment[pl]=Wystąpił problem podczas montowania lub odmontowywania urządzenia
Comment[pt]=Ocorreu um problema ao montar ou desmontar um dispositivo
Comment[pt_BR]=Ocorreu um problema ao montar ou desmontar um dispositivo
Comment[ro]=A intervenit o problemă la montarea sau demontarea unui dispozitiv
Comment[ru]=При монтировании или размонтировании устройства произошла ошибка
Comment[si]=මෙවලමක් සවි කිරීමේදී හෝ ඉවත් කිරීමේදී ගැටළුවක් සිදු වී ඇත
Comment[sk]=Pri pripájaní alebo odpájaní zariadenia nastala chyba
Comment[sl]=Prišlo je do težave med priklapljanjem ali odklapljanjem naprave
Comment[sr]=Проблем при монтирању или демонтирању уређаја
Comment[sr@ijekavian]=Проблем при монтирању или демонтирању уређаја
Comment[sr@ijekavianlatin]=Problem pri montiranju ili demontiranju uređaja
Comment[sr@latin]=Problem pri montiranju ili demontiranju uređaja
Comment[sv]=Ett problem har uppstått vid montering eller avmontering av en enhet
Comment[tg]=Ҳангоми васлкунӣ ё ҷудокунии дастгоҳ мушкилӣ пайдо шуд
Comment[th]=มีปัญหาระหว่างการเมานท์อุปกรณ์
Comment[tr]=Bir aygıtı bağlama veya ayırma sırasında bir sorun oluştu
Comment[ug]=ئۈسكۈنىنى ئېگەرلەش ياكى ئېگەرسىزلەشتە مەسىلە كۆرۈلدى
Comment[uk]=Під час спроби монтування або демонтування пристрою сталася помилка
Comment[vi]=Có lỗi khi gắn hoặc bỏ gắn một thiết bị
Comment[wa]=Åk n' a nén stî come dji montéve ou dismontéve èn éndjin
Comment[x-test]=xxThere has been a problem mounting or unmounting a devicexx
Comment[zh_CN]=挂载或卸载设备时出现问题
Comment[zh_TW]=掛載或卸載裝置時發生錯誤
Action=Popup
Contexts=devnotifier
[Event/mounterror/devnotifier/present]
Action=-Popup
[Event/safetoremove]
Name=The device can be safely removed
Name[ar]=يمكنك إزالة الجهاز بأمان
Name[bg]=Устройството вече може да се откачи
Name[bn]=ডিভাইস-টি নির্বিঘ্নে সরানো যেতে পারে
Name[bs]=Uređaj se može bezbedno ukloniti
Name[ca]=El dispositiu es pot extreure amb seguretat
Name[ca@valencia]=El dispositiu es pot extraure amb seguretat
Name[cs]=Zařízení může být bezpečně odebráno
Name[da]=Det er sikkert at fjerne enheden
Name[de]=Das Gerät kann sicher entfernt werden.
Name[el]=Η συσκευή μπορεί να αφαιρεθεί με ασφάλεια
Name[en_GB]=The device can be safely removed
Name[eo]=La aparato nun estas sekure demetebla.
Name[es]=El dispositivo se puede extraer con seguridad
Name[et]=Seadme võib turvaliselt eemaldada
Name[eu]=Gailua arriskurik gabe ken daiteke
Name[fa]=دستگاه میتواند با اطمینان جدا شود
Name[fi]=Laite voidaan poistaa turvallisesti
Name[fr]=Le périphérique peut être retiré en toute sécurité
Name[ga]=Is féidir an gléas a bhaint gan dochar a dhéanamh
Name[gl]=O dispositivo pode quitarse con seguranza
Name[gu]=ઉપકરણ સલામત રીતે કાઢી શકાય છે
Name[he]=ניתן להסיר בבטחה את ההתקן
Name[hi]=उपकरण को सुरक्षित निकाला जा सकता है
Name[hr]=Sigurno je ukloniti uređaj
Name[hu]=Az eszköz biztonságosan eltávolítható
Name[ia]=Le dispositivo pote esser removite con securitate
Name[id]=Divais dapat dilepaskan dengan aman
Name[is]=Hægt er að fjarlægja tækið á öruggan hátt
Name[it]=Si può ora rimuovere il dispositivo
Name[ja]=デバイスを安全に取り除くことができます
Name[kk]=Құрылғыны қауіпсіз алып шығаруға болады
Name[km]=ឧបករណ៍​អាច​ត្រូវ​បាន​យកចេញ​ដោយ​សុវត្ថិភាព
Name[kn]=ಸಾಧನವು ಈಗ ತೆಗೆಯಲು ಸುರಕ್ಷಿತವಾಗಿದೆ
Name[ko]=장치를 안전하게 제거할 수 있음
Name[lt]=Galite saugiai išimti įrenginį
Name[lv]=Ierīce var tikt droši noņemta
Name[mr]=हे साधन सुरक्षितपणे काढू शकता
Name[nb]=Enheten kan trygt fjernes
Name[nds]=De Reedschap lett sik seker afkoppeln.
Name[nl]=Het apparaat kan veilig worden verwijderd
Name[nn]=Eininga kan trygt fjernast
Name[pa]=ਜੰਤਰ ਹੁਣ ਹਟਾਉਣਾ ਸੁਰੱਖਿਅਤ ਹੈ
Name[pl]=Można bezpiecznie usunąć urządzenie
Name[pt]=O dispositivo pode ser retirado com sucesso
Name[pt_BR]=Este dispositivo pode ser removido com segurança
Name[ro]=Dispozitivul poate fi eliminat în siguranță
Name[ru]=Устройство может быть безопасно отсоединено от компьютера
Name[si]=උපකරණය ආරක්‍ෂිතව ඉවත්කල හැක
Name[sk]=Zariadenie je možné bezpečne odstrániť
Name[sl]=Napravo je varno odstraniti
Name[sr]=Уређај се може безбедно уклонити
Name[sr@ijekavian]=Уређај се може безбједно уклонити
Name[sr@ijekavianlatin]=Uređaj se može bezbjedno ukloniti
Name[sr@latin]=Uređaj se može bezbedno ukloniti
Name[sv]=Enheten kan urkopplas säkert
Name[tg]=Шумо метавонед дастгоҳро бехатар ҷудо кунед
Name[th]=สามารถถอดอุปกรณ์ได้อย่างปลอดภัย
Name[tr]=Aygıt güvenli bir şekilde kaldırılabilir
Name[ug]=ئۈسكۈنىنى ھازىر بىخەتەر چىقىرىشقا بولىدۇ
Name[uk]=Пристрій можна безпечно від’єднувати
Name[vi]=Thiết bị có thể được gỡ bỏ an toàn
Name[wa]=Vos savoz oister l' éndjin al coete
Name[x-test]=xxThe device can be safely removedxx
Name[zh_CN]=可以安全的移除设备了
Name[zh_TW]=裝置已可安全移除
Comment=The device which has been just unmounted is now safe to remove.
Comment[ar]=الجهاز الذي تم فصله حال، يمكنك إزالته بأمان.
Comment[bg]=Устройството, което беше демонтирано, вече може безопасно да се откачи.
Comment[bn]=যে ডিভাইস-টি এইমাত্র আনমাউন্ট করা হয়েছে সেটি নির্বিঘ্নে সরিয়ে নেওয়া যেতে পারে।
Comment[bs]=Upravo demontirani uređaj može se sada bezbedno ukloniti.
Comment[ca]=Ara es pot extreure amb seguretat el dispositiu que s'acaba de desmuntar.
Comment[ca@valencia]=Ara es pot extraure amb seguretat el dispositiu que s'acaba de desmuntar.
Comment[cs]=Zařízení, které bylo právě odpojeno může být bezpečně odebráno.
Comment[da]=Enheden som netop er blevet afmonteret kan nu fjernes sikkert.
Comment[de]=Das eben ausgehängte Gerät kann nun sicher entfernt werden.
Comment[el]=Η συσκευή που μόλις αποπροσαρτήθηκε μπορεί τώρα να αφαιρεθεί με ασφάλεια.
Comment[en_GB]=The device which has been just unmounted is now safe to remove.
Comment[eo]=La aparato, kiu estis nur malmuntita, nun estas sekure demetebla.
Comment[es]=Ahora es segura la extracción del dispositivo que se acaba de desmontar.
Comment[et]=Äsja lahutatud seadme saab nüüd turvaliselt eemaldada
Comment[eu]=Oraintxe desmuntatu den gailua arriskurik gabe ken daiteke.
Comment[fa]=دستگاهی که پیاده شده‌بود حالا میشود با اطمینان جدا شود.
Comment[fi]=Juuri irrotettu laite on nyt turvallista poistaa.
Comment[fr]=Le périphérique qui vient d'être libéré peut maintenant être débranché en toute sécurité.
Comment[ga]=Is féidir an gléas atá tú tar éis a dífheistiú a bhaint gan dochar a dhéanamh.
Comment[gl]=O dispositivo que acaba de desmontarse pode quitarse sen problemas.
Comment[gu]=ઉપકરણ જે હમણાં અનમાઉન્ટ કરવામાં આવ્યું તે બહાર નીકાળવા માટે સલામત છે.
Comment[he]=ההתקן שהעגינה שלו בדיוק הוסרה ניתן עכשיו להסרה בבטחה.
Comment[hi]=युक्ति जो अभी अनमाउंट किया गया है को ब निकालना सुरक्षित है.
Comment[hr]=Uređaj koji ste upravo demontirali možete sigurno ukloniti.
Comment[hu]=A leválasztott eszköz biztonságosan eltávolítható.
Comment[ia]=Le dispositivo que ha essite ora removite es ora secur de remover se.
Comment[id]=Divais yang baru saja dilepas kait telah aman untuk dilepaskan.
Comment[is]=Tækið sem var verið að aftengja má nú fjarlægja á öruggan hátt.
Comment[it]=Si può ora rimuovere il dispositivo appena smontato.
Comment[kk]=Құрылғы тіркеуден шығарылды, енді оны алып шығару қауіпсіз.
Comment[km]=ឧបករណ៍​ដែល​ទើប​តែ​អាន់​ម៉ោន​ ឥឡូវ​នេះ​​អាច​ដក​បាន​ដោយ​សុវត្ថិភាពហើយ ។
Comment[kn]=ಈಗತಾನೆ ಅವರೋಹಿಸಲಾದ ಸಾಧನವು ಈಗ ತೆಗೆಯಲು ಸುರಕ್ಷಿತವಾಗಿದೆ.
Comment[ko]=마운트 해제한 장치를 안전하게 제거할 수 있습니다.
Comment[lt]=Ką tik atjungtą įrenginį dabar galima saugiau išimti.
Comment[lv]=Ierīci, kura tikko tika nomontēta, droši var noņemt.
Comment[mr]=ज्या साधनाला जोडमुक्त केलेले आहे ते साधन काढण्याकरिता सुरक्षित आहे.
Comment[nb]=Enheten som nettopp er avmontert kan nå trygt fjernes.
Comment[nds]=De jüst afhangt Reedschap lett sik seker afkoppeln.
Comment[nl]=Het apparaat is zojuist afgekoppeld en is nu veilig te verwijderen.
Comment[nn]=Eininga du nett avmonterte kan no trygt fjernast.
Comment[pa]=ਜੰਤਰ, ਜੋ ਕਿ ਹੁਣੇ ਅਣ-ਮਾਊਂਟ ਕੀਤਾ ਗਿਆ ਹੈ, ਹੁਣ ਹਟਾਉਣ ਲਈ ਸੁਰੱਖਿਅਤ ਹੈ।
Comment[pl]=Można teraz bezpiecznie usunąć odmontowane urządzenie.
Comment[pt]=O dispositivo que foi desmontado pode agora ser retirado em segurança.
Comment[pt_BR]=O dispositivo que foi desmontado pode agora ser removido com segurança.
Comment[ro]=Dispozitivul proaspăt demontat poate fi eliminat în siguranță.
Comment[ru]=Устройство, которое только что было отключено, теперь может быть отсоединено от компьютера без риска потери информации.
Comment[si]=දැන් විසන්ධි කල උපකරණය ඉවත්කිරීම ආරක්‍ෂිතයි.
Comment[sk]=Zariadenie, ktoré bolo práve odpojené, je možné teraz bezpečne odstrániť.
Comment[sl]=Napravo, ki je bila odklopljena, je sedaj varno odstraniti.
Comment[sr]=Управо демонтирани уређај може се сада безбедно уклонити.
Comment[sr@ijekavian]=Управо демонтирани уређај може се сада безбједно уклонити.
Comment[sr@ijekavianlatin]=Upravo demontirani uređaj može se sada bezbjedno ukloniti.
Comment[sr@latin]=Upravo demontirani uređaj može se sada bezbedno ukloniti.
Comment[sv]=Enheten som precis har avmonterats kan nu urkopplas säkert.
Comment[tg]=Гирифтани дастгоҳе, ки шумо навакак ҷудо кардед бехатар аст.
Comment[th]=อุปกรณ์ที่เพิ่งยกเลิกการเมานท์สามารถถอดออกได้อย่างปลอดภัย
Comment[tr]=Çıkarılan aygıt güvenli bir şekilde kaldırılabilir
Comment[ug]=ھازىر ئېگەرسىزلىگەن ئۈسكۈنىنى بىخەتەر چىقىرىشقا بولىدۇ
Comment[uk]=Пристрій, який щойно було демонтовано можна безпечно від’єднувати.
Comment[vi]=Thiết bị vừa mới được bỏ gắn giờ có thể được gỡ an toàn.
Comment[wa]=L' éndjin ki vént djusse d' esse dismonté sait esse asteure oisté al coete.
Comment[x-test]=xxThe device which has been just unmounted is now safe to remove.xx
Comment[zh_CN]=已经卸载了设备,可以安全移除了。
Comment[zh_TW]=剛剛卸載的裝置已可安全移除。
Action=Popup
Contexts=devnotifier
[Event/safetoremove/devnotifier/present]
Action=-Popup

View file

@ -1,104 +0,0 @@
/*
Copyright (C) 2009 Canonical
Author: Aurélien Gâteau <aurelien.gateau@canonical.com>
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 2 or 3 of the License.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "imageconverter.h"
#include <QDBusArgument>
#include <QDBusMetaType>
#include <QImage>
namespace ImageConverter
{
/**
* A structure representing an image which can be marshalled to fit the
* notification spec.
*/
struct SpecImage
{
int width, height, rowStride;
bool hasAlpha;
int bitsPerSample, channels;
QByteArray data;
};
QDBusArgument &operator<<(QDBusArgument &argument, const SpecImage &image)
{
argument.beginStructure();
argument << image.width << image.height << image.rowStride << image.hasAlpha;
argument << image.bitsPerSample << image.channels << image.data;
argument.endStructure();
return argument;
}
const QDBusArgument &operator>>(const QDBusArgument &argument, SpecImage &image)
{
argument.beginStructure();
argument >> image.width >> image.height >> image.rowStride >> image.hasAlpha;
argument >> image.bitsPerSample >> image.channels >> image.data;
argument.endStructure();
return argument;
}
} // namespace
// This must be before the QVariant::fromValue below (#211726)
Q_DECLARE_METATYPE(ImageConverter::SpecImage)
namespace ImageConverter
{
QVariant variantForImage(const QImage &_image)
{
qDBusRegisterMetaType<SpecImage>();
const QImage image = _image.convertToFormat(QImage::Format_ARGB32);
int rowStride = image.width() * 4;
// Notification spec stores pixels in R,G,B,A order, regardless of
// endianess
// Qt represents pixels as 32 bit unsigned int. So the order depend on
// endianess:
// - In big endian the order is A,R,G,B
// - In little endian the order is B,G,R,A
QByteArray data(rowStride * image.height(), 0);
char* dst = data.data();
for (int y=0; y<image.height(); ++y) {
const QRgb* src = (const QRgb*)image.constScanLine(y);
const QRgb* end = src + image.width();
for (;src != end; ++src) {
// Probably slow, but free of endianess issues
*dst++ = qRed(*src);
*dst++ = qGreen(*src);
*dst++ = qBlue(*src);
*dst++ = qAlpha(*src);
}
}
SpecImage specImage;
specImage.width = image.width();
specImage.height = image.height();
specImage.rowStride = rowStride;
specImage.hasAlpha = true;
specImage.bitsPerSample = 8;
specImage.channels = 4;
specImage.data = data;
return QVariant::fromValue(specImage);
}
} // namespace

View file

@ -1,34 +0,0 @@
/*
Copyright (C) 2009 Canonical
Author: Aurélien Gâteau <aurelien.gateau@canonical.com>
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 2 or 3 of the License.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef IMAGECONVERTER_H
#define IMAGECONVERTER_H
#include <QVariant>
#include <QImage>
namespace ImageConverter
{
/**
* Returns a variant representing an image using the format describe in the
* galago spec
*/
QVariant variantForImage(const QImage &image);
} // namespace
#endif /* IMAGECONVERTER_H */

View file

@ -1,4 +1,4 @@
[Global]
[kde]
IconName=kde
Comment=KDE Workspace
Comment[ar]=مساحة عمل كدي
@ -70,7 +70,7 @@ Comment[x-test]=xxKDE Workspacexx
Comment[zh_CN]=KDE 工作空间
Comment[zh_TW]=KDE 工作空間
[Event/Trash: emptied]
[kde/TrashEmptied]
Name=Trash: Emptied
Name[af]=Gemors: skoongemaak
Name[ar]=سلة المهملات: مفرغة
@ -236,10 +236,10 @@ Comment[wa]=Li batch a stî vudî
Comment[x-test]=xxThe trash has been emptiedxx
Comment[zh_CN]=回收站已经被清空
Comment[zh_TW]=資源回收筒已被清空
Action=Sound
Actions=Sound
Sound=KDE-Sys-Trash-Emptied.ogg
[Event/Textcompletion: rotation]
[kde/TextcompletionRotation]
Name=Textcompletion: Rotation
Name[af]=Teksvoltooiing: rotasie
Name[ar]=تتمة النصوص: دوران
@ -402,10 +402,10 @@ Comment[wa]=Dj' a arivé al difén del djivêye des mots ki pôrént aler.
Comment[x-test]=xxThe end of the list of matches has been reachedxx
Comment[zh_CN]=已经到达匹配列表的末尾
Comment[zh_TW]=到達符合清單的尾端
Action=
Actions=
Sound=KDE-Sys-List-End.ogg
[Event/Textcompletion: no match]
[kde/TextcompletionNoMatch]
Name=Textcompletion: No Match
Name[af]=Teksvoltooiing: pas by geen een
Name[ar]=تتمة النصوص: لا تطابق
@ -569,10 +569,10 @@ Comment[wa]=Pont d' completaedje ki va n' a stî trové
Comment[x-test]=xxNo matching completion was foundxx
Comment[zh_CN]=没有发现匹配的补全
Comment[zh_TW]=找不到符合的補完清單
Action=
Actions=
Sound=KDE-Sys-List-Match-No.ogg
[Event/Textcompletion: partial match]
[kde/TextcompletionPartialMatch]
Name=Textcompletion: Partial Match
Name[af]=Teksvoltooiing: gedeeltelike passing
Name[ar]=تتمة النصوص: تطابق جزئي
@ -736,10 +736,10 @@ Comment[wa]=I gn a pus k' on seu mot ki pôrént aler
Comment[x-test]=xxThere is more than one possible matchxx
Comment[zh_CN]=有超过一个可能的匹配
Comment[zh_TW]=有一個以上符合
Action=
Actions=
Sound=KDE-Sys-List-Match-Multiple.ogg
[Event/fatalerror]
[kde/fatalerror]
Name=Fatal Error
Name[af]=Fatale fout
Name[ar]=خطأ فادح
@ -909,11 +909,11 @@ Comment[wa]=Åk n' a vormint nén stî k' il a falou kel programe mousse foû.
Comment[x-test]=xxThere was a serious error causing the program to exitxx
Comment[zh_CN]=有一个严重错误导致程序退出
Comment[zh_TW]=程式發生了嚴重錯誤,必須離開
Action=Popup|Sound
Actions=Popup,Sound
Sound=KDE-Sys-App-Error-Serious.ogg
[Event/notification]
[kde/notification]
Name=Notification
Name[af]=Stelselboodskap
Name[ar]=تنبيه
@ -1083,10 +1083,10 @@ Comment[wa]=Ene sacwè di speciåle s' a passé dins l' programe
Comment[x-test]=xxSomething special happened in the programxx
Comment[zh_CN]=这个程序中发生了特殊的事情
Comment[zh_TW]=程式中發生了特殊事件
Action=Sound|Popup
Actions=Sound,Popup
Sound=KDE-Sys-Special.ogg
[Event/warning]
[kde/warning]
Name=Warning
Name[af]=Waarskuwing
Name[ar]=إنذار
@ -1257,10 +1257,10 @@ Comment[wa]=Åk n' a nén stî e programe ki pôreut fé des rujhes
Comment[x-test]=xxThere was an error in the program which may cause problemsxx
Comment[zh_CN]=程序中有一个错误,它可能导致一些问题
Comment[zh_TW]=程式中發生錯誤,可能造成問題
Action=Popup|Sound
Actions=Popup,Sound
Sound=KDE-Sys-App-Error.ogg
[Event/catastrophe]
[kde/catastrophe]
Name=Catastrophe
Name[af]=Katastrofe
Name[ar]=كارثة
@ -1425,11 +1425,11 @@ Comment[wa]=Åk di vormint laid s' a passé. Ça a pol moens fwait kel programe
Comment[x-test]=xxA very serious error occurred, at least causing the program to exitxx
Comment[zh_CN]=发生了一个非常严重的错误,至少已经导致了这个程序退出
Comment[zh_TW]=發生了非常嚴重的問題,至少造成程式被迫結束
Action=Popup|Sound
Actions=Popup,Sound
Sound=KDE-Sys-App-Error-Serious.ogg
[Event/startkde]
[kde/startkde]
Name=Login
Name[af]=Aanteken
Name[ar]=ولوج
@ -1567,10 +1567,10 @@ Comment[wa]=Ene novele session s' enonde
Comment[x-test]=xxA new session is startingxx
Comment[zh_CN]=正在开启一个新会话
Comment[zh_TW]=新的工作階段啟動中
Action=
Actions=
Sound=KDE-Sys-Log-In-Short.ogg
[Event/exitkde]
[kde/exitkde]
Name=Logout
Name[af]=Afteken
Name[ar]=أخرج
@ -1709,10 +1709,10 @@ Comment[wa]=Li session mousse foû
Comment[x-test]=xxSession is exitingxx
Comment[zh_CN]=会话正在退出
Comment[zh_TW]=工作階段結束中
Action=
Actions=
Sound=KDE-Sys-Log-Out.ogg
[Event/cancellogout]
[kde/cancellogout]
Name=Logout Canceled
Name[af]=Afteken is gekanselleer
Name[ar]=تم إلغاء الخروج
@ -1881,9 +1881,9 @@ Comment[wa]=Li dislodjaedje di KDE a stî rinoncî
Comment[x-test]=xxKDE logout was canceledxx
Comment[zh_CN]=KDE 注销被取消了
Comment[zh_TW]=登出的動作已被取消
Action=Popup
Actions=Popup
[Event/printerror]
[kde/printerror]
Name=Print Error
Name[af]=Drukkerfout
Name[ar]=خطأ طباعة
@ -2053,10 +2053,10 @@ Comment[wa]=Ene aroke d' imprimaedje s' a passé
Comment[x-test]=xxA print error has occurredxx
Comment[zh_CN]=发生了一个打印错误
Comment[zh_TW]=發生了列印錯誤
Action=Popup|Sound
Actions=Popup,Sound
Sound=KDE-Sys-Error-Printing.ogg
[Event/messageInformation]
[kde/messageInformation]
Name=Information Message
Name[af]=Informasieboodskap
Name[ar]=رسالة معلومات
@ -2227,9 +2227,9 @@ Comment[x-test]=xxAn information message is being shownxx
Comment[zh_CN]=正在显示一条信息消息
Comment[zh_TW]=將顯示資訊訊息
Sound=KDE-Sys-App-Message.ogg
Action=Sound|Taskbar
Actions=Sound,Taskbar
[Event/messageWarning]
[kde/messageWarning]
Name=Warning Message
Name[af]=Waarskuwing
Name[ar]=رسالة تحذير
@ -2400,9 +2400,9 @@ Comment[x-test]=xxA warning message is being shownxx
Comment[zh_CN]=正在显示一条警告消息
Comment[zh_TW]=將顯示警告訊息
Sound=KDE-Sys-Warning.ogg
Action=Sound|Taskbar
Actions=Sound,Taskbar
[Event/messageCritical]
[kde/messageCritical]
Name=Critical Message
Name[af]=Kritieke boodskap
Name[ar]=رسالة خطر
@ -2568,9 +2568,9 @@ Comment[x-test]=xxA critical message is being shownxx
Comment[zh_CN]=正在显示一条重要消息
Comment[zh_TW]=將顯示嚴重訊息
Sound=KDE-Sys-App-Error-Critical.ogg
Action=Sound|Taskbar
Actions=Sound,Taskbar
[Event/messageboxQuestion]
[kde/messageboxQuestion]
Name=Question
Name[af]=Vraag
Name[ar]=سؤال
@ -2744,10 +2744,9 @@ Comment[x-test]=xxA question is being askedxx
Comment[zh_CN]=正在询问一个问题
Comment[zh_TW]=將詢問使用者問題
Sound=KDE-Sys-Question.ogg
Action=Sound|Taskbar
Actions=Sound,Taskbar
[Event/beep]
[kde/beep]
Name=Beep
Name[af]=Biep
Name[ar]=صافرة
@ -2918,5 +2917,5 @@ Comment[wa]=Son d' cloke
Comment[x-test]=xxSound bellxx
Comment[zh_CN]=响铃
Comment[zh_TW]=音效鈴聲
Action=Sound
Actions=Sound
Sound=KDE-Sys-App-Message.ogg

View file

@ -1,294 +0,0 @@
/*
Copyright (C) 2005-2009 by Olivier Goffart <ogoffart at kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "knotify.h"
#include <QDBusConnection>
// KDE headers
#include <kapplication.h>
#include <kconfig.h>
#include <kdebug.h>
#include <kglobal.h>
#include <klocale.h>
#include <config-workspace.h>
#include "knotifyconfig.h"
#include "ksolidnotify.h"
#include "notifybysound.h"
#include "notifybypopup.h"
#include "notifybyexecute.h"
#include "notifybylogfile.h"
#include "notifybytaskbar.h"
KNotify::KNotify( QObject *parent )
: QObject( parent ),
m_counter(0)
{
loadConfig();
(void)new KNotifyAdaptor(this);
(void)new KSolidNotify(this);
QDBusConnection::sessionBus().registerService("org.kde.knotify");
QDBusConnection::sessionBus().registerObject("/Notify", this, QDBusConnection::ExportAdaptors
/*| QDBusConnection::ExportScriptableSlots | QDBusConnection::ExportScriptableSignals*/ );
}
KNotify::~KNotify()
{
qDeleteAll(m_notifications);
}
void KNotify::loadConfig()
{
qDeleteAll(m_plugins);
m_plugins.clear();
addPlugin(new NotifyBySound(this));
addPlugin(new NotifyByPopup(this));
addPlugin(new NotifyByExecute(this));
addPlugin(new NotifyByLogfile(this));
addPlugin(new NotifyByTaskbar(this));
}
void KNotify::addPlugin( KNotifyPlugin * p )
{
m_plugins[p->optionName()]=p;
connect(p,SIGNAL(finished( int )) , this , SLOT(slotPluginFinished( int ) ));
connect(p,SIGNAL(actionInvoked( int , int )) , this , SIGNAL(notificationActivated( int , int ) ));
}
void KNotify::reconfigure()
{
KGlobal::config()->reparseConfiguration();
KNotifyConfig::reparseConfiguration();
loadConfig();
}
void KNotify::closeNotification(int id)
{
if(!m_notifications.contains(id))
return;
Event *e=m_notifications[id];
kDebug() << e->id << " ref=" << e->ref;
//this has to be called before plugin->close or we will get double deletion because of slotPluginFinished
m_notifications.remove(id);
if(e->ref>0)
{
e->ref++;
foreach(KNotifyPlugin *plugin , m_plugins)
{
plugin->close( id );
}
}
notificationClosed(id);
delete e;
}
int KNotify::event( const QString & event, const QString & appname, const ContextList & contexts, const QString & title, const QString & text, const KNotifyImage & image, const QStringList & actions, int timeout, WId winId )
{
m_counter++;
Event *e=new Event(appname , contexts , event );
e->id = m_counter;
e->ref = 1;
e->config.title=title;
e->config.text=text;
e->config.actions=actions;
e->config.image=image;
e->config.timeout=timeout;
e->config.winId=(WId)winId;
m_notifications.insert(m_counter,e);
emitEvent(e);
e->ref--;
kDebug() << e->id << " ref=" << e->ref;
if(e->ref==0)
{
m_notifications.remove(e->id);
delete e;
return 0;
}
return m_counter;
}
void KNotify::update(int id, const QString &title, const QString &text, const KNotifyImage& image, const QStringList& actions)
{
if(!m_notifications.contains(id))
return;
Event *e=m_notifications[id];
e->config.title=title;
e->config.text=text;
e->config.image = image;
e->config.actions = actions;
foreach(KNotifyPlugin *p, m_plugins)
{
p->update(id, &e->config);
}
}
void KNotify::reemit(int id, const ContextList& contexts)
{
if(!m_notifications.contains(id))
return;
Event *e=m_notifications[id];
e->config.contexts=contexts;
emitEvent(e);
}
void KNotify::emitEvent(Event *e)
{
QString presentstring=e->config.readEntry("Action");
QStringList presents=presentstring.split ('|');
if (!e->config.contexts.isEmpty() && !presents.first().isEmpty())
{
//Check whether the present actions are absolute, relative or invalid
bool relative = presents.first().startsWith('+') || presents.first().startsWith('-');
bool valid = true;
foreach (const QString & presentAction, presents)
valid &= ((presentAction.startsWith('+') || presentAction.startsWith('-')) == relative);
if (!valid)
{
kDebug() << "Context " << e->config.contexts << "present actions are invalid! Fallback to default present actions";
Event defaultEvent = Event(e->config.appname, ContextList(), e->config.eventid);
QString defaultPresentstring=defaultEvent.config.readEntry("Action");
presents = defaultPresentstring.split ('|');
} else if (relative)
{
// Obtain the list of present actions without context
Event noContextEvent = Event(e->config.appname, ContextList(), e->config.eventid);
QString noContextPresentstring = noContextEvent.config.readEntry("Action");
QSet<QString> noContextPresents = noContextPresentstring.split ('|').toSet();
foreach (const QString & presentAction, presents)
{
if (presentAction.startsWith('+'))
noContextPresents << presentAction.mid(1);
else
noContextPresents.remove(presentAction.mid(1));
}
presents = noContextPresents.toList();
}
}
foreach(const QString & action , presents)
{
if(!m_plugins.contains(action))
continue;
KNotifyPlugin *p=m_plugins[action];
e->ref++;
p->notify(e->id,&e->config);
}
}
void KNotify::slotPluginFinished( int id )
{
if(!m_notifications.contains(id))
return;
Event *e=m_notifications[id];
kDebug() << e->id << " ref=" << e->ref ;
e->ref--;
if(e->ref==0)
closeNotification( id );
}
KNotifyAdaptor::KNotifyAdaptor(QObject *parent)
: QDBusAbstractAdaptor(parent)
{
setAutoRelaySignals(true);
}
void KNotifyAdaptor::reconfigure()
{
static_cast<KNotify *>(parent())->reconfigure();
}
void KNotifyAdaptor::closeNotification(int id)
{
static_cast<KNotify *>(parent())->closeNotification(id);
}
int KNotifyAdaptor::event(const QString &event, const QString &fromApp, const QVariantList& contexts,
const QString &title, const QString &text, const QByteArray& image, const QStringList& actions,
int timeout, qlonglong winId)
// const QDBusMessage & , int _return )
{
/* I'm not sure this is the right way to read a a(ss) type, but it seems to work */
ContextList contextlist;
QString context_key;
foreach( const QVariant &v , contexts)
{
/* this code doesn't work
QVariantList vl=v.toList();
if(vl.count() != 2)
{
kWarning() << "Bad structure passed as argument" ;
continue;
}
contextlist << qMakePair(vl[0].toString() , vl[1].toString());*/
QString s=v.toString();
if(context_key.isEmpty())
context_key=s;
else {
contextlist << qMakePair(context_key , s);
context_key = "";
}
}
return static_cast<KNotify *>(parent())->event(event, fromApp, contextlist, title, text, image, actions, timeout, WId(winId));
}
void KNotifyAdaptor::reemit(int id, const QVariantList& contexts)
{
ContextList contextlist;
QString context_key;
foreach( const QVariant &v , contexts)
{
QString s=v.toString();
if(context_key.isEmpty())
context_key=s;
else {
contextlist << qMakePair(context_key , s);
context_key = "";
}
}
static_cast<KNotify *>(parent())->reemit(id, contextlist);
}
void KNotifyAdaptor::update(int id, const QString &title, const QString &text, const QByteArray& image, const QStringList& actions )
{
static_cast<KNotify *>(parent())->update(id, title, text, image, actions);
}
#include "moc_knotify.cpp"
// vim: sw=4 sts=4 ts=8 et

View file

@ -1,148 +0,0 @@
/*
Copyright (C) 2005-2009 by Olivier Goffart <ogoffart at kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef KNOTIFY_H
#define KNOTIFY_H
#include <QtCore/QObject>
#include <QtCore/QHash>
#include <QtDBus/QDBusAbstractAdaptor>
#include "knotifyconfig.h"
typedef QHash<QString,QString> Dict;
class KNotifyPlugin;
class KNotify : public QObject
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.kde.KNotify")
public:
using QObject::event;
KNotify(QObject *parent=0l);
~KNotify();
void addPlugin( KNotifyPlugin *p );
public Q_SLOTS:
void reconfigure();
void closeNotification( int id);
int event(const QString &event, const QString &fromApp, const ContextList& contexts ,
const QString &title, const QString &text, const KNotifyImage& image, const QStringList& actions,
int timeout, WId winId = 0);
void update(int id, const QString &title, const QString &text, const KNotifyImage& image, const QStringList& actions);
void reemit(int id, const ContextList& contexts);
Q_SIGNALS:
void notificationClosed( int id);
void notificationActivated(int id,int action);
private Q_SLOTS:
void slotPluginFinished(int id);
private:
struct Event
{
Event(const QString &appname, const ContextList &contexts , const QString &eventid)
: config(appname, contexts , eventid) {}
int id;
int ref;
KNotifyConfig config;
};
int m_counter;
QHash<QString, KNotifyPlugin *> m_plugins;
QHash<int , Event* > m_notifications;
void loadConfig();
void emitEvent(Event *e);
};
class KNotifyAdaptor : public QDBusAbstractAdaptor
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.kde.KNotify")
Q_CLASSINFO("D-Bus Introspection", ""
"<interface name=\"org.kde.KNotify\">"
"<signal name=\"notificationClosed\">"
"<arg name=\"id\" type=\"i\" direction=\"out\"/>"
"</signal>"
"<signal name=\"notificationActivated\">"
"<arg name=\"id\" type=\"i\" direction=\"out\"/>"
"<arg name=\"action\" type=\"i\" direction=\"out\"/>"
"</signal>"
"<method name=\"reconfigure\">"
"</method>"
"<method name=\"closeNotification\">"
"<arg name=\"id\" type=\"i\" direction=\"in\"/>"
"</method>"
"<method name=\"event\">"
"<arg type=\"i\" direction=\"out\"/>"
"<arg name=\"event\" type=\"s\" direction=\"in\"/>"
"<arg name=\"fromApp\" type=\"s\" direction=\"in\"/>"
"<arg name=\"contexts\" type=\"av\" direction=\"in\"/>"
"<arg name=\"title\" type=\"s\" direction=\"in\"/>"
"<arg name=\"text\" type=\"s\" direction=\"in\"/>"
"<arg name=\"pixmap\" type=\"ay\" direction=\"in\"/>"
"<arg name=\"actions\" type=\"as\" direction=\"in\"/>"
"<arg name=\"timeout\" type=\"i\" direction=\"in\"/>"
"<arg name=\"winId\" type=\"x\" direction=\"in\"/>"
"</method>"
"<method name=\"update\">"
"<arg name=\"id\" type=\"i\" direction=\"in\"/>"
"<arg name=\"title\" type=\"s\" direction=\"in\"/>"
"<arg name=\"text\" type=\"s\" direction=\"in\"/>"
"<arg name=\"pixmap\" type=\"ay\" direction=\"in\"/>"
"<arg name=\"actions\" type=\"as\" direction=\"in\"/>"
"</method>"
"<method name=\"reemit\">"
"<arg name=\"id\" type=\"i\" direction=\"in\"/>"
"<arg name=\"contexts\" type=\"av\" direction=\"in\"/>"
"</method>"
"</interface>" )
public:
KNotifyAdaptor(QObject *parent);
using QObject::event;
public Q_SLOTS:
void reconfigure();
void closeNotification( int id);
int event(const QString &event, const QString &fromApp, const QVariantList& contexts ,
const QString &title, const QString &text, const QByteArray& pixmap, const QStringList& actions , int timeout,
qlonglong winId );
void reemit(int id, const QVariantList& contexts);
void update(int id, const QString &title, const QString &text, const QByteArray& pixmap, const QStringList& actions );
Q_SIGNALS:
void notificationClosed( int id);
void notificationActivated( int id,int action);
};
#endif

View file

@ -1,178 +0,0 @@
[Desktop Entry]
Type=Service
Name=KNotify
Name[af]=KNotify
Name[ar]=منبه كدي
Name[ast]=KNotify
Name[be]=KNotify
Name[be@latin]=KNotify
Name[bg]=KNotify
Name[bn]=-ি
Name[bn_IN]=KNotify
Name[bs]=Kobaveštenja
Name[ca]=KNotify
Name[ca@valencia]=KNotify
Name[cs]=KNotify
Name[csb]=KNotify
Name[da]=KNotify
Name[de]=KNotify
Name[el]=KNotify
Name[en_GB]=KNotify
Name[eo]=KNotify
Name[es]=KNotify
Name[et]=KNotify
Name[eu]=KNotify
Name[fa]=KNotify
Name[fi]=KNotify
Name[fr]=KNotify
Name[fy]=KNotify
Name[ga]=KNotify
Name[gl]=KNotify
Name[gu]=KNotify
Name[he]=KNotify
Name[hi]=-ि
Name[hne]=-ि
Name[hr]=KNotify
Name[hsb]=KNotify
Name[hu]=KNotify
Name[ia]=KNotify
Name[id]=KNotify
Name[is]=KNotify
Name[it]=KNotify
Name[ja]=KNotify
Name[ka]=KNotify
Name[kk]=KNotify
Name[km]=KNotify
Name[kn]=ಿ
Name[ko]=KNotify
Name[ku]=KNotify
Name[lt]=KNotify
Name[lv]=KNotify
Name[mai]=-ि
Name[mk]=KNotify
Name[ml]=ി
Name[mr]=KNotify
Name[nb]=KNotify
Name[nds]=KNotify
Name[ne]=
Name[nl]=KNotify
Name[nn]=KNotify
Name[oc]=KNotify
Name[or]=Kିି
Name[pa]=-
Name[pl]=KNotify
Name[pt]=KNotify
Name[pt_BR]=KNotify
Name[ro]=KNotify
Name[ru]=KNotify
Name[se]=KNotify
Name[si]=KNotify
Name[sk]=KNotify
Name[sl]=KNotify
Name[sr]=Кобавештења
Name[sr@ijekavian]=Кобавјештења
Name[sr@ijekavianlatin]=Kobavještenja
Name[sr@latin]=Kobaveštenja
Name[sv]=Underrättelse
Name[ta]=ிி
Name[te]=KNotify
Name[tg]=KNotify
Name[th]=KNotify
Name[tr]=KNotify
Name[ug]=KNotify
Name[uk]=KNotify
Name[vi]=KNotify
Name[wa]=KNotify
Name[x-test]=xxKNotifyxx
Name[zh_CN]=KNotify
Name[zh_TW]=KNotify
Exec=knotify4
Comment=KDE Notification Daemon
Comment[af]=KDE Inkennisstel-bediener
Comment[ar]=مراقب تنبيهات كدي
Comment[ast]=Degorriu de notificaciones de KDE
Comment[be]=Сервіс абвяшчэнняў KDE
Comment[be@latin]=Słužba infarmavańnia KDE
Comment[bg]=Демон на KDE за уведомяване
Comment[bn]=.ি.. িি ি
Comment[bn_IN]=KDE Notification
Comment[bs]=KDEov demon za obavještenja
Comment[ca]=Dimoni de notificacions del KDE
Comment[ca@valencia]=Dimoni de notificacions del KDE
Comment[cs]=Upozorňovací démon KDE
Comment[csb]=Ùsłëżnota dôwanié wiédzë KDE
Comment[da]=KDE bekendtgørelsesdæmon
Comment[de]=KDE-Benachrichtigungsdienst
Comment[el]=Δαίμονας ειδοποιήσεων του KDE
Comment[en_GB]=KDE Notification Dæmon
Comment[eo]=Demono de atentigo de KDE
Comment[es]=Demonio de notificaciones de KDE
Comment[et]=KDE märguannete deemon
Comment[eu]=KDEren jakinarazpenen daemon-a
Comment[fa]=شبح اخطار KDE
Comment[fi]=KDE-ilmoitustaustaprosessi
Comment[fr]=Démon de notification de KDE
Comment[fy]=KDE's systeemberjochtenprogramma
Comment[ga]=Deamhan Fógartha KDE
Comment[gl]=Daemon de notificacións de KDE
Comment[gu]=KDE
Comment[he]=שירות ההודעות של KDE
Comment[hi]=
Comment[hne]=
Comment[hr]=KDE demon obavijesti
Comment[hsb]=KDE zdźělenski daemon
Comment[hu]=KDE rendszerüzenet-kezelő szolgáltatás
Comment[ia]=Demone de notification KDE
Comment[id]=Jurik Notifikasi KDE
Comment[is]=KDE Tilkynningaþjónn
Comment[it]=Demone delle notifiche di KDE
Comment[ja]=KDE
Comment[kk]=KDE құлақтандыру қызметі
Comment[km]= KDE
Comment[kn]=ಿ ಿ ()
Comment[ko]=KDE
Comment[ku]=Xeyaleta Hişyarkirina KDE'yê
Comment[lt]=KDE pranešimų tarnyba
Comment[lv]=KDE paziņojumu dēmons
Comment[mai]=
Comment[mk]=KDE даемон за известувања
Comment[ml]=ിി ിി ി ി
Comment[mr]=
Comment[nb]=KDEs varslingsnisse
Comment[nds]=KDE-Dämoon för Bescheden
Comment[ne]=
Comment[nl]=KDE Notificatie-daemon
Comment[nn]=KDE-varslingsteneste
Comment[or]=KDE ିି
Comment[pa]=KDE ਿ
Comment[pl]=Demon powiadomień KDE
Comment[pt]=Servidor de Notificações do KDE
Comment[pt_BR]=Servidor de notificações do KDE
Comment[ro]=Demon de notificare KDE
Comment[ru]=Служба уведомлений KDE
Comment[se]=KDE-dieđihanduogášprográmma
Comment[si]=KDE
Comment[sk]=Démon upozornení KDE
Comment[sl]=KDE-jev ozadnji program za obvestila
Comment[sr]=КДЕов демон за обавештења
Comment[sr@ijekavian]=КДЕов демон за обавјештења
Comment[sr@ijekavianlatin]=KDEov demon za obavještenja
Comment[sr@latin]=KDEov demon za obaveštenja
Comment[sv]=KDE-underrättelsedemon
Comment[ta]=KDE ிி ி
Comment[te]=KDE
Comment[tg]=Хидмати огоҳиҳои KDE
Comment[th]= KDE
Comment[tr]=KDE Bildirim Servisi
Comment[ug]=ك د ئې(KDE) ئۇقتۇرۇش مۇئەككىلى
Comment[uk]=Фонова служба сповіщення KDE
Comment[uz]=KDE xabarnoma xizmati
Comment[uz@cyrillic]=KDE хабарнома хизмати
Comment[vi]=Trình nn thông báo KDE
Comment[wa]=Demon di notifiaedje di KDE
Comment[x-test]=xxKDE Notification Daemonxx
Comment[zh_CN]=KDE
Comment[zh_TW]=KDE Notification
Icon=preferences-desktop-notification
StartupNotify=false
X-KDE-MediaPlayer=knotify

View file

@ -1,134 +0,0 @@
/*
Copyright (C) 2005-2009 by Olivier Goffart <ogoffart at kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "knotifyconfig.h"
#include <ksharedconfig.h>
#include <kconfiggroup.h>
#include <kdebug.h>
#include <kglobal.h>
#include <QCache>
#include <QDataStream>
typedef QCache<QString, KSharedConfig::Ptr> ConfigCache;
K_GLOBAL_STATIC_WITH_ARGS(ConfigCache , static_cache, (15))
static KSharedConfig::Ptr retrieve_from_cache(const QString& filename, const char *resourceType="config")
{
QCache<QString, KSharedConfig::Ptr> &cache = *static_cache;
if (cache.contains(filename))
return *cache[filename];
KSharedConfig::Ptr m = KSharedConfig::openConfig (filename , KConfig::NoGlobals, resourceType );
cache.insert(filename, new KSharedConfig::Ptr(m));
return m;
}
void KNotifyConfig::reparseConfiguration()
{
QCache<QString, KSharedConfig::Ptr> &cache = *static_cache;
foreach (const QString& filename, cache.keys())
(*cache[filename])->reparseConfiguration();
}
KNotifyConfig::KNotifyConfig( const QString & _appname, const ContextList & _contexts, const QString & _eventid )
: appname (_appname),
eventsfile(retrieve_from_cache(_appname+'/'+_appname + ".notifyrc" , "data" )),
configfile(retrieve_from_cache(_appname+QString::fromAscii( ".notifyrc" ))),
contexts(_contexts) , eventid(_eventid)
{
// kDebug() << appname << " , " << eventid;
}
KNotifyConfig::~KNotifyConfig()
{
}
KNotifyConfig *KNotifyConfig::copy() const
{
KNotifyConfig *config = new KNotifyConfig( appname, contexts, eventid );
config->title = title;
config->text = text;
config->image = KNotifyImage( image.data() );
config->timeout = timeout;
config->winId = winId;
config->actions = actions;
config->eventsfile = eventsfile;
config->configfile = configfile;
// appname, contexts, eventid already done in constructor
return config;
}
QString KNotifyConfig::readEntry( const QString & entry, bool path )
{
for (QPair<QString,QString> context: contexts )
{
const QString group="Event/" + eventid + '/' + context.first + '/' + context.second;
if( configfile->hasGroup( group ) )
{
KConfigGroup cg(configfile, group);
QString p=path ? cg.readPathEntry(entry, QString()) : cg.readEntry(entry,QString());
if(!p.isNull())
return p;
}
if( eventsfile->hasGroup( group ) )
{
KConfigGroup cg(eventsfile, group);
QString p=path ? cg.readPathEntry(entry, QString()) : cg.readEntry(entry,QString());
if(!p.isNull())
return p;
}
}
// kDebug() << entry << " not found in contexts ";
const QString group="Event/" + eventid ;
if(configfile->hasGroup( group ) )
{
KConfigGroup cg(configfile, group);
QString p=path ? cg.readPathEntry(entry, QString()) : cg.readEntry(entry,QString());
if(!p.isNull())
return p;
}
// kDebug() << entry << " not found in config ";
if(eventsfile->hasGroup( group ) )
{
KConfigGroup cg( eventsfile, group);
QString p=path ? cg.readPathEntry(entry, QString()) : cg.readEntry(entry, QString());
if(!p.isNull())
return p;
}
// kDebug() << entry << " not found !!! ";
return QString();
}
QImage KNotifyImage::toImage()
{
if (dirty)
{
if (source.size() > 4) // no way an image can fit in less than 4 bytes
{
image.loadFromData(source);
}
dirty = false;
}
return image;
}

View file

@ -1,126 +0,0 @@
/*
Copyright (C) 2005-2009 by Olivier Goffart <ogoffart at kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef KNOTIFYCONFIG_H
#define KNOTIFYCONFIG_H
#include <ksharedconfig.h>
#include <QPair>
#include <QPixmap>
#include <QObject> //for Wid
typedef QList< QPair<QString,QString> > ContextList;
/**
* An image with lazy loading from the byte array
*/
class KNotifyImage
{
public:
KNotifyImage() : dirty(false) {}
KNotifyImage(const QByteArray &data) : source(data), dirty(true) {}
QImage toImage();
bool isNull() {
return dirty ? source.isEmpty() : image.isNull();
}
QByteArray data() const {
return source;
}
private:
QByteArray source;
QImage image;
bool dirty;
};
/**
* Represent the configuration for an event
* @author Olivier Goffart <ogoffart@kde.org>
*/
class KNotifyConfig
{
public:
KNotifyConfig(const QString &appname, const ContextList &_contexts , const QString &_eventid);
~KNotifyConfig();
KNotifyConfig *copy() const;
/**
* @return entry from the knotifyrc file
*
* This will return the configuration from the user for the given key.
* It first look into the user config file, and then in the global config file.
*
* return a null string if the entry doesn't exist
*/
QString readEntry(const QString& entry , bool path=false);
/**
* the title of the notification
*/
QString title;
/**
* the text of the notification
*/
QString text;
/**
* the pixmap to put on the notification
*/
KNotifyImage image;
/**
* How long the notification should be presented (in seconds).
* -1 means server decides,
* 0 means infinite.
*/
int timeout;
/**
* The windowsID of the window that initiated the notification
* (it is a window in the client)
*/
WId winId;
/**
* the user-readable list of action.
*/
QStringList actions;
/**
* the name of the application that triggered the notification
*/
QString appname;
/**
* @internal
*/
KSharedConfig::Ptr eventsfile,configfile;
ContextList contexts;
/**
* the name of the notification
*/
QString eventid;
/**
* reparse the cached configs. to be used when the config may have changed
*/
static void reparseConfiguration();
};
#endif

View file

@ -1,52 +0,0 @@
/*
Copyright (C) 2005-2006 by Olivier Goffart <ogoffart at kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "knotifyplugin.h"
KNotifyPlugin::KNotifyPlugin(QObject *parent, const QVariantList &args)
: QObject(parent)
{
Q_UNUSED(args);
}
KNotifyPlugin::~KNotifyPlugin()
{
}
void KNotifyPlugin::update(int id, KNotifyConfig * config)
{
Q_UNUSED(id);
Q_UNUSED(config);
}
void KNotifyPlugin::close(int id)
{
emit finished(id);
}
void KNotifyPlugin::finish(int id)
{
emit finished(id);
}
#include "moc_knotifyplugin.cpp"

View file

@ -1,101 +0,0 @@
/*
Copyright (C) 2005-2006 by Olivier Goffart <ogoffart at kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef KNOTIFYPLUGIN_H
#define KNOTIFYPLUGIN_H
#include <QtCore/QObject>
#include <QtCore/QVariant>
class KNotifyConfig;
/**
* @brief abstract class for KNotify actions
*
* A KNotifyPlugin is responsible of one presentation. You can subclass it to have your own knotify presentation.
*
* You should reimplement the KNotifyPlugin::notify method to display the notification.
*
* @author Olivier Goffart <ogoffart at kde.org>
*/
class KNotifyPlugin : public QObject
{ Q_OBJECT
public:
KNotifyPlugin(QObject *parent=0l, const QVariantList &args=QVariantList());
virtual ~KNotifyPlugin();
/**
* @brief return the name of this plugin.
*
* this is the name that should appear in the .knotifyrc file,
* in the field Action=... if a notification is set to use this plugin
*/
virtual QString optionName() =0;
/**
* This function is called when the notification is sent.
* (or re-sent)
* You should implement this function to display a notification
*
* for each call to this function (even for re-notification), you MUST call finish(int)
*
* @param id is the notification id
* @param config is the configuration of the notification
*/
virtual void notify(int id , KNotifyConfig *config )=0;
/**
* This function is called when the notification has changed (such as the text or the icon)
*/
virtual void update(int id, KNotifyConfig *config);
/**
* This function is called when the notification has been closed
*/
virtual void close(int id);
protected:
/**
* emit the finished signal
* you MUST call this function for each call to notify(), even if you do nothing there
*
* call it when the presentation is finished (because the user closed the popup or the sound is finished)
*
* If your presentation is synchronous, you can even call this function from the notify() call itself
*/
void finish(int id);
Q_SIGNALS:
/**
* the presentation is finished.
*/
void finished(int id);
/**
* emit this signal if one action was invoked
* @param id is the id of the notification
* @param action is the action number. zero for the default action
*/
void actionInvoked(int id , int action);
};
#endif

View file

@ -1,214 +0,0 @@
/*
Copyright (C) 2010 by Jacopo De Simoi <wilderkde@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "ksolidnotify.h"
#include "knotify.h"
//solid specific includes
#include <Solid/DeviceNotifier>
#include <Solid/Device>
#include <Solid/DeviceInterface>
#include <Solid/StorageDrive>
#include <Solid/StorageVolume>
#include <Solid/StorageAccess>
#include <Solid/OpticalDrive>
#include <Solid/OpticalDisc>
#include <Solid/PortableMediaPlayer>
#include <Solid/Predicate>
#include <QDBusConnection>
#include <QDBusConnectionInterface>
#include <QDBusServiceWatcher>
#include <KLocale>
static const char dbusDeviceNotificationsName[] = "org.kde.DeviceNotifications";
static const char dbusDeviceNotificationsPath[] = "/org/kde/DeviceNotifications";
KSolidNotify::KSolidNotify(KNotify* parent):
QObject(parent),
m_kNotify(parent),
m_dbusServiceExists(false)
{
Solid::Predicate p(Solid::DeviceInterface::StorageAccess);
p |= Solid::Predicate(Solid::DeviceInterface::OpticalDrive);
p |= Solid::Predicate(Solid::DeviceInterface::PortableMediaPlayer);
QList<Solid::Device> devices = Solid::Device::listFromQuery(p);
foreach (const Solid::Device &dev, devices)
{
m_devices.insert(dev.udi(), dev);
connectSignals(&m_devices[dev.udi()]);
}
connect(Solid::DeviceNotifier::instance(), SIGNAL(deviceAdded(const QString &)),
this, SLOT(onDeviceAdded(const QString &)));
connect(Solid::DeviceNotifier::instance(), SIGNAL(deviceRemoved(const QString &)),
this, SLOT(onDeviceRemoved(const QString &)));
// check if service already exists on plugin instantiation
QDBusConnectionInterface* interface = QDBusConnection::sessionBus().interface();
m_dbusServiceExists = interface && interface->isServiceRegistered(dbusDeviceNotificationsName);
if( m_dbusServiceExists )
slotServiceOwnerChanged(dbusDeviceNotificationsName, QString(), "_"); //connect signals
// to catch register/unregister events from service in runtime
QDBusServiceWatcher *watcher = new QDBusServiceWatcher(this);
watcher->setConnection(QDBusConnection::sessionBus());
watcher->setWatchMode(QDBusServiceWatcher::WatchForOwnerChange);
watcher->addWatchedService(dbusDeviceNotificationsName);
connect(watcher, SIGNAL(serviceOwnerChanged(const QString&, const QString&, const QString&)),
SLOT(slotServiceOwnerChanged(const QString&, const QString&, const QString&)));
}
void KSolidNotify::onDeviceAdded(const QString &udi)
{
Solid::Device device(udi);
m_devices.insert(udi, device);
connectSignals(&m_devices[udi]);
}
void KSolidNotify::onDeviceRemoved(const QString &udi)
{
if (m_devices[udi].is<Solid::StorageVolume>())
{
Solid::StorageAccess *access = m_devices[udi].as<Solid::StorageAccess>();
if (access)
disconnect(access, 0, this, 0);
}
m_devices.remove(udi);
}
bool KSolidNotify::isSafelyRemovable(const QString &udi)
{
Solid::Device device = m_devices[udi];
if (device.is<Solid::StorageDrive>())
{
Solid::StorageDrive *drive = device.as<Solid::StorageDrive>();
return (!drive->isInUse() && (drive->isHotpluggable() || drive->isRemovable()));
}
Solid::StorageAccess* access = m_devices[udi].as<Solid::StorageAccess>();
if (access) {
return !m_devices[udi].as<Solid::StorageAccess>()->isAccessible();
} else {
// If this check fails, the device has been already physically
// ejected, so no need to say that it is safe to remove it
return false;
}
}
void KSolidNotify::connectSignals(Solid::Device* device)
{
Solid::StorageAccess *access = device->as<Solid::StorageAccess>();
if (access)
{
connect(access, SIGNAL(teardownDone(Solid::ErrorType, const QString&, const QString &)),
this, SLOT(storageTeardownDone(Solid::ErrorType, const QString& , const QString &)));
connect(access, SIGNAL(setupDone(Solid::ErrorType, const QString&, const QString &)),
this, SLOT(storageSetupDone(Solid::ErrorType, const QString& , const QString &)));
}
if (device->is<Solid::OpticalDisc>())
{
Solid::OpticalDrive *drive = device->as<Solid::OpticalDrive>();
connect(drive, SIGNAL(ejectDone(Solid::ErrorType, const QString&, const QString &)),
this, SLOT(storageEjectDone(Solid::ErrorType, const QString& , const QString &)));
}
}
void KSolidNotify::notifySolidEvent(QString event, Solid::ErrorType error, const QString &errorData, const QString & udi, const QString & errorMessage)
{
ContextList context;
if (m_dbusServiceExists)
{
KNotifyConfig mountConfig("hardwarenotifications", ContextList(), event);
if (mountConfig.readEntry("Action").split('|').contains("Popup"))
{
QDBusMessage m = QDBusMessage::createMethodCall( dbusDeviceNotificationsName, dbusDeviceNotificationsPath, dbusDeviceNotificationsName, "notify" );
m << error << errorMessage << errorData.simplified() << udi;
QDBusConnection::sessionBus().call(m);
}
context << QPair<QString, QString>("devnotifier", "present");
}
m_kNotify->event(event, "hardwarenotifications", context, i18n("Devices notification"), errorMessage, KNotifyImage(), QStringList(), -1);
}
void KSolidNotify::storageSetupDone(Solid::ErrorType error, const QString &errorData, const QString &udi)
{
if (error)
{
Solid::Device device(udi);
QString errorMessage = i18n("Could not mount the following device: %1", device.description());
notifySolidEvent("mounterror", error, errorData, udi, errorMessage);
}
}
void KSolidNotify::storageTeardownDone(Solid::ErrorType error, const QString &errorData, const QString &udi)
{
if (error)
{
Solid::Device device(udi);
QString errorMessage = i18n("Could not unmount the following device: %1\nOne or more files on this device are open within an application ", device.description());
notifySolidEvent("mounterror", error, errorData, udi, errorMessage);
} else if (isSafelyRemovable(udi))
{
Solid::Device device(udi);
notifySolidEvent("safetoremove", error, errorData, udi, i18nc("The term \"remove\" here means \"physically disconnect the device from the computer\", whereas \"safely\" means \"without risk of data loss\"", "The following device can now be safely removed: %1", device.description()));
}
}
void KSolidNotify::storageEjectDone(Solid::ErrorType error, const QString &errorData, const QString &udi)
{
if (error)
{
QString discUdi;
foreach (Solid::Device device, m_devices) {
if (device.parentUdi() == udi) {
discUdi = device.udi();
}
}
if (discUdi.isNull()) {
//This should not happen, bail out
return;
}
Solid::Device discDevice(discUdi);
QString errorMessage = i18n("Could not eject the following device: %1\nOne or more files on this device are open within an application ", discDevice.description());
notifySolidEvent("mounterror", error, errorData, udi, errorMessage);
} else if (isSafelyRemovable(udi))
{
Solid::Device device(udi);
notifySolidEvent("safetoremove", error, errorData, udi, i18n("The following device can now be safely removed: %1", device.description()));
}
}
void KSolidNotify::slotServiceOwnerChanged( const QString & serviceName, const QString & oldOwner, const QString & newOwner )
{
Q_UNUSED(serviceName);
if (newOwner.isEmpty())
m_dbusServiceExists = false;
else if (oldOwner.isEmpty())
m_dbusServiceExists = true;
}
#include "moc_ksolidnotify.cpp"

View file

@ -1,70 +0,0 @@
/*
Copyright (C) 2010 by Jacopo De Simoi <wilderkde@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef KSOLIDNOTIFY_H
#define KSOLIDNOTIFY_H
#include "knotify.h"
#include <solid/solidnamespace.h>
namespace Solid
{
class Device;
}
/**
* @brief Class which triggers solid notifications
*
* This is an internal class which listens to solid errors and route them via dbus to an
* appropriate visualization (e.g. the plasma device notifier applet); if such visualization is not available
* errors are shown via regular notifications
*
* @author Jacopo De Simoi <wilderkde at gmail.com>
*/
class KSolidNotify : public QObject
{ Q_OBJECT
public:
KSolidNotify(KNotify *parent);
protected Q_SLOTS:
void onDeviceAdded(const QString &udi);
void onDeviceRemoved(const QString &udi);
private slots:
void storageEjectDone(Solid::ErrorType error, const QString &errorData, const QString &udi);
void storageTeardownDone(Solid::ErrorType error, const QString &errorData, const QString &udi);
void storageSetupDone(Solid::ErrorType error, const QString &errorData, const QString &udi);
void slotServiceOwnerChanged(const QString &, const QString &, const QString &);
private:
void connectSignals(Solid::Device* device);
bool isSafelyRemovable(const QString &udi);
void notifySolidEvent(QString event, Solid::ErrorType error, const QString &errorData, const QString & udi, const QString & errorMessage);
KNotify* m_kNotify;
QHash<QString, Solid::Device> m_devices;
bool m_dbusServiceExists;
};
#endif

View file

@ -1,84 +0,0 @@
/*
Copyright (C) 2005-2006 by Olivier Goffart <ogoffart at kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <kapplication.h>
#include <kaboutdata.h>
#include <kcmdlineargs.h>
#include <kdebug.h>
#include <kglobal.h>
#include <klocale.h>
#include <kmessage.h>
#include <kpassivepopupmessagehandler.h>
#include <kdeversion.h>
#include <QDBusConnectionInterface>
#include <QDBusReply>
#include "knotify.h"
int main(int argc, char **argv)
{
// NOTE: disables session manager entirely, for reference:
// https://www.x.org/releases/X11R7.7/doc/libSM/xsmp.html
::unsetenv("SESSION_MANAGER");
KAboutData aboutdata("knotify", "knotify4", ki18n("KNotify"),
KDE_VERSION_STRING, ki18n("KDE Notification Daemon"),
KAboutData::License_GPL, ki18n("(C) 1997-2008, KDE Developers"));
aboutdata.addAuthor(ki18n("Olivier Goffart"),ki18n("Current Maintainer"),"ogoffart@kde.org");
aboutdata.addAuthor(ki18n("Carsten Pfeiffer"),ki18n("Previous Maintainer"),"pfeiffer@kde.org");
aboutdata.addAuthor(ki18n("Christian Esken"),KLocalizedString(),"esken@kde.org");
aboutdata.addAuthor(ki18n("Stefan Westerfeld"),ki18n("Sound support"),"stefan@space.twc.de");
aboutdata.addAuthor(ki18n("Charles Samuels"),ki18n("Previous Maintainer"),"charles@kde.org");
aboutdata.addAuthor(ki18n("Allan Sandfeld Jensen"),ki18n("Porting to KDE 4"),"kde@carewolf.com");
KCmdLineArgs::init( argc, argv, &aboutdata );
KApplication app;
// do not connect to ksmserver at all, knotify is launched on demand and doesn't need
// to know about logout, and moreover it may be ksmserver who tries to launch knotify,
// in which case there is a deadlock with ksmserver waiting for knotify to finish
// startup and knotify waiting to register with ksmserver
app.disableSessionManagement();
QDBusConnection session = QDBusConnection::sessionBus();
if (!session.isConnected()) {
kWarning() << "No DBUS session-bus found. Check if you have started the DBUS server.";
return 1;
}
QDBusReply<bool> sessionReply = session.interface()->isServiceRegistered("org.kde.knotify");
if (sessionReply.isValid() && sessionReply.value() == true) {
kWarning() << "Another instance of knotify is already running!";
return 2;
}
/*
* the default KMessageBoxMessageHandler will do messagesbox that notify
* so we have a deadlock if one debug message is shown as messagebox.
* that's why we're forced to change the default handler
*/
KMessage::setMessageHandler( new KPassivePopupMessageHandler(0) );
// start notify service
KNotify notify;
return app.exec();
}

View file

@ -1,70 +0,0 @@
/*
Copyright (C) 2005-2006 by Olivier Goffart <ogoffart at kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "notifybyexecute.h"
#include <QHash>
#include <KProcess>
#include <knotifyconfig.h>
#include <kdebug.h>
#include <kmacroexpander.h>
NotifyByExecute::NotifyByExecute(QObject *parent) : KNotifyPlugin(parent)
{
}
NotifyByExecute::~NotifyByExecute()
{
}
void NotifyByExecute::notify( int id, KNotifyConfig * config )
{
QString command=config->readEntry( "Execute" );
kDebug() << command;
if (!command.isEmpty()) {
// kDebug() << "executing command '" << command << "'";
QHash<QChar,QString> subst;
subst.insert( 'e', config->eventid );
subst.insert( 'a', config->appname );
subst.insert( 's', config->text );
subst.insert( 'w', QString::number( (quintptr)config->winId ));
subst.insert( 'i', QString::number( id ));
QString execLine = KMacroExpander::expandMacrosShellQuote( command, subst );
if ( execLine.isEmpty() )
execLine = command; // fallback
KProcess proc;
proc.setShellCommand(execLine.trimmed());
if(!proc.startDetached())
kDebug()<<"KNotify: Could not start process!";
}
finish( id );
}
#include "moc_notifybyexecute.cpp"

View file

@ -1,39 +0,0 @@
/*
Copyright (C) 2005-2006 by Olivier Goffart <ogoffart at kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef NOTIFYBYEXECUTE_H
#define NOTIFYBYEXECUTE_H
#include "knotifyplugin.h"
class NotifyByExecute : public KNotifyPlugin
{ Q_OBJECT
public:
NotifyByExecute(QObject *parent=0l);
virtual ~NotifyByExecute();
virtual QString optionName() { return "Execute"; }
virtual void notify(int id , KNotifyConfig *config);
};
#endif

View file

@ -1,76 +0,0 @@
/*
Copyright (C) 2005-2006 by Olivier Goffart <ogoffart at kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "notifybylogfile.h"
#include <kdebug.h>
#include <knotifyconfig.h>
#include <KUrl>
#include <QDateTime>
#include <QFile>
#include <QTextStream>
NotifyByLogfile::NotifyByLogfile(QObject *parent) : KNotifyPlugin(parent)
{
}
NotifyByLogfile::~NotifyByLogfile()
{
}
void NotifyByLogfile::notify( int id, KNotifyConfig * config )
{
QString file=config->readEntry( "Logfile" );
// kDebug() << file << KUrl(file).path();
if ( file.isEmpty() )
{
finish( id );
return;
}
// open file in append mode
QFile logFile(KUrl(file).path());
if ( !logFile.open(QIODevice::WriteOnly | QIODevice::Append) )
{
finish( id );
return;
}
QString text = config->text;
if( text.isEmpty())
text = config->readEntry( "Name" );
// append msg
QTextStream strm( &logFile );
strm << "- KNotify " << QDateTime::currentDateTime().toString() << ": ";
strm << text << endl;
// close file
logFile.close();
finish( id );
}
#include "moc_notifybylogfile.cpp"

View file

@ -1,39 +0,0 @@
/*
Copyright (C) 2005-2006 by Olivier Goffart <ogoffart at kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef NOTIFYBYLOGFILE_H
#define NOTIFYBYLOGFILE_H
#include "knotifyplugin.h"
class NotifyByLogfile : public KNotifyPlugin
{ Q_OBJECT
public:
NotifyByLogfile(QObject *parent=0l);
virtual ~NotifyByLogfile();
virtual QString optionName() { return "Logfile"; }
virtual void notify(int id , KNotifyConfig *config);
};
#endif

View file

@ -1,590 +0,0 @@
/*
Copyright (C) 2005-2009 by Olivier Goffart <ogoffart at kde.org>
Copyright (C) 2008 by Dmitry Suzdalev <dimsuz@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "notifybypopup.h"
#include "imageconverter.h"
#include <kdebug.h>
#include <kpassivepopup.h>
#include <kiconloader.h>
#include <kdialog.h>
#include <khbox.h>
#include <kvbox.h>
#include <kcharsets.h>
#include <knotifyconfig.h>
#include <QBuffer>
#include <QImage>
#include <QLabel>
#include <QTextDocument>
#include <QApplication>
#include <QDesktopWidget>
#include <QDBusConnection>
#include <QDBusConnectionInterface>
#include <QDBusServiceWatcher>
#include <QXmlStreamReader>
#include <kconfiggroup.h>
static const char dbusServiceName[] = "org.freedesktop.Notifications";
static const char dbusInterfaceName[] = "org.freedesktop.Notifications";
static const char dbusPath[] = "/org/freedesktop/Notifications";
NotifyByPopup::NotifyByPopup(QObject *parent)
: KNotifyPlugin(parent) , m_animationTimer(0), m_dbusServiceExists(false),
m_dbusServiceCapCacheDirty(true)
{
QRect screen = QApplication::desktop()->availableGeometry();
m_nextPosition = screen.top();
// check if service already exists on plugin instantiation
QDBusConnectionInterface* interface = QDBusConnection::sessionBus().interface();
m_dbusServiceExists = interface && interface->isServiceRegistered(dbusServiceName);
if( m_dbusServiceExists )
slotServiceOwnerChanged(dbusServiceName, QString(), "_"); //connect signals
// to catch register/unregister events from service in runtime
QDBusServiceWatcher *watcher = new QDBusServiceWatcher(this);
watcher->setConnection(QDBusConnection::sessionBus());
watcher->setWatchMode(QDBusServiceWatcher::WatchForOwnerChange);
watcher->addWatchedService(dbusServiceName);
connect(watcher, SIGNAL(serviceOwnerChanged(const QString&, const QString&, const QString&)),
SLOT(slotServiceOwnerChanged(const QString&, const QString&, const QString&)));
if(!m_dbusServiceExists)
{
bool startfdo = false;
if (qgetenv("KDE_FULL_SESSION").isEmpty())
{
QDBusMessage message = QDBusMessage::createMethodCall("org.freedesktop.DBus",
"/org/freedesktop/DBus",
"org.freedesktop.DBus",
"ListActivatableNames");
QDBusReply<QStringList> reply = QDBusConnection::sessionBus().call(message);
if (reply.isValid() && reply.value().contains(dbusServiceName)) {
startfdo = true;
// We need to set m_dbusServiceExists to true because dbus might be too slow
// starting the service and the first call to NotifyByPopup::notify
// might not have had the service up, by setting this to true we
// guarantee it will still go through dbus and dbus will do the correct
// thing and wait for the service to go up
m_dbusServiceExists = true;
}
}
if (startfdo)
QDBusConnection::sessionBus().interface()->startService(dbusServiceName);
}
}
NotifyByPopup::~NotifyByPopup()
{
foreach(KPassivePopup *p,m_popups)
p->deleteLater();
}
void NotifyByPopup::notify( int id, KNotifyConfig * config )
{
kDebug() << id << " active notifications:" << m_popups.keys() << m_idMap.keys();
if(m_popups.contains(id) || m_idMap.contains(id))
{
kDebug() << "the popup is already shown";
finish(id);
return;
}
// if Notifications DBus service exists on bus,
// it'll be used instead
if(m_dbusServiceExists)
{
if(!sendNotificationDBus(id, 0, config))
finish(id); //an error ocurred.
return;
}
// Default to 6 seconds if no timeout has been defined
int timeout = config->timeout == -1 ? 6000 : config->timeout;
KPassivePopup *pop = new KPassivePopup( config->winId );
m_popups[id]=pop;
fillPopup(pop,id,config);
QRect screen = QApplication::desktop()->availableGeometry();
pop->setAutoDelete( true );
connect(pop, SIGNAL(destroyed()) , this, SLOT(slotPopupDestroyed()) );
pop->setTimeout(timeout);
pop->adjustSize();
pop->show(QPoint(screen.left() + screen.width()/2 - pop->width()/2 , m_nextPosition));
m_nextPosition+=pop->height();
}
void NotifyByPopup::slotPopupDestroyed( )
{
const QObject *s=sender();
if(!s)
return;
QMap<int,KPassivePopup*>::iterator it;
for(it=m_popups.begin() ; it!=m_popups.end(); ++it )
{
QObject *o=it.value();
if(o && o == s)
{
finish(it.key());
m_popups.remove(it.key());
break;
}
}
//relocate popup
if(!m_animationTimer)
m_animationTimer = startTimer(10);
}
void NotifyByPopup::timerEvent(QTimerEvent * event)
{
if(event->timerId() != m_animationTimer)
return KNotifyPlugin::timerEvent(event);
bool cont=false;
QRect screen = QApplication::desktop()->availableGeometry();
m_nextPosition = screen.top();
foreach(KPassivePopup *pop,m_popups)
{
int posy=pop->pos().y();
if(posy > m_nextPosition)
{
posy=qMax(posy-5,m_nextPosition);
m_nextPosition = posy + pop->height();
cont = cont || posy != m_nextPosition;
pop->move(pop->pos().x(),posy);
}
else
m_nextPosition += pop->height();
}
if(!cont)
{
killTimer(m_animationTimer);
m_animationTimer = 0;
}
}
void NotifyByPopup::slotLinkClicked( const QString &adr )
{
unsigned int id=adr.section('/' , 0 , 0).toUInt();
unsigned int action=adr.section('/' , 1 , 1).toUInt();
// kDebug() << id << " " << action;
if(id==0 || action==0)
return;
emit actionInvoked(id,action);
}
void NotifyByPopup::close( int id )
{
delete m_popups.take(id);
if( m_dbusServiceExists)
{
closeNotificationDBus(id);
}
}
void NotifyByPopup::update(int id, KNotifyConfig * config)
{
if (m_popups.contains(id))
{
KPassivePopup *p=m_popups[id];
fillPopup(p, id, config);
return;
}
// if Notifications DBus service exists on bus,
// it'll be used instead
if( m_dbusServiceExists)
{
sendNotificationDBus(id, id, config);
return;
}
}
void NotifyByPopup::fillPopup(KPassivePopup *pop,int id,KNotifyConfig * config)
{
QString appCaption, iconName;
getAppCaptionAndIconName(config, &appCaption, &iconName);
KIconLoader iconLoader(iconName);
QPixmap appIcon = iconLoader.loadIcon( iconName, KIconLoader::Small );
KVBox *vb = pop->standardView( config->title.isEmpty() ? appCaption : config->title , config->image.isNull() ? config->text : QString() , appIcon );
KVBox *vb2 = vb;
if(!config->image.isNull())
{
QPixmap pix = QPixmap::fromImage(config->image.toImage());
KHBox *hb = new KHBox(vb);
hb->setSpacing(KDialog::spacingHint());
QLabel *pil=new QLabel(hb);
pil->setPixmap( pix );
pil->setScaledContents(true);
if(pix.height() > 80 && pix.height() > pix.width() )
{
pil->setMaximumHeight(80);
pil->setMaximumWidth(80*pix.width()/pix.height());
}
else if(pix.width() > 80 && pix.height() <= pix.width())
{
pil->setMaximumWidth(80);
pil->setMaximumHeight(80*pix.height()/pix.width());
}
vb=new KVBox(hb);
QLabel *msg = new QLabel( config->text, vb );
msg->setAlignment( Qt::AlignLeft );
}
if ( !config->actions.isEmpty() )
{
QString linkCode=QString::fromLatin1("<p align=\"right\">");
int i=0;
foreach ( const QString & it , config->actions )
{
i++;
linkCode+=QString::fromLatin1("&nbsp;<a href=\"%1/%2\">%3</a> ").arg( id ).arg( i ).arg( Qt::escape(it) );
}
linkCode+=QString::fromLatin1("</p>");
QLabel *link = new QLabel(linkCode , vb );
link->setTextInteractionFlags(Qt::LinksAccessibleByMouse);
link->setOpenExternalLinks(false);
//link->setAlignment( AlignRight );
QObject::connect(link, SIGNAL(linkActivated(const QString &)), this, SLOT(slotLinkClicked(const QString& ) ) );
QObject::connect(link, SIGNAL(linkActivated(const QString &)), pop, SLOT(hide()));
}
pop->setView( vb2 );
}
void NotifyByPopup::slotServiceOwnerChanged( const QString & serviceName,
const QString & oldOwner, const QString & newOwner )
{
kDebug() << serviceName << oldOwner << newOwner;
// tell KNotify that all existing notifications which it sent
// to DBus had been closed
foreach (int id, m_idMap.keys())
finished(id);
m_idMap.clear();
m_dbusServiceCapCacheDirty = true;
m_dbusServiceCapabilities.clear();
if(newOwner.isEmpty())
{
m_dbusServiceExists = false;
}
else if(oldOwner.isEmpty())
{
m_dbusServiceExists = true;
// connect to action invocation signals
bool connected = QDBusConnection::sessionBus().connect(QString(), // from any service
dbusPath,
dbusInterfaceName,
"ActionInvoked",
this,
SLOT(slotDBusNotificationActionInvoked(uint,const QString&)));
if (!connected) {
kWarning() << "warning: failed to connect to ActionInvoked dbus signal";
}
connected = QDBusConnection::sessionBus().connect(QString(), // from any service
dbusPath,
dbusInterfaceName,
"NotificationClosed",
this,
SLOT(slotDBusNotificationClosed(uint,uint)));
if (!connected) {
kWarning() << "warning: failed to connect to NotificationClosed dbus signal";
}
}
}
void NotifyByPopup::slotDBusNotificationActionInvoked(uint dbus_id, const QString& actKey)
{
// find out knotify id
int id = m_idMap.key(dbus_id, 0);
if (id == 0) {
kDebug() << "failed to find knotify id for dbus_id" << dbus_id;
return;
}
kDebug() << "action" << actKey << "invoked for notification " << id;
// emulate link clicking
slotLinkClicked( QString("%1/%2").arg(id).arg(actKey) );
// now close notification - similar to popup behaviour
// (popups are hidden after link activation - see 'connects' of linkActivated signal above)
closeNotificationDBus(id);
}
void NotifyByPopup::slotDBusNotificationClosed(uint dbus_id, uint reason)
{
Q_UNUSED(reason)
// find out knotify id
int id = m_idMap.key(dbus_id, 0);
kDebug() << dbus_id << " -> " << id;
if (id == 0) {
kDebug() << "failed to find knotify id for dbus_id" << dbus_id;
return;
}
// tell KNotify that this notification has been closed
m_idMap.remove(id);
finished(id);
}
void NotifyByPopup::getAppCaptionAndIconName(KNotifyConfig *config, QString *appCaption, QString *iconName)
{
KConfigGroup globalgroup(&(*config->eventsfile), "Global");
*appCaption = globalgroup.readEntry("Name", globalgroup.readEntry("Comment", config->appname));
KConfigGroup eventGroup(&(*config->eventsfile), QString("Event/%1").arg(config->eventid));
if (eventGroup.hasKey("IconName")) {
*iconName = eventGroup.readEntry("IconName", config->appname);
} else {
*iconName = globalgroup.readEntry("IconName", config->appname);
}
}
bool NotifyByPopup::sendNotificationDBus(int id, int replacesId, KNotifyConfig* config_nocheck)
{
// figure out dbus id to replace if needed
uint dbus_replaces_id = 0;
if (replacesId != 0 ) {
dbus_replaces_id = m_idMap.value(replacesId, 0);
if (!dbus_replaces_id)
return false; //the popup has been closed, there is nothing to replace.
}
QDBusMessage m = QDBusMessage::createMethodCall( dbusServiceName, dbusPath, dbusInterfaceName, "Notify" );
QList<QVariant> args;
QString appCaption, iconName;
getAppCaptionAndIconName(config_nocheck, &appCaption, &iconName);
KNotifyConfig *config = ensurePopupCompatibility( config_nocheck );
args.append( appCaption ); // app_name
args.append( dbus_replaces_id ); // replaces_id
args.append( iconName ); // app_icon
args.append( config->title.isEmpty() ? appCaption : config->title ); // summary
args.append( config->text ); // body
// galago spec defines action list to be list like
// (act_id1, action1, act_id2, action2, ...)
//
// assign id's to actions like it's done in fillPopup() method
// (i.e. starting from 1)
QStringList actionList;
int actId = 0;
foreach (const QString& actName, config->actions) {
actId++;
actionList.append(QString::number(actId));
actionList.append(actName);
}
args.append( actionList ); // actions
QVariantMap map;
// Add the application name to the hints.
// According to fdo spec, the app_name is supposed to be the applicaton's "pretty name"
// but in some places it's handy to know the application name itself
if (!config->appname.isEmpty()) {
map["x-kde-appname"] = config->appname;
}
// let's see if we've got an image, and store the image in the hints map
if (!config->image.isNull()) {
QImage image = config->image.toImage();
map["image_data"] = ImageConverter::variantForImage(image);
}
args.append( map ); // hints
args.append( config->timeout ); // expire timout
m.setArguments( args );
QDBusMessage replyMsg = QDBusConnection::sessionBus().call(m);
delete config;
if(replyMsg.type() == QDBusMessage::ReplyMessage) {
if (!replyMsg.arguments().isEmpty()) {
uint dbus_id = replyMsg.arguments().at(0).toUInt();
if (dbus_id == 0)
{
kDebug() << "error: dbus_id is null";
return false;
}
if (dbus_replaces_id && dbus_id == dbus_replaces_id)
return true;
#if 1
int oldId = m_idMap.key(dbus_id, 0);
if (oldId != 0) {
kWarning() << "Received twice the same id "<< dbus_id << "( previous notification: " << oldId << ")";
m_idMap.remove(oldId);
finish(oldId);
}
#endif
m_idMap.insert(id, dbus_id);
kDebug() << "mapping knotify id to dbus id:"<< id << "=>" << dbus_id;
return true;
} else {
kDebug() << "error: received reply with no arguments";
}
} else if (replyMsg.type() == QDBusMessage::ErrorMessage) {
kDebug() << "error: failed to send dbus message";
} else {
kDebug() << "unexpected reply type";
}
return false;
}
void NotifyByPopup::closeNotificationDBus(int id)
{
uint dbus_id = m_idMap.take(id);
if (dbus_id == 0) {
kDebug() << "not found dbus id to close" << id;
return;
}
QDBusMessage m = QDBusMessage::createMethodCall( dbusServiceName, dbusPath,
dbusInterfaceName, "CloseNotification" );
QList<QVariant> args;
args.append( dbus_id );
m.setArguments( args );
bool queued = QDBusConnection::sessionBus().send(m);
if(!queued)
{
kDebug() << "warning: failed to queue dbus message";
}
}
QStringList NotifyByPopup::popupServerCapabilities()
{
if (!m_dbusServiceExists) {
// Return capabilities of the KPassivePopup implementation
return QStringList() << "actions" << "body" << "body-hyperlinks"
<< "body-markup" << "icon-static";
}
if(m_dbusServiceCapCacheDirty) {
QDBusMessage m = QDBusMessage::createMethodCall( dbusServiceName, dbusPath,
dbusInterfaceName, "GetCapabilities" );
QDBusMessage replyMsg = QDBusConnection::sessionBus().call(m);
if (replyMsg.type() != QDBusMessage::ReplyMessage) {
kWarning() << "Error while calling popup server GetCapabilities()";
return QStringList();
}
if (replyMsg.arguments().isEmpty()) {
kWarning() << "popup server GetCapabilities() returned an empty reply";
return QStringList();
}
m_dbusServiceCapabilities = replyMsg.arguments().at(0).toStringList();
m_dbusServiceCapCacheDirty = false;
}
return m_dbusServiceCapabilities;
}
KNotifyConfig *NotifyByPopup::ensurePopupCompatibility( const KNotifyConfig *config )
{
KNotifyConfig *c = config->copy();
QStringList cap = popupServerCapabilities();
if( !cap.contains( "actions" ) )
{
c->actions.clear();
}
if( !cap.contains( "body-markup" ) )
{
if( c->title.startsWith( "<html>" ) )
c->title = stripHtml( config->title );
if( c->text.startsWith( "<html>" ) )
c->text = stripHtml( config->text );
}
return c;
}
QString NotifyByPopup::stripHtml( const QString &text )
{
QXmlStreamReader r( "<elem>" + text + "</elem>" );
HtmlEntityResolver resolver;
r.setEntityResolver( &resolver );
QString result;
while( !r.atEnd() ) {
r.readNext();
if( r.tokenType() == QXmlStreamReader::Characters )
{
result.append( r.text() );
}
else if( r.tokenType() == QXmlStreamReader::StartElement
&& r.name() == "br" )
{
result.append( "\n" );
}
}
if(r.hasError())
{
// XML error in the given text, just return the original string
kWarning() << "Notification to send to backend which does "
"not support HTML, contains invalid XML:"
<< r.errorString() << "line" << r.lineNumber()
<< "col" << r.columnNumber();
return text;
}
return result;
}
QString NotifyByPopup::HtmlEntityResolver::resolveUndeclaredEntity(
const QString &name )
{
QString result =
QXmlStreamEntityResolver::resolveUndeclaredEntity(name);
if( !result.isEmpty() )
return result;
QChar ent = KCharsets::fromEntity( '&' + name );
if( ent.isNull() ) {
kWarning() << "Notification to send to backend which does "
"not support HTML, contains invalid entity: "
<< name;
ent = ' ';
}
return QString(ent);
}
#include "moc_notifybypopup.cpp"

View file

@ -1,128 +0,0 @@
/*
Copyright (C) 2005-2006 by Olivier Goffart <ogoffart at kde.org>
Copyright (C) 2008 by Dmitry Suzdalev <dimsuz@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef NOTIFYBYPOPUP_H
#define NOTIFYBYPOPUP_H
#include "knotifyplugin.h"
#include <QMap>
#include <QHash>
#include <QStringList>
#include <QXmlStreamEntityResolver>
class KPassivePopup;
class NotifyByPopup : public KNotifyPlugin
{ Q_OBJECT
public:
NotifyByPopup(QObject *parent=0l);
virtual ~NotifyByPopup();
virtual QString optionName() { return "Popup"; }
virtual void notify(int id , KNotifyConfig *config);
virtual void close( int id );
virtual void update(int id, KNotifyConfig *config);
QStringList popupServerCapabilities();
private:
QMap<int, KPassivePopup * > m_popups;
// the y coordinate of the next position popup should appears
int m_nextPosition;
int m_animationTimer;
void fillPopup(KPassivePopup *,int id,KNotifyConfig *config);
/**
* Make sure a popup is completely supported by the notification backend.
* Changes the popup to be compatible if needed.
* @param config the notification data to check
* @return the new notification data allocated with 'new'
*/
KNotifyConfig *ensurePopupCompatibility( const KNotifyConfig *config );
/**
* Removes HTML from a given string. Replaces line breaks with \n and
* HTML entities by their 'normal forms'.
* @param string the HTML to remove.
* @return the cleaned string.
*/
QString stripHtml( const QString &text );
/**
* Sends notification to DBus "/Notifications" interface.
* @param id knotify-sid identifier of notification
* @param replacesId knotify-side notification identifier. If not 0, will
* request DBus service to replace existing notification with data in config
* @param config notification data
* @return true for success or false if there was an error.
*/
bool sendNotificationDBus(int id, int replacesId, KNotifyConfig* config);
/**
* Sends request to close Notification with id to DBus "/Notification" interface
* @param id knotify-side notification ID to close
*/
void closeNotificationDBus(int id);
/**
* Specifies if DBus Notifications interface exists on session bus
*/
bool m_dbusServiceExists;
/**
* DBus notification daemon capabilities cache.
* Do not use this variable. Use #popupServerCapabilities() instead.
* @see popupServerCapabilities
*/
QStringList m_dbusServiceCapabilities;
/**
* Whether the DBus notification daemon capability cache is up-to-date.
*/
bool m_dbusServiceCapCacheDirty;
/**
* Find the caption and the icon name of the application
*/
void getAppCaptionAndIconName(KNotifyConfig *config, QString *appCaption, QString *iconName);
protected:
void timerEvent(QTimerEvent *event);
private Q_SLOTS:
void slotPopupDestroyed();
void slotLinkClicked(const QString & );
// slot to catch appearance or dissapearance of Notifications DBus service
void slotServiceOwnerChanged(const QString &, const QString &, const QString &);
// slot which gets called when DBus signals that some notification action was invoked
void slotDBusNotificationActionInvoked(uint, const QString&);
// slot which gets called when DBus signals that some notification was closed
void slotDBusNotificationClosed(uint, uint);
private:
/**
* Maps knotify notification IDs to DBus notifications IDs
*/
QHash<int,uint> m_idMap;
/**
* A class for resolving HTML entities in XML documents (used
* during HTML stripping)
*/
class HtmlEntityResolver : public QXmlStreamEntityResolver
{
QString resolveUndeclaredEntity( const QString &name );
};
};
#endif

View file

@ -1,161 +0,0 @@
/*
Copyright (c) 1997 Christian Esken (esken@kde.org)
2000 Charles Samuels (charles@kde.org)
2000 Stefan Schimanski (1Stein@gmx.de)
2000 Matthias Ettrich (ettrich@kde.org)
2000 Waldo Bastian <bastian@kde.org>
2000-2003 Carsten Pfeiffer <pfeiffer@kde.org>
2005 Allan Sandfeld Jensen <kde@carewolf.com>
2005-2006 by Olivier Goffart <ogoffart at kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "notifybysound.h"
// QT headers
#include <QtCore/QTimer>
#include <QtCore/QQueue>
#include <QtCore/qcoreevent.h>
#include <QtCore/QStack>
#include <QSignalMapper>
// KDE headers
#include <kdebug.h>
#include <klocale.h>
#include <kstandarddirs.h>
#include <kconfiggroup.h>
#include <kurl.h>
#include <config-workspace.h>
#include <kcomponentdata.h>
#include <knotifyconfig.h>
#include <kmediaplayer.h>
class NotifyBySound::Private
{
public:
bool noSound;
QMap<int, KAudioPlayer*> playerObjects;
QSignalMapper *signalmapper;
QQueue<int> closeQueue;
};
NotifyBySound::NotifyBySound(QObject *parent) : KNotifyPlugin(parent),d(new Private)
{
d->signalmapper = new QSignalMapper(this);
connect(d->signalmapper, SIGNAL(mapped(int)), this, SLOT(slotSoundFinished(int)));
loadConfig();
}
NotifyBySound::~NotifyBySound()
{
delete d;
}
void NotifyBySound::loadConfig()
{
// load player settings
KSharedConfig::Ptr kc = KGlobal::config();
KConfigGroup cg(kc, "Sounds");
d->noSound = cg.readEntry( "No sound" , false );
}
void NotifyBySound::notify( int eventId, KNotifyConfig * config )
{
if (d->noSound) {
finish( eventId );
return;
}
if (d->playerObjects.contains(eventId)) {
//a sound is already playing for this notification, we don't support playing two sounds.
finish( eventId );
return;
}
KUrl soundFileURL = config->readEntry( "Sound" , true );
QString soundFile = soundFileURL.toLocalFile();
if (soundFile.isEmpty()) {
finish( eventId );
return;
}
// get file name
if (KUrl::isRelativeUrl(soundFile)) {
QString search = QString("%1/sounds/%2").arg(config->appname).arg(soundFile);
search = KGlobal::mainComponent().dirs()->findResource("data", search);
if ( search.isEmpty() ) {
soundFile = KStandardDirs::locate( "sound", soundFile );
} else {
soundFile = search;
}
}
if ( soundFile.isEmpty() ) {
finish( eventId );
return;
}
kDebug() << " going to play " << soundFile;
if (!d->noSound) {
kDebug() << "creating new player";
KAudioPlayer *player = new KAudioPlayer(this);
player->setPlayerID("knotify");
connect(player, SIGNAL(finished()), d->signalmapper, SLOT(map()));
d->signalmapper->setMapping(player, eventId);
d->playerObjects.insert(eventId, player);
player->load(soundFile);
}
}
void NotifyBySound::slotSoundFinished(int id)
{
kDebug() << id;
if (d->playerObjects.contains(id)) {
KAudioPlayer *player = d->playerObjects.take(id);
disconnect(player, SIGNAL(finished()), d->signalmapper, SLOT(map()));
kDebug() << "destroying idle player";
player->deleteLater();
}
finish(id);
}
void NotifyBySound::close(int id)
{
// close in 1 min - ugly workaround for sounds getting cut off because the close call in kdelibs
// is hardcoded to 6 seconds
d->closeQueue.enqueue(id);
QTimer::singleShot(60000, this, SLOT(closeNow()));
}
void NotifyBySound::closeNow()
{
const int id = d->closeQueue.dequeue();
if (d->playerObjects.contains(id)) {
KAudioPlayer *player = d->playerObjects.value(id);
player->stop();
}
}
#include "moc_notifybysound.cpp"
// vim: ts=4 noet

View file

@ -1,52 +0,0 @@
/*
Copyright (C) 2005-2006 by Olivier Goffart <ogoffart at kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef NOTIFYBYSOUND_H
#define NOTIFYBYSOUND_H
#include "knotifyplugin.h"
class NotifyBySound : public KNotifyPlugin
{ Q_OBJECT
public:
NotifyBySound(QObject *parent=0l);
virtual ~NotifyBySound();
virtual QString optionName() { return "Sound"; }
virtual void notify(int id , KNotifyConfig *config);
virtual void close(int id);
private:
class Private;
Private* const d;
void loadConfig();
public:
void setVolume( int v );
private Q_SLOTS:
void slotSoundFinished(int id);
void closeNow();
};
#endif

View file

@ -1,49 +0,0 @@
/*
Copyright (C) 2005-2006 by Olivier Goffart <ogoffart at kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "notifybytaskbar.h"
#include <kdebug.h>
#include <kwindowsystem.h>
#include <knotifyconfig.h>
NotifyByTaskbar::NotifyByTaskbar(QObject *parent) : KNotifyPlugin(parent)
{
}
NotifyByTaskbar::~NotifyByTaskbar()
{
}
void NotifyByTaskbar::notify( int id, KNotifyConfig * config )
{
kDebug() << id << config->winId ;
WId win = config->winId;
if( win != 0 )
KWindowSystem::demandAttention( win );
finish( id );
}
#include "moc_notifybytaskbar.cpp"

View file

@ -1,39 +0,0 @@
/*
Copyright (C) 2005-2006 by Olivier Goffart <ogoffart at kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef NOTIFYBYTASKBAR_H
#define NOTIFYBYTASKBAR_H
#include "knotifyplugin.h"
class NotifyByTaskbar : public KNotifyPlugin
{ Q_OBJECT
public:
NotifyByTaskbar(QObject *parent=0l);
virtual ~NotifyByTaskbar();
virtual QString optionName() { return "Taskbar"; }
virtual void notify(int id , KNotifyConfig *config);
};
#endif

View file

@ -1,3 +0,0 @@
[D-BUS Service]
Name=org.kde.knotify
Exec=@KDE4_BIN_INSTALL_DIR@/knotify4

View file

@ -1,6 +1,5 @@
FILE(GLOB _oggfile "*.ogg" )
install(FILES ${_oggfile}
DESTINATION ${KDE4_SOUND_INSTALL_DIR} )
install(
FILES ${_oggfile}
DESTINATION ${KDE4_SOUND_INSTALL_DIR}
)

View file

@ -22,9 +22,13 @@ install(
install(
FILES
konsole.notifyrc
konsoleui.rc
sessionui.rc
partui.rc
DESTINATION ${KDE4_DATA_INSTALL_DIR}/konsole
)
install(
FILES konsole.notifyrc
DESTINATION ${KDE4_CONFIG_INSTALL_DIR}/notifications
)

View file

@ -1,4 +1,4 @@
[Global]
[konsole]
IconName=utilities-terminal
Comment=Konsole
Comment[af]=Konsole
@ -91,7 +91,7 @@ Comment[x-test]=xxKonsolexx
Comment[zh_CN]=Konsole
Comment[zh_TW]=Konsole
[Event/BellVisible]
[konsole/BellVisible]
Name=Bell in Visible Session
Name[af]=Klokkie in die sigbare sessie
Name[ar]=جرس في جلسة ظاهرة
@ -257,9 +257,9 @@ Comment[wa]=Cloke ki sone divins ene veyåve session
Comment[x-test]=xxBell emitted within a visible sessionxx
Comment[zh_CN]=可见会话中发生的响铃
Comment[zh_TW]=可見工作階段中的響鈴行為
Action=None
Actions=
[Event/BellInvisible]
[konsole/BellInvisible]
Name=Bell in Non-Visible Session
Name[af]=Klokkie in nie-sigbare sessie
Name[ar]=جرس في جلسة غير ظاهرة
@ -425,9 +425,9 @@ Comment[x-test]=xxBell emitted within a non-visible sessionxx
Comment[zh_CN]=不可见会话中发生的响铃
Comment[zh_TW]=非可見工作階段中的響鈴行為
Sound=KDE-Sys-App-Message.ogg
Action=Popup
Actions=Popup
[Event/Activity]
[konsole/Activity]
Name=Activity in Monitored Session
Name[af]=Aktiwiteit in gemonitorde sessie
Name[ar]=نشاط في الجلسة المُراقبة
@ -590,10 +590,10 @@ Comment[wa]=Activité detectêye dins ene corwaiteye session
Comment[x-test]=xxActivity detected in a monitored sessionxx
Comment[zh_CN]=被监视会话中检测到的活动
Comment[zh_TW]=監控工作階段中偵測到的活動
Action=Popup
Actions=Popup
[Event/Silence]
[konsole/Silence]
Name=Silence in Monitored Session
Name[af]=Stilte in gemonitorde sessie
Name[ar]=لسكون في الجلسة المُراقبة
@ -756,9 +756,9 @@ Comment[wa]=Silince detecté dins ene corwaiteye session
Comment[x-test]=xxSilence detected in a monitored sessionxx
Comment[zh_CN]=被监视会话中检测到的缄默
Comment[zh_TW]=監控工作階段中偵測到靜默時的行為
Action=Popup
Actions=Popup
[Event/Finished]
[konsole/Finished]
Name=Session Finished With Non-Zero Status
Name[af]=Sessie het geëindig met nie-zero status
Name[ar]=انتهت الجلسة بحالة غير الصِفر
@ -927,4 +927,4 @@ Comment[wa]=Ene session a moussî foû avou on statut nén zero
Comment[x-test]=xxA session has exited with non-zero statusxx
Comment[zh_CN]=会话以非零状态退出
Comment[zh_TW]=工作階段以不正常狀態(非零值)結束
Action=None
Actions=

View file

@ -125,7 +125,7 @@ add_library(konsoleprivate SHARED ${konsoleprivate_SRCS})
target_link_libraries(konsoleprivate
KDE4::kpty
KDE4::kio
KDE4::knotifyconfig
KDE4::kdeui
${QT_QTXML_LIBRARY}
konq
)

View file

@ -40,7 +40,7 @@
#include <KStandardGuiItem>
#include <KWindowSystem>
#include <KXMLGUIFactory>
#include <KNotifyConfigWidget>
#include <KNotificationConfigWidget>
#include <KConfigDialog>
#include <KApplication>
@ -766,7 +766,7 @@ void MainWindow::setupMainWidget()
void MainWindow::configureNotifications()
{
KNotifyConfigWidget::configure(this);
KNotificationConfigWidget::configure("konsole", this);
}
void MainWindow::setMenuBarInitialVisibility(bool visible)

View file

@ -576,7 +576,7 @@ void Session::silenceTimerDone()
//FIXME: Make message text for this notification and the activity notification more descriptive.
if (_monitorSilence) {
KNotification::event("Silence", i18n("Silence in session '%1'", _nameTitle), QPixmap(),
KNotification::event("konsole/Silence", QString(), i18n("Silence in session '%1'", _nameTitle), QString(),
QApplication::activeWindow(),
KNotification::CloseWhenWidgetActivated);
emit stateChanged(NOTIFYSILENCE);
@ -620,9 +620,11 @@ void Session::activityStateSet(int state)
emit bellRequest(i18n("Bell in session '%1'", _nameTitle));
} else if (state == NOTIFYACTIVITY) {
if (_monitorActivity && !_notifiedActivity) {
KNotification::event("Activity", i18n("Activity in session '%1'", _nameTitle), QPixmap(),
KNotification::event(
"konsole/Activity", QString(), i18n("Activity in session '%1'", _nameTitle), QString(),
QApplication::activeWindow(),
KNotification::CloseWhenWidgetActivated);
KNotification::CloseWhenWidgetActivated
);
// mask activity notification for a while to avoid flooding
_notifiedActivity = true;
@ -821,9 +823,11 @@ void Session::done(int exitCode, QProcess::ExitStatus exitStatus)
message = i18n("Program '%1' exited with status %2.", _program, exitCode);
//FIXME: See comments in Session::silenceTimerDone()
KNotification::event("Finished", message , QPixmap(),
KNotification::event(
"konsole/Finished", QString(), message , QString(),
QApplication::activeWindow(),
KNotification::CloseWhenWidgetActivated);
KNotification::CloseWhenWidgetActivated
);
}
if (exitStatus != QProcess::NormalExit) {

View file

@ -2952,8 +2952,8 @@ void TerminalDisplay::bell(const QString& message)
// Please note that these event names, "BellVisible" and "BellInvisible",
// should not change and should be kept stable, because other applications
// that use this code via KPart rely on these names for notifications.
KNotification::event(hasFocus() ? "BellVisible" : "BellInvisible",
message, QPixmap(), this);
KNotification::event(hasFocus() ? "konsole/BellVisible" : "konsole/BellInvisible",
QString(), message, QString(), this);
break;
case Enum::VisualBell:
visualBell();

View file

@ -366,8 +366,10 @@ void KSMServer::cancelShutdown( KSMClient* c )
Solid::PowerManagement::stopSuppressingSleep(inhibitCookie);
kDebug() << "Client " << c->program() << " (" << c->clientId() << ") canceled shutdown.";
KSMShutdownFeedback::stop(); // make the screen become normal again
KNotification::event( "cancellogout" , i18n( "Logout canceled by '%1'", c->program()),
QPixmap() , 0l , KNotification::DefaultEvent );
KNotification::event(
"kde/cancellogout" , QString(),
i18n("Logout canceled by '%1'", c->program())
);
foreach( KSMClient* c, clients ) {
SmsShutdownCancelled( c->connection() );
if( c->saveYourselfDone ) {
@ -452,7 +454,8 @@ void KSMServer::completeShutdownOrCheckpoint()
if ( state == Shutdown ) {
// KDE says good bye
KNotification *n = KNotification::event( "exitkde" , QString() , QPixmap() , 0l , KNotification::DefaultEvent );
KNotification *n = new KNotification(this);
n->setEventID("kde/exitkde");
connect(n, SIGNAL(closed()) , this, SLOT(logoutSoundFinished()) );
// https://bugs.kde.org/show_bug.cgi?id=228005
// if sound is not working for some reason the closed() signal never happens
@ -462,6 +465,7 @@ void KSMServer::completeShutdownOrCheckpoint()
kDebug() << "Starting logout event";
state = WaitingForKNotify;
createLogoutEffectWidget();
n->send();
} else if ( state == Checkpoint ) {
foreach( KSMClient* c, clients ) {

View file

@ -373,7 +373,7 @@ void KSMServer::autoStart2()
} else {
QMetaObject::invokeMethod(this, "kcmPhase2Done", Qt::QueuedConnection);
}
KNotification::event( "startkde" , QString() , QPixmap() , 0l , KNotification::DefaultEvent ); // this is the time KDE is up, more or less
KNotification::event("kde/startkde"); // this is the time KDE is up, more or less
}
void KSMServer::autoStart2Done()

View file

@ -1,2 +1,9 @@
install( FILES ksysguarddrc DESTINATION ${KDE4_SYSCONF_INSTALL_DIR} )
install( FILES ksysguard.notifyrc DESTINATION ${KDE4_DATA_INSTALL_DIR}/ksysguard )
install(
FILES ksysguarddrc
DESTINATION ${KDE4_SYSCONF_INSTALL_DIR}
)
install(
FILES ksysguard.notifyrc
DESTINATION ${KDE4_CONFIG_INSTALL_DIR}/notifications
)

View file

@ -1,4 +1,4 @@
[Global]
[ksysguard]
IconName=utilities-system-monitor
Comment=System Monitor
Comment[ar]=مراقب النظام
@ -65,7 +65,7 @@ Comment[x-test]=xxSystem Monitorxx
Comment[zh_CN]=系统监视器
Comment[zh_TW]=系統監視器
[Event/pattern_match]
[ksysguard/pattern_match]
Name=Pattern Matched
Name[af]=Patroon gevind
Name[ar]=تطابق النموذج
@ -227,7 +227,7 @@ Comment[x-test]=xxSearch pattern matchedxx
Comment[zh_CN]=搜索匹配的模式
Comment[zh_TW]=搜尋樣式比對符合
[Event/sensor_alarm]
[ksysguard/sensor_alarm]
Name=Sensor Alarm
Name[af]=Sensor Alarm
Name[ar]=إنذار المِجَسّ

View file

@ -267,7 +267,7 @@ LogFile::answerReceived(int id, const QList<QByteArray>& answer)
for (QStringList::Iterator it = filterRules.begin(); it != filterRules.end(); ++it) {
QRegExp *expr = new QRegExp((*it).toLatin1());
if (expr->indexIn(s) != -1) {
KNotification::event("pattern_match", QString("rule '%1' matched").arg(*it),QPixmap(),this);
KNotification::event("ksysguard/pattern_match", QString(), QString("rule '%1' matched").arg(*it),QString(),this);
}
delete expr;
}

View file

@ -367,8 +367,11 @@ void LogSensor::answerReceived( int id, const QList<QByteArray>& answer ) //virt
mLimitReached = true;
// send notification
KNotification::event( "sensor_alarm", QString( "sensor '%1' at '%2' reached lower limit" )
.arg( mSensorName ).arg( mHostName), QPixmap(), 0 );
KNotification::event(
"ksysguard/sensor_alarm",
QString(),
QString("sensor '%1' at '%2' reached lower limit").arg(mSensorName).arg(mHostName)
);
timerOn();
} else if ( mUpperLimitActive && value > mUpperLimit ) {
@ -376,8 +379,11 @@ void LogSensor::answerReceived( int id, const QList<QByteArray>& answer ) //virt
mLimitReached = true;
// send notification
KNotification::event( "sensor_alarm", QString( "sensor '%1' at '%2' reached upper limit" )
.arg( mSensorName).arg( mHostName), QPixmap(), 0 );
KNotification::event(
"ksysguard/sensor_alarm",
QString(),
QString( "sensor '%1' at '%2' reached upper limit" ).arg(mSensorName).arg(mHostName)
);
timerOn();
} else {

View file

@ -127,8 +127,11 @@ TouchpadEnablerDaemonPrivate::TouchpadEnablerDaemonPrivate()
}
}
} else {
KNotification *notification = KNotification::event(KNotification::Warning, i18n("Touchpad status"), i18n("More than one touchpad detected. Touchpad Enabler Daemon does not handle this configuration"));
notification->sendEvent();
KNotification::event(
"ktouchpadenabler",
i18n("Touchpad status"),
i18n("More than one touchpad detected. Touchpad Enabler Daemon does not handle this configuration")
);
}
} else {
kDebug() << "Did not find a touchpad";
@ -169,8 +172,11 @@ bool TouchpadEnablerDaemonPrivate::x11Event(XEvent *event)
if (newValue != currentlyEnabled) {
setEnabled(newValue);
KNotification *notification = KNotification::event(KNotification::Notification, i18n("Touchpad status"), newValue ? i18n("Touchpad enabled") : i18n("Touchpad disabled"));
notification->sendEvent();
KNotification::event(
"ktouchpadenabler",
i18n("Touchpad status"),
newValue ? i18n("Touchpad enabled") : i18n("Touchpad disabled")
);
ktouchpadenabler::Settings::self()->setTouchpadEnabled(newValue);
ktouchpadenabler::Settings::self()->writeConfig();

View file

@ -204,7 +204,7 @@ install(
install(
FILES kwin.notifyrc
DESTINATION ${KDE4_DATA_INSTALL_DIR}/kwin
DESTINATION ${KDE4_CONFIG_INSTALL_DIR}/notifications
)
install(

View file

@ -338,7 +338,7 @@ void Compositor::toggleCompositing()
// display notification only if there is the shortcut
message = i18n("Desktop effects have been suspended by another application.<br/>"
"You can resume using the '%1' shortcut.", shortcut);
KNotification::event("compositingsuspendeddbus", message);
KNotification::event("kwin/compositingsuspendeddbus", message);
}
}
}

View file

@ -1,4 +1,4 @@
[Global]
[kwin]
IconName=kwin
Comment=KWin Window Manager
Comment[ar]=مدير النوافذ كوين
@ -65,7 +65,7 @@ Comment[x-test]=xxKWin Window Managerxx
Comment[zh_CN]=KWin 窗口管理器
Comment[zh_TW]=KWin 視窗管理員
[Event/compositingsuspendeddbus]
[kwin/compositingsuspendeddbus]
Name=Compositing has been suspended
Name[ar]=عُلِّق التركيب
Name[ast]=Finóse la composición
@ -193,4 +193,4 @@ Comment[wa]=Èn ôte programe a dmandé d' djoker l' môde compôzite.
Comment[x-test]=xxAnother application has requested to suspend compositing.xx
Comment[zh_CN]=另一个应用程序已经请求中断混成操作。
Comment[zh_TW]=另一個應用程式要求暫停組合效能。
Action=Popup
Actions=Popup

View file

@ -226,7 +226,7 @@ void KonqOperations::_del( Operation method, const KUrl::List & _selectedUrls, C
QDataStream stream( &packedArgs, QIODevice::WriteOnly );
stream << (int)1;
job = KIO::special( KUrl("trash:/"), packedArgs );
KNotification::event("Trash: emptied", QString() , QPixmap() , 0l, KNotification::DefaultEvent );
KNotification::event("kde/TrashEmptied");
break;
}
case DEL:

View file

@ -234,7 +234,7 @@ void Trash::emptyFinished(int exitCode, QProcess::ExitStatus exitStatus)
Q_UNUSED(exitCode)
Q_UNUSED(exitStatus)
KNotification::event("Trash: emptied", QString() , QPixmap() , 0l, KNotification::DefaultEvent );
KNotification::event("kde/TrashEmptied");
//TODO: check the exit status and let the user know if it fails
delete m_emptyProcess;

View file

@ -8,7 +8,7 @@ qt4_add_dbus_adaptor( notifications_engine_SRCS org.freedesktop.Notifications.xm
kde4_add_plugin(plasma_engine_notifications ${notifications_engine_SRCS})
target_link_libraries(plasma_engine_notifications KDE4::plasma KDE4::kdecore KDE4::knotifyconfig)
target_link_libraries(plasma_engine_notifications KDE4::plasma KDE4::kdecore KDE4::kdeui)
install(TARGETS plasma_engine_notifications DESTINATION ${KDE4_PLUGIN_INSTALL_DIR})
install(FILES plasma-dataengine-notifications.desktop DESTINATION ${KDE4_SERVICES_INSTALL_DIR})

View file

@ -24,7 +24,7 @@
#include <KDebug>
#include <KConfigGroup>
#include <KGlobal>
#include <KNotifyConfigWidget>
#include <KNotificationConfigWidget>
#include <KStandardDirs>
#include <KIconLoader>
@ -305,7 +305,7 @@ int NotificationsEngine::createNotification(const QString &appName, const QStrin
void NotificationsEngine::configureNotification(const QString &appName)
{
KNotifyConfigWidget::configure(0, appName);
KNotificationConfigWidget::configure(appName, nullptr);
}
K_EXPORT_PLASMA_DATAENGINE(notifications, NotificationsEngine)