Beispiel #1
1
def quit():
    if mw.state == "editCurrentFact":
        mw.moveToState("saveEdit")
        return
    if mw.saveAndClose(hideWelcome=True):
        if mw.config['syncOnProgramOpen']:
            mw.hideWelcome = True
            mw.syncDeck(interactive=False)
        mw.prepareForExit()
        mw.app.quit()
Beispiel #2
1
def newEventHandler(evt):
    if mw.state == "showQuestion":
        if evt.key() == Qt.Key_Space:
            evt.accept()
            return mw.moveToState("showAnswer")
    if mw.state == "showAnswer":
        key = unicode(evt.text())
        if key == "t":
            evt.accept()
            return mw.mainWin.mainText.setFocus()
    return oldEventHandler(evt)
Beispiel #3
0
def quit():
    if mw.state == "editCurrentFact":
        mw.moveToState("saveEdit")
        return
    if mw.saveAndClose(hideWelcome=True):
        if mw.config['syncOnProgramOpen']:
            mw.hideWelcome = True
            mw.syncDeck(interactive=False)
        mw.prepareForExit()
        mw.app.quit()