examples:
- if you just hit cmd-shift-D (new device) followed by cmd-w (close), nothing is created.
- if you hit cmd-shift-D (new device) then select a "type" from the pulldown, but don't select a "model", then hit close, an incomplete new device is created with model "undefined".
- if you hit cmd-shift-D (new device) then select any "type" from the pulldown, then decide to cancel the operation. you must hit close, then find the resulting device in your list of devices (it might be named "new device <n>" if you didn't change the name) , then hit delete, then confirm "are you sure you want to delete?" to delete the device.
- if you hit cmd-shift-D (new device), then enter a type and model, and device name, then hit close (without doing any further device configuration), a device gets created. this device may be inoperative before being configured further, but it can be later edited by the user. so this may be considered desirable behavior.
to simplify, and to make this more understandable and predicable, it might be more natural if the new-device dialog had something like an ok/save/create button and a cancel button.
to preserve essentially the same semantics as the existing interface, the ok/save/create button could be grey'd out until the user makes a selection from the type menu. i suggest it might be good to also make selecting "model" and typing a device name be required before you can exit the dialog and create the device (to avoid creating inoperative devices with "undefined" type and also to avoid creating devices named "new device", neither of which seem very useful). to exit before these things are filled in or to cancel the pending device creation for any reason, you can hit "cancel".