diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 6568def..64aa92f 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -31,10 +31,4 @@ if( NOT DBUS_TQT_FOUND ) tde_message_fatal( "dbus-1-tqt is required, but was not found on your system" ) endif( ) -##### check for dbus-glib-1 - -pkg_search_module( DBUS-GLIB dbus-glib-1 ) -if( NOT DBUS-GLIB_FOUND ) - tde_message_fatal( "The dbus-glib library is required, but was not found on your system" ) -endif( NOT DBUS-GLIB_FOUND ) diff --git a/README b/README index 990a47a..d82dff2 100644 --- a/README +++ b/README @@ -25,6 +25,8 @@ If you wish to contribute to Kdbusnotification (TDE), you might do so: https://specifications.freedesktop.org/notification-spec/latest/ar01s09.html https://sylvaindurand.org/update-notifications-with-libnotify/ +To test the implementation use following: + gdbus call \ --session \ --dest org.freedesktop.Notifications \ diff --git a/src/daemon/NotificationDaemon.cpp b/src/daemon/NotificationDaemon.cpp index 1c9aa56..1b85654 100644 --- a/src/daemon/NotificationDaemon.cpp +++ b/src/daemon/NotificationDaemon.cpp @@ -1,10 +1,10 @@ /* * NotificationDaemon.cpp * - * Created on: May 11, 2021 - * Author: emanoil + * Copyright (C) 2021 Emanoil Kotsev * - * kdbusnotification Copyright (C) 2009 kdbusnotification development team + * + * This file is part of kdbusnotification. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 @@ -19,6 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include #include #include @@ -52,7 +53,6 @@ NotificationDaemon::~NotificationDaemon() delete freedesktopService; delete orgService; delete rootService; -// delete receiver; } bool NotificationDaemon::isConnectedToDBUS(){ diff --git a/src/daemon/NotificationDaemon.h b/src/daemon/NotificationDaemon.h index bd572c7..8f73ba1 100644 --- a/src/daemon/NotificationDaemon.h +++ b/src/daemon/NotificationDaemon.h @@ -1,10 +1,10 @@ /* * NotificationDaemon.h * - * Created on: May 11, 2021 - * Author: emanoil + * Copyright (C) 2021 Emanoil Kotsev * - * kdbusnotification Copyright (C) 2009 kdbusnotification development team + * + * This file is part of kdbusnotification. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 @@ -19,6 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #ifndef SRC_DAEMON_NOTIFICATIONDAEMON_H_ #define SRC_DAEMON_NOTIFICATIONDAEMON_H_ @@ -78,7 +79,6 @@ private: OrgNodeService *orgService; FreeDesktopNodeService *freedesktopService; NotificationsNodeService *notificationService; -// DBusReceiver *receiver; TQT_DBusConnection mConnection; int retryCount; diff --git a/src/daemon/NotificationsService.cpp b/src/daemon/NotificationsService.cpp index b5bd0ad..77e0962 100644 --- a/src/daemon/NotificationsService.cpp +++ b/src/daemon/NotificationsService.cpp @@ -1,23 +1,26 @@ /* - * PropertiesService.cpp * - * Created on: Feb 7, 2021 - * Author: emanoil + * Notification DBus Service implementation * - * hardwarecontrol Copyright (C) 2009 hardwarecontrol development team + * Copyright (C) 2021 Emanoil Kotsev * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 - * as published by the Free Software Foundation. * - * 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. + * This file is part of kdbusnotification. + * + * kdbusnotification 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. + * + * kdbusnotification 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 kdbusnotification; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "NotificationsService.h" @@ -104,7 +107,7 @@ void NotificationsService::NotifyAsync( notificationMap[id]->setIcon(icon); notificationMap[id]->setPaletteBackgroundColor(TQt::black); notificationMap[id]->setPaletteForegroundColor(TQt::white); - // FXIME: handle hypertext in the body + // TODO: handle hypertext in the body notificationMap[id]->setText(app_name + ": " + summary + "\n" + body); notificationMap[id]->setActions(actions); notificationMap[id]->setHints(hints); diff --git a/src/daemon/NotificationsService.h b/src/daemon/NotificationsService.h index 5e96a05..524d00e 100644 --- a/src/daemon/NotificationsService.h +++ b/src/daemon/NotificationsService.h @@ -1,24 +1,28 @@ /* - * PropertiesService.h * - * Created on: Feb 7, 2021 - * Author: emanoil + * Notification DBus Service implementation * - * hardwarecontrol Copyright (C) 2009 hardwarecontrol development team + * Copyright (C) 2021 Emanoil Kotsev * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 - * as published by the Free Software Foundation. * - * 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. + * This file is part of kdbusnotification. + * + * kdbusnotification 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. + * + * kdbusnotification 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 kdbusnotification; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #ifndef NOTIFICATIONSSERVICE_H_ #define NOTIFICATIONSSERVICE_H_ diff --git a/src/daemon/NotifyWidget.cpp b/src/daemon/NotifyWidget.cpp index 0b304af..a91768b 100644 --- a/src/daemon/NotifyWidget.cpp +++ b/src/daemon/NotifyWidget.cpp @@ -1,10 +1,10 @@ /* * NotifyWidget.cpp * - * Created on: May 14, 2021 - * Author: emanoil + * Copyright (C) 2021 Emanoil Kotsev * - * kdbusnotification Copyright (C) 2009 kdbusnotification development team + * + * This file is part of kdbusnotification. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 diff --git a/src/daemon/NotifyWidget.h b/src/daemon/NotifyWidget.h index 563f3f2..891d5aa 100644 --- a/src/daemon/NotifyWidget.h +++ b/src/daemon/NotifyWidget.h @@ -1,10 +1,10 @@ /* * NotifyWidget.h * - * Created on: May 14, 2021 - * Author: emanoil + * Copyright (C) 2021 Emanoil Kotsev * - * kdbusnotification Copyright (C) 2009 kdbusnotification development team + * + * This file is part of kdbusnotification. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 @@ -19,6 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #ifndef SRC_DAEMON_NOTIFYWIDGET_H_ #define SRC_DAEMON_NOTIFYWIDGET_H_ diff --git a/src/daemon/main.cpp b/src/daemon/main.cpp index dbed5ef..7c3ca9e 100644 --- a/src/daemon/main.cpp +++ b/src/daemon/main.cpp @@ -1,10 +1,10 @@ /* * main.cpp * - * Created on: May 11, 2021 - * Author: emanoil + * Copyright (C) 2021 Emanoil Kotsev * - * kdbusnotification Copyright (C) 2009 kdbusnotification development team + * + * This file is part of kdbusnotification. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 @@ -20,8 +20,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - #include #include #include @@ -49,7 +47,7 @@ main(int argc, char **argv) if (!KUniqueApplication::start()) { - std::cerr << i18n("notification-daemon-tde is already running.\n").local8Bit(); + tqDebug(i18n("notification-daemon-tde is already running.\n").local8Bit()); return 0; } @@ -60,7 +58,7 @@ main(int argc, char **argv) { KMessageBox::error(NULL,i18n("Can't connect to DBus!")); // debug message for testing - std::cerr << i18n("Can't connect to DBus!\n").local8Bit(); + tqDebug(i18n("Can't connect to DBus!\n").local8Bit()); KUniqueApplication::kApplication()->quit(); return 0; } diff --git a/src/daemon/notificationNodeService.cpp b/src/daemon/notificationNodeService.cpp index a028904..8131f6f 100644 --- a/src/daemon/notificationNodeService.cpp +++ b/src/daemon/notificationNodeService.cpp @@ -1,24 +1,24 @@ /* * - * HardwareControl DBus Service implementation + * Notification DBus Service implementation * - * Copyright (C) 2020 Emanoil Kotsev + * Copyright (C) 2021 Emanoil Kotsev * * - * This file is part of tdecore/tdehw. + * This file is part of kdbusnotification. * - * hardwarecontrol is free software; you can redistribute it and/or modify + * kdbusnotification 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. * - * hardwarecontrol is distributed in the hope that it will be useful, + * kdbusnotification 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 tdelibs; if not, write to the Free Software + * along with kdbusnotification; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ diff --git a/src/daemon/notificationNodeService.h b/src/daemon/notificationNodeService.h index 856584d..c87f080 100644 --- a/src/daemon/notificationNodeService.h +++ b/src/daemon/notificationNodeService.h @@ -2,7 +2,7 @@ * * Notification DBus Service implementation * - * Copyright (C) 2020 Emanoil Kotsev + * Copyright (C) 2021 Emanoil Kotsev * * * This file is part of kdbusnotification. diff --git a/src/daemon/notificationdaemon.xml b/src/daemon/notificationdaemon.xml index 0979b1c..eeb39e9 100644 --- a/src/daemon/notificationdaemon.xml +++ b/src/daemon/notificationdaemon.xml @@ -1,3 +1,4 @@ +