Selective sync:  the button should only be enabled while connected
Fix compilation error