Minor tidy up of MainWindow.cpp

Get the sidebar code all in the same place.
For tidiness / maintainability.