-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: compatible with old notification center
Register old dbus service to response Shortcut keys. also we can replace the action in dde-daemon, https://github.com/linuxdeepin/dde-daemon/blob/master/misc/dde-daemon/keybinding/system_actions.json#L88 task: https://pms.uniontech.com/task-view-365219.html
- Loading branch information
1 parent
6bdccd5
commit 5663879
Showing
9 changed files
with
149 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
panels/notification/center/notificationcenterdbusadaptor.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
#include "notificationcenterdbusadaptor.h" | ||
#include "notificationcenterproxy.h" | ||
|
||
namespace notification { | ||
|
||
NotificationCenterDBusAdaptor::NotificationCenterDBusAdaptor(QObject *parent) | ||
: QDBusAbstractAdaptor(parent) | ||
{ | ||
setAutoRelaySignals(true); | ||
} | ||
|
||
void NotificationCenterDBusAdaptor::Toggle() | ||
{ | ||
return impl()->Toggle(); | ||
} | ||
|
||
void NotificationCenterDBusAdaptor::Show() | ||
{ | ||
return impl()->Show(); | ||
} | ||
|
||
void NotificationCenterDBusAdaptor::Hide() | ||
{ | ||
return impl()->Hide(); | ||
} | ||
|
||
NotificationCenterProxy *NotificationCenterDBusAdaptor::impl() const | ||
{ | ||
return qobject_cast<NotificationCenterProxy *>(parent()); | ||
} | ||
|
||
} // notification |
30 changes: 30 additions & 0 deletions
30
panels/notification/center/notificationcenterdbusadaptor.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
#pragma once | ||
|
||
#include <QDBusVariant> | ||
#include <QDBusAbstractAdaptor> | ||
|
||
namespace notification { | ||
|
||
class NotificationCenterProxy; | ||
class NotificationCenterDBusAdaptor : public QDBusAbstractAdaptor | ||
{ | ||
Q_OBJECT | ||
Q_CLASSINFO("D-Bus Interface", "org.deepin.dde.Widgets1") | ||
|
||
public: | ||
explicit NotificationCenterDBusAdaptor(QObject *parent = nullptr); | ||
|
||
public Q_SLOTS: // methods | ||
void Toggle(); | ||
void Show(); | ||
void Hide(); | ||
|
||
private: | ||
NotificationCenterProxy *impl() const; | ||
}; | ||
|
||
} // notification |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ | |
add_library(osdpanel SHARED | ||
osdpanel.cpp | ||
osdpanel.h | ||
osddbusadaptor.h | ||
osddbusadaptor.cpp | ||
test.sh | ||
) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
#include "osddbusadaptor.h" | ||
#include "osdpanel.h" | ||
|
||
namespace osd { | ||
|
||
OsdDBusAdaptor::OsdDBusAdaptor(QObject *parent) | ||
: QDBusAbstractAdaptor(parent) | ||
{ | ||
setAutoRelaySignals(true); | ||
} | ||
|
||
void OsdDBusAdaptor::ShowOSD(const QString &text) | ||
{ | ||
return impl()->ShowOSD(text); | ||
} | ||
|
||
OsdPanel *OsdDBusAdaptor::impl() const | ||
{ | ||
return qobject_cast<OsdPanel *>(parent()); | ||
} | ||
|
||
} // osd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
#pragma once | ||
|
||
#include <QDBusVariant> | ||
#include <QDBusAbstractAdaptor> | ||
|
||
namespace osd { | ||
|
||
class OsdPanel; | ||
class OsdDBusAdaptor : public QDBusAbstractAdaptor | ||
{ | ||
Q_OBJECT | ||
Q_CLASSINFO("D-Bus Interface", "org.deepin.dde.Osd1") | ||
|
||
public: | ||
explicit OsdDBusAdaptor(QObject *parent = nullptr); | ||
|
||
public Q_SLOTS: // methods | ||
void ShowOSD(const QString &text); | ||
|
||
private: | ||
OsdPanel *impl() const; | ||
}; | ||
|
||
} // osd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters