Codes are cleaned.

MainWindow.cpp and MainWindow.h are cleaned so that only the core
functionality is preserved.