Set connected to false on disconnect

Make leave dialog only pop up when connected
and logged in.
Merge pull request #280 from nrn/master

Set connected to false on disconnect