Optimize Dialog Window Function to be general

- Fix me needed in SelectionWindow.py