function recomputeStagesItem_Callback(hObject, eventdata)
    global gMISC_GLOBALS
    handles = guidata( hObject );
    if isempty(handles.mesh)
        return;
    end
	if isempty(handles.mesh.globalProps.projectdir)
        complain( 'No project.' );
        return;
    end
    if get( handles.runFlag, 'Value' )
        simRunningDialog( 'Cannot recompute stages while simulation is running.' );
        return;
    end
    setRunning( handles, 1 );
    stages = getAllStageTimes( handles.stagesMenu );
    handles.mesh = leaf_recomputestages( handles.mesh, ...
        'stages', stages, ...
        'plot', 1, ...
        'handles', handles );
    guidata( handles.output, handles );
    setRunning( handles, 0 );
    
