Ejemplo n.º 1
0
def main():
    pb = ProgressBar(title="Testing...",
                     status="Testing 1, 2, 3...",
                     pulsing=True,
                     cancel_callback=stopCallback)
    pb.show()

    time.sleep(1)
    pb.disablePulse()

    for i in xrange(1, 101):
        if pb.isClosed():
            break
        else:
            pb.setProgress(i)

            if i > 80:
                pb.setStatus("Almost done...")
            elif i > 60:
                pb.setStatus("Halfway there (and some)...")
                pb.enableCancel()
            elif i > 40:
                pb.setStatus("Working on it...")
                pb.disableCancel()
            elif i > 20:
                pb.setStatus("Running the gears...")

        time.sleep(0.1)

    if pb.isOpen():
        pb.close()
def main():
    global pb
    pb = ProgressBar(title="Microphone Data Collector",
                     status="Starting...",
                     pulsing=True)
    pb.show()
    pb.hide()
    pb.disableCancel()

    # Initialize terminal colors for Windows (and do nothing for *nix)
    colorama.init()

    # Create the application and the main window
    app = QtGui.QApplication(sys.argv)

    # Setup stylesheet
    app.setStyleSheet(qdarkstyle.load_stylesheet(pyside=False))

    window = MDCWindow()

    # Run
    window.show()
    sys.exit(app.exec_())