Only make actions enabled if they're available
This commit is contained in:
parent
a164983b6f
commit
d517dcea48
1 changed files with 3 additions and 0 deletions
|
@ -87,12 +87,15 @@ DeviceIndicator::DeviceIndicator(DeviceDbusInterface* device)
|
|||
sftpIface->startBrowsing();
|
||||
sftpIface->deleteLater();
|
||||
});
|
||||
setWhenAvailable(device->hasPlugin("kdeconnect_sftp"), [browse](bool available) { browse->setEnabled(available); }, this);
|
||||
|
||||
auto findDevice = addAction(i18n("Find device"));
|
||||
connect(findDevice, &QAction::triggered, device, [device](){
|
||||
FindMyPhoneDeviceDbusInterface* iface = new FindMyPhoneDeviceDbusInterface(device->id(), device);
|
||||
iface->ring();
|
||||
iface->deleteLater();
|
||||
});
|
||||
setWhenAvailable(device->hasPlugin("kdeconnect_findmyphone"), [findDevice](bool available) { findDevice->setEnabled(available); }, this);
|
||||
|
||||
// addAction(i18n("Send file")); //TODO
|
||||
|
||||
|
|
Loading…
Reference in a new issue