Main dialog work

Reconnected links to buttons, added close button.