Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Depends:
qml6-module-qtquick-layouts,
qml6-module-qtquick-window,
qt6-wayland (>= 6.8),
dde-application-manager (>> 1.2.51),
dde-application-manager (>> 1.2.54),
${misc:Depends},
${shlibs:Depends},
Breaks:
Expand Down
34 changes: 22 additions & 12 deletions panels/dock/dockpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,20 @@
// for old api compatible
#include "dockdbusproxy.h"
#include "dockfrontadaptor.h"
#include "dockdaemonadaptor.h"

Check warning on line 17 in panels/dock/dockpanel.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "dockdaemonadaptor.h" not found.
#include "loadtrayplugins.h"

#include <DDBusSender>
#include <QQuickWindow>
#include <QLoggingCategory>
#include <DGuiApplicationHelper>

Check warning on line 20 in panels/dock/dockpanel.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <DGuiApplicationHelper> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QGuiApplication>

Check warning on line 21 in panels/dock/dockpanel.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QGuiApplication> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QLoggingCategory>

Check warning on line 22 in panels/dock/dockpanel.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QLoggingCategory> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QProcess>

Check warning on line 23 in panels/dock/dockpanel.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QProcess> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QQuickItem>

Check warning on line 24 in panels/dock/dockpanel.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QQuickItem> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <DGuiApplicationHelper>
#include <QQuickWindow>

Check warning on line 25 in panels/dock/dockpanel.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QQuickWindow> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#include <wayland/xdgactivation.h>

Check warning on line 27 in panels/dock/dockpanel.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <wayland/xdgactivation.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#ifdef HAVE_DDE_API_EVENTLOGGER
#include <dde-api/eventlogger.hpp>

Check warning on line 30 in panels/dock/dockpanel.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <dde-api/eventlogger.hpp> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#endif

#define SETTINGS DockSettings::instance()
Expand Down Expand Up @@ -356,15 +358,23 @@
#endif
}

void DockPanel::openDockSettings() const
void DockPanel::openDockSettings()
{
DDBusSender()
.service(QStringLiteral("org.deepin.dde.ControlCenter1"))
.path(QStringLiteral("/org/deepin/dde/ControlCenter1"))
.interface(QStringLiteral("org.deepin.dde.ControlCenter1"))
.method(QStringLiteral("ShowPage"))
.arg(QStringLiteral("personalization/dock"))
.call();
qCDebug(dockLog) << "openDockSettings";
auto *activation = new ds::XdgActivation(this);
connect(activation, &ds::XdgActivation::tokenReady, this, [activation](const QString &token) {
QStringList args = {"--by-user", "org.deepin.dde.control-center"};
if (!token.isEmpty()) {
qCDebug(dockLog) << "Passing XDG_ACTIVATION_TOKEN to dde-am";
args << "-e" << QStringLiteral("XDG_ACTIVATION_TOKEN=") + token;
}
args << "--"
<< "-p"
<< "personalization/dock";
QProcess::startDetached("dde-am", args);
activation->deleteLater();
});
activation->requestToken();
}

void DockPanel::notifyDockPositionChanged(int offsetX, int offsetY)
Expand Down
2 changes: 1 addition & 1 deletion panels/dock/dockpanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class DockPanel : public DS_NAMESPACE::DPanel, public QDBusContext

bool debugMode() const;

Q_INVOKABLE void openDockSettings() const;
Q_INVOKABLE void openDockSettings();

Q_INVOKABLE void notifyDockPositionChanged(int offsetX, int offsetY);

Expand Down
4 changes: 3 additions & 1 deletion panels/dock/tray/quickpanel/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
# SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
#
# SPDX-License-Identifier: GPL-3.0-or-later

Expand All @@ -24,6 +24,8 @@ qt_add_qml_module(tray-quickpanel

target_link_libraries(tray-quickpanel PRIVATE
Dtk${DTK_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui
dde-shell-frame
)

install(TARGETS tray-quickpanel DESTINATION "${QML_INSTALL_DIR}/org/deepin/ds/dock/tray/quickpanel/")
Expand Down
29 changes: 20 additions & 9 deletions panels/dock/tray/quickpanel/quickpanelproxymodel.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

#include "quickpanelproxymodel.h"

#include <QDebug>
#include <DConfig>

Check warning on line 7 in panels/dock/tray/quickpanel/quickpanelproxymodel.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <DConfig> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <DDBusSender>
#include <QDebug>
#include <QLoggingCategory>
#include <QProcess>

#include <wayland/xdgactivation.h>
DCORE_USE_NAMESPACE

Q_LOGGING_CATEGORY(quickpanelLog, "org.deepin.dde.shell.dock.quickpanel")

namespace dock {
namespace {
enum {
Expand Down Expand Up @@ -46,12 +51,18 @@

void QuickPanelProxyModel::openSystemSettings()
{
DDBusSender()
.service("org.deepin.dde.ControlCenter1")
.interface("org.deepin.dde.ControlCenter1")
.path("/org/deepin/dde/ControlCenter1")
.method(QString("Show"))
.call();
qCDebug(quickpanelLog) << "openSystemSettings";
auto *activation = new ds::XdgActivation(this);
connect(activation, &ds::XdgActivation::tokenReady, this, [activation](const QString &token) {
QStringList args = {"--by-user", "org.deepin.dde.control-center"};
if (!token.isEmpty()) {
qCDebug(quickpanelLog) << "Passing XDG_ACTIVATION_TOKEN to dde-am";
args << "-e" << QStringLiteral("XDG_ACTIVATION_TOKEN=") + token;
}
QProcess::startDetached("dde-am", args);
activation->deleteLater();
});
activation->requestToken();
}

QVariant QuickPanelProxyModel::data(const QModelIndex &index, int role) const
Expand Down
30 changes: 14 additions & 16 deletions panels/notification/center/notifyaccessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
#include <QQmlEngine>
#include <QGuiApplication>
#include <QLoggingCategory>
#include <QDBusInterface>
#include <QDBusPendingReply>
#include <QProcess>
#include <QDBusReply>

#include <DConfig>

#include "dataaccessor.h"
#include <wayland/xdgactivation.h>

DCORE_USE_NAMESPACE

Expand Down Expand Up @@ -210,21 +208,21 @@ bool NotifyAccessor::applicationPin(const QString &appId) const

void NotifyAccessor::openNotificationSetting()
{
qDebug(notifyLog) << "Open notification setting";
QDBusMessage msg = QDBusMessage::createMethodCall("org.deepin.dde.ControlCenter1",
"/org/deepin/dde/ControlCenter1",
"org.deepin.dde.ControlCenter1",
"ShowPage");
msg << "notification";
QDBusPendingCall call = QDBusConnection::sessionBus().asyncCall(msg);
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(call, this);
connect(watcher, &QDBusPendingCallWatcher::finished, this, [this](QDBusPendingCallWatcher *self) {
QDBusReply<void> reply = *self;
if (!reply.isValid()) {
qWarning(notifyLog) << "Failed to open notification setting:" << reply.error().message();
qDebug(notifyLog) << "openNotificationSetting";
auto *activation = new ds::XdgActivation(this);
connect(activation, &ds::XdgActivation::tokenReady, this, [activation](const QString &token) {
QStringList args = {"--by-user", "org.deepin.dde.control-center"};
if (!token.isEmpty()) {
qDebug(notifyLog) << "Passing XDG_ACTIVATION_TOKEN to dde-am";
args << "-e" << QStringLiteral("XDG_ACTIVATION_TOKEN=") + token;
}
self->deleteLater();
args << "--"
<< "-p"
<< "notification";
QProcess::startDetached("dde-am", args);
activation->deleteLater();
});
activation->requestToken();
}

void NotifyAccessor::onNotificationStateChanged(qint64 id, int processedType)
Expand Down
Loading