Add funtion of connectiong form and main window

Add funtion of connectiong form and main window