Commit aff64725 authored by Yan's avatar Yan
Browse files

Improved stability - QStatusBar fixed

* QStatusBar is now updated in main thread, not in side-thread
parent 68db28ee
......@@ -40,10 +40,12 @@ class QStatusBarLogger(logging.Handler):
def __init__(self, parent=None):
super().__init__()
self.statusBar = QtWidgets.QStatusBar(parent)
self.trigger = update_signal()
self.msg = str("")
def emit(self, record):
msg = self.format(record)
self.statusBar.showMessage(msg)
self.msg = self.format(record)
self.trigger.signal.emit()
def load_file(parent, chrom_plot, spc, d_set, ms_s, fn, chrom_s,
......@@ -87,7 +89,6 @@ def load_file(parent, chrom_plot, spc, d_set, ms_s, fn, chrom_s,
"no parameters loaded!\n\n"
"Error message:\n{}".format(pex.args[0]))
error.signal.emit()
print("panoc baby")
gt.populate(chrom_plot, spc, d_set, ms_s, chrom_s)
fn[0] = filename
parent.setWindowTitle("Prasopes - {}".format(
......@@ -183,6 +184,7 @@ def about(parent):
def main():
print(QtCore.QThread.currentThread())
app = QtWidgets.QApplication(sys.argv)
loadthread = QtCore.QThread()
......@@ -200,16 +202,18 @@ def main():
config = cf.settings()
barHandler = QStatusBarLogger()
barHandler.trigger.signal.connect(lambda:
barHandler.statusBar.showMessage(barHandler.msg))
p_logger = logging.getLogger('parseLogger')
params_logger = logging.getLogger('acqLogLogger')
drl_logger = logging.getLogger('drlLogger')
zce_logger = logging.getLogger('zceLogger')
logging.basicConfig()
p_logger.setLevel("WARN")
#p_logger.setLevel("DEBUG")
#p_logger.setLevel("WARN")
p_logger.setLevel("DEBUG")
#drl_logger.setLevel("INFO")
#drl_logger.setLevel("DEBUG")
drl_logger.setLevel("DEBUG")
zce_logger.setLevel("DEBUG")
params_logger.setLevel("DEBUG")
p_logger.addHandler(barHandler)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment