fix: call dbus error

Change-Id: If0fc0a923f3b464cd0e37af1fb4bb13aa0a9abf0
This commit is contained in:
rekols 2018-04-04 10:04:32 +08:00
parent fdc793749c
commit d651fc9dd1
Notes: gerrit 2018-04-04 02:17:54 +00:00
Code-Review+2: 石博文 <sbw@sbw.so>
Verified+1: Anonymous Coward #1000004
Submitted-by: Rekols <rekols@foxmail.com>
Submitted-at: Wed, 04 Apr 2018 02:17:53 +0000
Reviewed-on: https://cr.deepin.io/33256
Project: dde/dde-dock
Branch: refs/heads/master
3 changed files with 20 additions and 10 deletions

View File

@ -101,7 +101,7 @@ void LauncherItem::mousePressEvent(QMouseEvent *e)
.service("com.deepin.dde.Launcher")
.interface("com.deepin.dde.Launcher")
.path("/com/deepin/dde/Launcher")
.method("com.deepin.dde.Launcher.Toggle")
.method("Toggle")
.call();
}

View File

@ -9,6 +9,7 @@ file(GLOB_RECURSE SRCS "*.h" "*.cpp")
find_package(PkgConfig REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Svg REQUIRED)
find_package(Qt5DBus REQUIRED)
find_package(DtkWidget REQUIRED)
pkg_check_modules(DFrameworkDBus REQUIRED dframeworkdbus)
@ -25,6 +26,7 @@ target_link_libraries(${PLUGIN_NAME} PRIVATE
${DtkWidget_LIBRARIES}
${DFrameworkDBus_LIBRARIES}
${QGSettings_LIBRARIES}
${Qt5DBus_LIBRARIES}
${Qt5Widgets_LIBRARIES}
${Qt5Svg_LIBRARIES}
)

View File

@ -27,6 +27,8 @@
#include <QMouseEvent>
#include <QApplication>
#include <DDBusSender>
// menu actions
#define MUTE "mute"
#define SETTINS "settings"
@ -103,7 +105,13 @@ void SoundItem::invokeMenuItem(const QString menuId, const bool checked)
if (menuId == MUTE)
m_sinkInter->SetMuteQueued(!m_sinkInter->mute());
else if (menuId == SETTINS)
QProcess::startDetached("dbus-send --print-reply --dest=com.deepin.dde.ControlCenter /com/deepin/dde/ControlCenter com.deepin.dde.ControlCenter.ShowModule \"string:sound\"");
DDBusSender()
.service("com.deepin.dde.ControlCenter")
.interface("com.deepin.dde.ControlCenter")
.path("/com/deepin/dde/ControlCenter")
.method(QString("ShowModule"))
.arg(QString("sound"))
.call();
}
QSize SoundItem::sizeHint() const