Added automatic detection of connection state, enables/disable items.