UI and dialogs

Add network detection
Add Preference option
Bug fixes