test-widget: improve code for opening a file
test-widget: continue the clean-up