Changeset View
Changeset View
Standalone View
Standalone View
greeter/greeterapp.cpp
Show First 20 Lines • Show All 661 Lines • ▼ Show 20 Line(s) | |||||
662 | } | 662 | } | ||
663 | 663 | | |||
664 | static void canHibernate(void *data, org_kde_ksld *org_kde_ksld, uint hibernate) | 664 | static void canHibernate(void *data, org_kde_ksld *org_kde_ksld, uint hibernate) | ||
665 | { | 665 | { | ||
666 | Q_UNUSED(org_kde_ksld) | 666 | Q_UNUSED(org_kde_ksld) | ||
667 | reinterpret_cast<UnlockApp*>(data)->updateCanHibernate(hibernate); | 667 | reinterpret_cast<UnlockApp*>(data)->updateCanHibernate(hibernate); | ||
668 | } | 668 | } | ||
669 | 669 | | |||
670 | static void notify(void *data, org_kde_ksld *org_kde_ksld, uint id, const char *app_name, | ||||
671 | uint replaces_id, const char *app_icon, const char *summary, const char *body, int timeout) | ||||
672 | { | ||||
673 | Q_UNUSED(org_kde_ksld) | ||||
674 | reinterpret_cast<UnlockApp*>(data)->notification(id, QString::fromUtf8(app_name), replaces_id, | ||||
675 | QString::fromUtf8(app_icon), QString::fromUtf8(summary), | ||||
676 | QString::fromUtf8(body), timeout); | ||||
677 | } | ||||
678 | | ||||
670 | static const struct org_kde_ksld_listener s_listener { | 679 | static const struct org_kde_ksld_listener s_listener { | ||
671 | osdProgress, | 680 | osdProgress, | ||
672 | osdText, | 681 | osdText, | ||
673 | canSuspend, | 682 | canSuspend, | ||
674 | canHibernate | 683 | canHibernate, | ||
684 | notify | ||||
675 | }; | 685 | }; | ||
676 | 686 | | |||
677 | void UnlockApp::setKsldSocket(int socket) | 687 | void UnlockApp::setKsldSocket(int socket) | ||
678 | { | 688 | { | ||
679 | using namespace KWayland::Client; | 689 | using namespace KWayland::Client; | ||
680 | m_ksldConnection = new ConnectionThread; | 690 | m_ksldConnection = new ConnectionThread; | ||
681 | m_ksldConnection->setSocketFd(socket); | 691 | m_ksldConnection->setSocketFd(socket); | ||
682 | 692 | | |||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | 730 | for (auto v : qAsConst(m_views)) { | |||
725 | osd->setProperty("osdValue", percent); | 735 | osd->setProperty("osdValue", percent); | ||
726 | osd->setProperty("osdAdditionalText", additionalText); | 736 | osd->setProperty("osdAdditionalText", additionalText); | ||
727 | osd->setProperty("showingProgress", true); | 737 | osd->setProperty("showingProgress", true); | ||
728 | osd->setProperty("icon", icon); | 738 | osd->setProperty("icon", icon); | ||
729 | QMetaObject::invokeMethod(osd, "show"); | 739 | QMetaObject::invokeMethod(osd, "show"); | ||
730 | } | 740 | } | ||
731 | } | 741 | } | ||
732 | 742 | | |||
743 | void UnlockApp::notification(uint id, const QString& appName, uint replacesId, const QString& appIcon, const QString& summary, const QString& body, int timeout) | ||||
744 | { | ||||
745 | qDebug() << "dummy"; | ||||
746 | } | ||||
747 | | ||||
748 | | ||||
733 | void UnlockApp::osdText(const QString &icon, const QString &additionalText) | 749 | void UnlockApp::osdText(const QString &icon, const QString &additionalText) | ||
734 | { | 750 | { | ||
735 | for (auto v : qAsConst(m_views)) { | 751 | for (auto v : qAsConst(m_views)) { | ||
736 | auto osd = v->rootObject()->findChild<QQuickItem*>(QStringLiteral("onScreenDisplay")); | 752 | auto osd = v->rootObject()->findChild<QQuickItem*>(QStringLiteral("onScreenDisplay")); | ||
737 | if (!osd) { | 753 | if (!osd) { | ||
738 | continue; | 754 | continue; | ||
739 | } | 755 | } | ||
740 | osd->setProperty("showingProgress", false); | 756 | osd->setProperty("showingProgress", false); | ||
Show All 32 Lines |