Updated header and code file for mainwindow