Refactoring on MainWindow's view and settings code

Replacing #1048 cause I messed up my Git history. See that issue for the discussion.