!4 使用应用管理组件接口打开第三方应用
This commit is contained in:
parent
9c4a89f1a0
commit
5a13b51ec9
|
@ -305,6 +305,9 @@ void KeyboardMain::keyTipsSlot(bool checked)
|
|||
|
||||
void KeyboardMain::inputMethodSetSlot()
|
||||
{
|
||||
QProcess process;
|
||||
process.startDetached("fcitx-config-gtk3");
|
||||
QDBusInterface ifc("com.kylin.AppManager",
|
||||
"/com/kylin/AppManager",
|
||||
"com.kylin.AppManager",
|
||||
QDBusConnection::sessionBus());
|
||||
ifc.call("LaunchApp", "/usr/share/applications/fcitx-config-gtk3.desktop");
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <QPushButton>
|
||||
#include <QProcess>
|
||||
#include <QDebug>
|
||||
#include <QtDBus/QDBusInterface>
|
||||
|
||||
#include "../../../shell/component/Label/titlelabel.h"
|
||||
|
||||
|
|
|
@ -240,18 +240,12 @@ void Printer::refreshPrinterDevSlot()
|
|||
|
||||
void Printer::runExternalApp()
|
||||
{
|
||||
if (Utils::isTablet()) {
|
||||
QDBusInterface ifc("com.kylin.AppManager",
|
||||
"/com/kylin/AppManager",
|
||||
"com.kylin.AppManager",
|
||||
QDBusConnection::sessionBus());
|
||||
|
||||
ifc.call("LaunchApp", "/usr/share/applications/system-config-printer.desktop");
|
||||
} else {
|
||||
QString cmd = "system-config-printer";
|
||||
QProcess process(this);
|
||||
process.startDetached(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
void Printer::clearAutoItem()
|
||||
|
|
|
@ -89,7 +89,9 @@ void Vpn::initComponent(){
|
|||
}
|
||||
|
||||
void Vpn::runExternalApp(){
|
||||
QString cmd = "nm-connection-editor";
|
||||
QProcess process(this);
|
||||
process.startDetached(cmd);
|
||||
QDBusInterface ifc("com.kylin.AppManager",
|
||||
"/com/kylin/AppManager",
|
||||
"com.kylin.AppManager",
|
||||
QDBusConnection::sessionBus());
|
||||
ifc.call("LaunchApp", "/usr/share/applications/nm-connection-editor.desktop");
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include <QObject>
|
||||
#include <QtPlugin>
|
||||
#include <QtDBus/QDBusInterface>
|
||||
|
||||
#include "shell/interface.h"
|
||||
#include "../../../shell/component/AddBtn/addbtn.h"
|
||||
|
|
|
@ -131,7 +131,11 @@ void Screenlock::initSearchText() {
|
|||
ui->onlineBtn->setCursor( QCursor(Qt::PointingHandCursor));
|
||||
ui->onlineBtn->setStyleSheet("QPushButton{background: transparent;border-radius: 4px;text-decoration: underline;} ");
|
||||
connect( ui->onlineBtn, &QPushButton::clicked, this,[=] {
|
||||
QDesktopServices::openUrl(QUrl(QLatin1String("https://www.ubuntukylin.com/wallpaper.html")));
|
||||
QDBusInterface ifc("com.kylin.AppManager",
|
||||
"/com/kylin/AppManager",
|
||||
"com.kylin.AppManager",
|
||||
QDBusConnection::sessionBus());
|
||||
ifc.call("LaunchDefaultAppWithUrl", "https://www.ubuntukylin.com/wallpaper.html");
|
||||
});
|
||||
//~ contents_path /Screenlock/Reset To Default
|
||||
ui->resetBtn->setText(tr("Reset To Default"));
|
||||
|
|
|
@ -138,7 +138,11 @@ void Wallpaper::initSearchText() {
|
|||
ui->onlineBtn->setCursor( QCursor(Qt::PointingHandCursor));
|
||||
ui->onlineBtn->setStyleSheet("QPushButton{background: transparent;border-radius: 4px;text-decoration: underline;} ");
|
||||
connect( ui->onlineBtn, &QPushButton::clicked, this,[=] {
|
||||
QDesktopServices::openUrl(QUrl(QLatin1String("https://www.ubuntukylin.com/wallpaper.html")));
|
||||
QDBusInterface ifc("com.kylin.AppManager",
|
||||
"/com/kylin/AppManager",
|
||||
"com.kylin.AppManager",
|
||||
QDBusConnection::sessionBus());
|
||||
ifc.call("LaunchDefaultAppWithUrl", "https://www.ubuntukylin.com/wallpaper.html");
|
||||
});
|
||||
//~ contents_path /Wallpaper/Reset To Default
|
||||
ui->resetBtn->setText(tr("Reset To Default"));
|
||||
|
|
Loading…
Reference in New Issue