From 61de9ba315db46fc90ba8afb3abb95b2b9a1f28d Mon Sep 17 00:00:00 2001 From: Piyush Aggarwal Date: Wed, 18 Nov 2020 08:48:52 +0530 Subject: [PATCH] deviceindicator: add comments to mark each menu entry --- indicator/deviceindicator.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/indicator/deviceindicator.cpp b/indicator/deviceindicator.cpp index 7d0737acc..b439d84fe 100644 --- a/indicator/deviceindicator.cpp +++ b/indicator/deviceindicator.cpp @@ -62,12 +62,14 @@ DeviceIndicator::DeviceIndicator(DeviceDbusInterface* device) connect(device, SIGNAL(nameChanged(QString)), this, SLOT(setText(QString))); + // Battery status auto battery = new BatteryAction(device); addAction(battery); setWhenAvailable(device->hasPlugin(QStringLiteral("kdeconnect_battery")), [battery](bool available) { battery->setVisible(available); } , this); + // Browse device filesystem auto browse = addAction(QIcon::fromTheme(QStringLiteral("document-open-folder")), i18n("Browse device")); connect(browse, &QAction::triggered, device, [device](){ SftpDbusInterface* sftpIface = new SftpDbusInterface(device->id(), device); @@ -76,6 +78,7 @@ DeviceIndicator::DeviceIndicator(DeviceDbusInterface* device) }); setWhenAvailable(device->hasPlugin(QStringLiteral("kdeconnect_sftp")), [browse](bool available) { browse->setVisible(available); }, this); + // Find device auto findDevice = addAction(QIcon::fromTheme(QStringLiteral("irc-voice")), i18n("Ring device")); connect(findDevice, &QAction::triggered, device, [device](){ FindMyPhoneDeviceDbusInterface* iface = new FindMyPhoneDeviceDbusInterface(device->id(), device); @@ -84,6 +87,7 @@ DeviceIndicator::DeviceIndicator(DeviceDbusInterface* device) }); setWhenAvailable(device->hasPlugin(QStringLiteral("kdeconnect_findmyphone")), [findDevice](bool available) { findDevice->setVisible(available); }, this); + // Send file auto sendFile = addAction(QIcon::fromTheme(QStringLiteral("document-share")), i18n("Send file")); connect(sendFile, &QAction::triggered, device, [device, this](){ const QUrl url = QFileDialog::getOpenFileUrl(parentWidget(), i18n("Select file to send to '%1'", device->name()), QUrl::fromLocalFile(QDir::homePath())); @@ -97,7 +101,7 @@ DeviceIndicator::DeviceIndicator(DeviceDbusInterface* device) setWhenAvailable(device->hasPlugin(QStringLiteral("kdeconnect_share")), [sendFile](bool available) { sendFile->setVisible(available); }, this); - // Search current application path + // SMS Messages const QString kdeconnectsmsExecutable = QStandardPaths::findExecutable(QStringLiteral("kdeconnect-sms"), { QCoreApplication::applicationDirPath() }); if (!kdeconnectsmsExecutable.isEmpty()) { auto smsapp = addAction(QIcon::fromTheme(QStringLiteral("message-new")), i18n("SMS Messages...")); @@ -107,6 +111,7 @@ DeviceIndicator::DeviceIndicator(DeviceDbusInterface* device) setWhenAvailable(device->hasPlugin(QStringLiteral("kdeconnect_sms")), [smsapp](bool available) { smsapp->setVisible(available); }, this); } + // Run command QMenu* remoteCommandsMenu = new QMenu(i18n("Run command"), this); QAction* menuAction = remoteCommandsMenu->menuAction(); QAction* addCommandAction = remoteCommandsMenu->addAction(QIcon::fromTheme(QStringLiteral("list-add")), i18n("Add commands"));