First attempt to integrate the scanning dialog to the main window.
It works, but the code is horrible .. and other stuff..