systray: disable status actions - battery and connectivity - since they don't have any 'on-Click action' bound to them anyways

This commit is contained in:
Piyush Aggarwal 2021-06-12 06:21:14 +05:30
parent 98077b86d6
commit fc4a19dee0

View file

@ -27,14 +27,18 @@ DeviceIndicator::DeviceIndicator(DeviceDbusInterface* device)
auto battery = new BatteryAction(device);
addAction(battery);
setWhenAvailable(device->hasPlugin(QStringLiteral("kdeconnect_battery")),
[battery](bool available) { battery->setVisible(available); }
, this);
[battery](bool available) {
battery->setVisible(available);
battery->setDisabled(available);
}, this);
auto connectivity = new ConnectivityAction(device);
addAction(connectivity);
setWhenAvailable(device->hasPlugin(QStringLiteral("kdeconnect_connectivity_report")),
[connectivity](bool available) { connectivity->setVisible(available); }
, this);
[connectivity](bool available) {
connectivity->setVisible(available);
connectivity->setDisabled(available);
}, this);
// Browse device filesystem
auto browse = addAction(QIcon::fromTheme(QStringLiteral("document-open-folder")), i18n("Browse device"));