Revert "Fixing initialization problem if the GUI is not set yet."

This reverts commit 8635b1ab772c5ff3d9ad113f8f6c30b214e61e57.
Merge master to refactored_ui branch. Conflicts resolved.
Updated .gitignore to include generated folders and files.