

def waiting_dialog(f, w=None):
    s = Timer()
    s.start()
    if (not w):
        w = QDialog()
        w.resize(200, 70)
        w.setWindowTitle('Electrum')
    elif w.layout():
        QWidget().setLayout(w.layout())
    l = QLabel('')
    vbox = QVBoxLayout(w)
    vbox.addWidget(l)
    w.show()

    def ff():
        s = f()
        if s:
            l.setText(s)
        else:
            w.accept()
    w.connect(s, SIGNAL('timersignal'), ff)
    w.exec_()

dataset/ETHPy150Open bitxbay/BitXBay/electru/build/lib/electrum_gui/qt/util.py waiting_dialog/original