diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 62c37a80..fad2fe15 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,215 +1,216 @@ include_directories(${elisa_BINARY_DIR}) if (Qt5Quick_FOUND AND Qt5Widgets_FOUND) set(elisa_SOURCES upnpControl.cpp mediaplaylist.cpp playlistcontroler.cpp musicstatistics.cpp musicalbum.cpp musicaudiotrack.cpp musicartist.cpp progressindicator.cpp albummodel.cpp allalbumsmodel.cpp allartistsmodel.cpp databaseinterface.cpp musiclistenersmanager.cpp managemediaplayercontrol.cpp manageheaderbar.cpp manageaudioplayer.cpp albumfilterproxymodel.cpp trackslistener.cpp elisaapplication.cpp audiowrapper.cpp alltracksmodel.cpp + notificationitem.cpp MediaServer.qml Theme.qml PlatformIntegration.qml LabelWithToolTip.qml windows/WindowsTheme.qml windows/PlatformIntegration.qml android/MediaServer.qml android/AndroidTheme.qml android/PlatformIntegration.qml RatingStar.qml AudioTrackDelegate.qml PlayListEntry.qml MediaAlbumDelegate.qml MediaArtistDelegate.qml MediaBrowser.qml DraggableItem.qml PassiveNotification.qml TopNotification.qml HeaderBar.qml NavigationActionBar.qml MediaPlayerControl.qml ContextView.qml MediaArtistAlbumView.qml MediaPlayListView.qml MediaAlbumView.qml MediaAllAlbumView.qml MediaAllArtistView.qml MediaAllTracksView.qml MediaTracksDelegate.qml ) if (KF5Baloo_FOUND) if (Qt5DBus_FOUND) set(elisa_SOURCES ${elisa_SOURCES} baloo/localbaloofilelisting.cpp baloo/baloolistener.cpp ) qt5_add_dbus_interface(elisa_SOURCES ${CMAKE_INSTALL_PREFIX}/${KDE_INSTALL_DBUSINTERFACEDIR}/org.kde.baloo.fileindexer.xml baloo/fileindexer) qt5_add_dbus_interface(elisa_SOURCES ${CMAKE_INSTALL_PREFIX}/${KDE_INSTALL_DBUSINTERFACEDIR}/org.kde.baloo.scheduler.xml baloo/scheduler) endif() endif() if (Qt5DBus_FOUND) set(elisa_SOURCES ${elisa_SOURCES} mpris2/mpris2.cpp mpris2/mediaplayer2.cpp mpris2/mediaplayer2player.cpp ) endif() if (UPNPQT_FOUND) set(elisa_SOURCES ${elisa_SOURCES} upnp/upnpcontrolcontentdirectory.cpp upnp/upnpcontentdirectorymodel.cpp upnp/upnpcontrolconnectionmanager.cpp upnp/upnpcontrolmediaserver.cpp upnp/didlparser.cpp upnp/upnplistener.cpp upnp/upnpdiscoverallmusic.cpp ) endif() if (KF5FileMetaData_FOUND) set(elisa_SOURCES ${elisa_SOURCES} abstractfile/abstractfilelistener.cpp abstractfile/abstractfilelisting.cpp file/filelistener.cpp file/localfilelisting.cpp ) endif() kconfig_add_kcfg_files(elisa_SOURCES elisa_settings.kcfgc) set(elisa_SOURCES ${elisa_SOURCES} elisa_core.kcfg ) qt5_add_resources(elisa_SOURCES upnpControl.qrc) add_executable(elisa ${elisa_SOURCES}) set_target_properties(elisa PROPERTIES LINK_FLAGS "-Wl,--no-undefined") target_include_directories(elisa PRIVATE ${KDSoap_INCLUDE_DIRS}) target_link_libraries(elisa LINK_PRIVATE Qt5::Quick Qt5::Gui Qt5::Widgets Qt5::Multimedia Qt5::Svg Qt5::Xml Qt5::Sql KF5::I18n KF5::ConfigCore KF5::KCMUtils ) if (Qt5DBus_FOUND) target_link_libraries(elisa LINK_PRIVATE Qt5::DBus ) endif() if (Qt5AndroidExtras_FOUND) target_link_libraries(elisa LINK_PRIVATE Qt5::AndroidExtras ) endif() if (KF5FileMetaData_FOUND) target_link_libraries(elisa LINK_PRIVATE KF5::FileMetaData ) endif() if (KF5CoreAddons_FOUND) target_link_libraries(elisa LINK_PRIVATE KF5::CoreAddons ) endif() if (KF5Baloo_FOUND) target_link_libraries(elisa LINK_PRIVATE KF5::Baloo ) endif() if (KF5Declarative_FOUND) target_link_libraries(elisa LINK_PRIVATE KF5::Declarative ) endif() if (KF5XmlGui_FOUND) target_link_libraries(elisa LINK_PRIVATE KF5::XmlGui ) endif() if (KF5Crash_FOUND) target_link_libraries(elisa LINK_PRIVATE KF5::Crash ) endif() if (UPNPQT_FOUND) target_link_libraries(elisa LINK_PRIVATE UPNP::upnpQt Qt5::Network ) endif() if (KF5DBusAddons_FOUND) target_link_libraries(elisa LINK_PRIVATE KF5::DBusAddons ) endif() endif() install(TARGETS elisa ${INSTALL_TARGETS_DEFAULT_ARGS}) add_subdirectory(localFileConfiguration) diff --git a/src/notificationitem.cpp b/src/notificationitem.cpp new file mode 100644 index 00000000..db871453 --- /dev/null +++ b/src/notificationitem.cpp @@ -0,0 +1,42 @@ +/* + * Copyright 2017 Matthieu Gallien + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This library 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 + * Library 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 "notificationitem.h" + +NotificationItem::NotificationItem(QObject *parent) : QObject(parent) +{ +} + +QString NotificationItem::message() const +{ + return mMessage; +} + +void NotificationItem::setMessage(QString message) +{ + if (mMessage == message) { + return; + } + + mMessage = message; + Q_EMIT messageChanged(mMessage); +} + + +#include "moc_notificationitem.cpp" diff --git a/src/notificationitem.h b/src/notificationitem.h new file mode 100644 index 00000000..796678be --- /dev/null +++ b/src/notificationitem.h @@ -0,0 +1,55 @@ +/* + * Copyright 2017 Matthieu Gallien + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This library 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 + * Library 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 NOTIFICATIONITEM_H +#define NOTIFICATIONITEM_H + +#include + +class NotificationItem : public QObject +{ + + Q_OBJECT + + Q_PROPERTY(QString message + READ message + WRITE setMessage + NOTIFY messageChanged) + +public: + + explicit NotificationItem(QObject *parent = nullptr); + + QString message() const; + +Q_SIGNALS: + + void messageChanged(QString message); + +public Q_SLOTS: + + void setMessage(QString message); + +private: + + QString mMessage; + +}; + +#endif // NOTIFICATIONITEM_H