# -*- coding: utf-8 -*-

from PyQt4 import QtCore,  QtGui
from guiselect import GuiSelect
import sys
import cfg

def startgui():
    app = QtGui.QApplication(sys.argv)
    cfg.ui = GuiSelect()
    cfg.ui.show()
    sys.exit(app.exec_())

def report(lvl, msg):
    if cfg.ui:
        if lvl <= cfg.options.verbosity:
            cfg.ui.plainTextEdit.insertPlainText(msg+"\n")
            cfg.ui.plainTextEdit.ensureCursorVisible()
            cfg.ui.repaint()

cfg.report = report
