mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-03 10:14:45 +00:00
Open KClock when the clock is tapped
This commit is contained in:
parent
4942e0e369
commit
766fce50bd
4 changed files with 23 additions and 1 deletions
|
|
@ -15,7 +15,10 @@ target_link_libraries(plasma_applet_phonepanel
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
KF5::Plasma
|
KF5::Plasma
|
||||||
KF5::I18n
|
KF5::I18n
|
||||||
KF5::Notifications)
|
KF5::Notifications
|
||||||
|
KF5::KIOGui
|
||||||
|
KF5::Service
|
||||||
|
)
|
||||||
|
|
||||||
install(TARGETS plasma_applet_phonepanel DESTINATION ${KDE_INSTALL_PLUGINDIR}/plasma/applets)
|
install(TARGETS plasma_applet_phonepanel DESTINATION ${KDE_INSTALL_PLUGINDIR}/plasma/applets)
|
||||||
#install(FILES plasma-phonepanel-default.desktop DESTINATION ${SERVICES_INSTALL_DIR})
|
#install(FILES plasma-phonepanel-default.desktop DESTINATION ${SERVICES_INSTALL_DIR})
|
||||||
|
|
|
||||||
|
|
@ -119,6 +119,12 @@ Item {
|
||||||
horizontalAlignment: Qt.AlignHCenter
|
horizontalAlignment: Qt.AlignHCenter
|
||||||
verticalAlignment: Qt.AlignVCenter
|
verticalAlignment: Qt.AlignVCenter
|
||||||
font.pixelSize: height / 2
|
font.pixelSize: height / 2
|
||||||
|
|
||||||
|
TapHandler {
|
||||||
|
onTapped: {
|
||||||
|
plasmoid.nativeInterface.launchApp("org.kde.kclock");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <KConfigGroup>
|
#include <KConfigGroup>
|
||||||
|
#include <KIO/ApplicationLauncherJob>
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
#include <KNotification>
|
#include <KNotification>
|
||||||
|
|
||||||
|
|
@ -202,6 +203,17 @@ bool PhonePanel::isSystem24HourFormat()
|
||||||
return timeFormat == QStringLiteral(FORMAT24H);
|
return timeFormat == QStringLiteral(FORMAT24H);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PhonePanel::launchApp(const QString &app)
|
||||||
|
{
|
||||||
|
const KService::Ptr appService = KService::serviceByDesktopName(app);
|
||||||
|
if (!appService) {
|
||||||
|
qWarning() << "Could not find" << app;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
auto job = new KIO::ApplicationLauncherJob(appService, this);
|
||||||
|
job->start();
|
||||||
|
}
|
||||||
|
|
||||||
K_PLUGIN_CLASS_WITH_JSON(PhonePanel, "metadata.json")
|
K_PLUGIN_CLASS_WITH_JSON(PhonePanel, "metadata.json")
|
||||||
|
|
||||||
#include "phonepanel.moc"
|
#include "phonepanel.moc"
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ public:
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void executeCommand(const QString &command);
|
void executeCommand(const QString &command);
|
||||||
|
void launchApp(const QString &app);
|
||||||
void toggleTorch();
|
void toggleTorch();
|
||||||
void takeScreenshot();
|
void takeScreenshot();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue