def gui_loadproj():
    ''' Helper function to load a project, since used more than once '''
    filepath = pyqt.QFileDialog.getOpenFileName(caption='Choose project file', filter='*'+prjext)
    project = None
    if filepath:
        try: project = loadproj(filepath, verbose=0)
        except Exception as E: print('Could not load file "%s": "%s"' % (filepath, repr(E)))
        if type(project)==Project: return project
        else: print('File "%s" is not an Optima project file' % filepath)
    else:
        print('No filepath provided')
    return project