Restore the main form if there is username/password legged in
Show login form if there is no stored username/password
Show the login form after a logout
Ported loadqueuedata
Ported getqueuesizes
Setup queue_timer function