Quote:
Originally Posted by kiwidude
Hmmm... just wondering out loud here but I can't help wondering if it still should be in prefs somewhere. The reason being I can see it being pretty common to want to have a dropdown of device names when setting up configuration for a plugin. If the name only exists on the device, then the plugin could only determine a name when that particular device is plugged in? Otherwise we are back to each plugin maintaining it''s own list of device names/uuids again?
|
You might for any number of reasons want to store a map of devices you have seen, in which case you should store both the UUID and the name.
The question that arises is what do you do when you see a device for the first time? What name do you give it? The change I made permits you ask the user for a name, then store that name on the device. The next time a plugin (any plugin) sees the device, it will see that user-supplied name, even if on a different installation of calibre. The same issue arises (what name?) when I move my device around from calibre installation to calibre installation: how are the names kept in sync?
For example, consider what happens when I give my XX device to my son. Its name would change (perhaps) from Charles' XX to Son's XX. This change might happen in his calibre installation. In that case, then when the device is plugged into mine I should see the new name he gave it, not the name it used to have when it was mine.
In other words, when my installation sees a UUID it recognizes, then it should update the display name from the one found on the device. Or ask, but I think that would be annoying.