Is there a way to prevent a device owned by your plug-in from being deleted by the user?
I can easily detect when a device has been deleted, using
callback.RegisterEventCB(Enums.HSEvent.CONFIG_CHANGE, IFACE_NAME, "")
and recreate it, but of course it will have a new ref. Not a problem for the plug-in but if the user has referenced the device in events or HSTouch they are messed up.
We all know how easy it is to delete a device by accident, I can't be the only one , so it seems like a basic requirement. Am I just missing something?
I can see how it would not be a good idea to totally prevent device deletion but if the plug-in could receive a callback before the device is deleted, rather than after, and have the opportunity to cancel the action it would be fine. Then a device created by a rogue plug-in could still be deleted by disabling the plug-in first.
Steve
I can easily detect when a device has been deleted, using
callback.RegisterEventCB(Enums.HSEvent.CONFIG_CHANGE, IFACE_NAME, "")
and recreate it, but of course it will have a new ref. Not a problem for the plug-in but if the user has referenced the device in events or HSTouch they are messed up.
We all know how easy it is to delete a device by accident, I can't be the only one , so it seems like a basic requirement. Am I just missing something?
I can see how it would not be a good idea to totally prevent device deletion but if the plug-in could receive a callback before the device is deleted, rather than after, and have the opportunity to cancel the action it would be fine. Then a device created by a rogue plug-in could still be deleted by disabling the plug-in first.
Steve
Comment