예제 #1
0
def toggleTimeout(onoff=None):
    #print "TOGGLETIMEOUT"
    if onoff is None:
        onoff = widgets.input_timeout < 0
    if onoff:
        widgets.setInputTimeout(GD.cfg.get('input/timeout',-1))
    else:
        widgets.setInputTimeout(-1)
    onoff = widgets.input_timeout > 0
    #print "TIMEOUT IS NOW %s" % widgets.input_timeout
    return onoff
예제 #2
0
파일: toolbar.py 프로젝트: dladd/pyFormex
def toggleTimeout(onoff=None):
    if onoff is None:
        onoff = widgets.input_timeout < 0
    if onoff:
        timeout = pf.cfg.get('gui/timeoutvalue',-1)
    else:
        timeout = -1

    widgets.setInputTimeout(timeout)
    onoff = widgets.input_timeout > 0
    if onoff:
        # THIS SUSPENDS ALL WAITING! WE SHOULD IMPLEMENT A TIMEOUT!
        # BY FORCING ALL INDEFINITE PAUSES TO A WAIT TIME EQUAL TO
        # WIDGET INPUT TIMEOUT
        pf.debug("FREEING the draw lock")
        pf.GUI.drawlock.free()
    else:
        pf.debug("ALLOWING the draw lock")
        pf.GUI.drawlock.allow()
    return onoff