Commit b69fcb72 authored by Yan's avatar Yan
Browse files

Add StatusBar which collects log messages

parent 866fb54a
......@@ -36,6 +36,16 @@ class update_signal(QtCore.QObject):
signal = QtCore.pyqtSignal()
class QStatusBarLogger(logging.Handler):
def __init__(self, parent=None):
super().__init__()
self.statusBar = QtWidgets.QStatusBar(parent)
def emit(self, record):
msg = self.format(record)
self.statusBar.showMessage(msg)
def load_file(parent, chrom_plot, spc, d_set, ms_s, fn, chrom_s,
update, settings, filename=None):
"""populates dataset and plots it"""
......@@ -164,7 +174,8 @@ def about(parent):
def main():
print(autoparams)
app = QtWidgets.QApplication(sys.argv)
ds = []
ms = dict(annotation=[], name="Spectrum", xlabel="m/z",
ylabel="ion count", xtics=20, predict=None,
......@@ -178,14 +189,19 @@ def main():
config = cf.settings()
barHandler = QStatusBarLogger()
p_logger = logging.getLogger('parseLogger')
drl_logger = logging.getLogger('drlLogger')
zce_logger = logging.getLogger('zceLogger')
logging.basicConfig()
p_logger.setLevel("WARN")
#p_logger.setLevel("WARN")
p_logger.setLevel("DEBUG")
#drl_logger.setLevel("INFO")
drl_logger.setLevel("DEBUG")
zce_logger.setLevel("DEBUG")
p_logger.addHandler(barHandler)
zce_logger.addHandler(barHandler)
graph = Figure(figsize=(5, 4), dpi=100, facecolor="None")
grid = graph.add_gridspec(2, 1)
......@@ -211,7 +227,6 @@ def main():
'horizontal', useblit=True, rectprops=dict(
alpha=0.15, facecolor='purple'), button=3)
app = QtWidgets.QApplication(sys.argv)
main_window = QtWidgets.QMainWindow(windowTitle="Prasopes")
if QtGui.QIcon.themeName() is "":
......@@ -376,6 +391,7 @@ def main():
main_window.addToolBar(QtCore.Qt.TopToolBarArea, toolBar)
main_window.addDockWidget(QtCore.Qt.LeftDockWidgetArea, treedock)
main_window.setStatusBar(barHandler.statusBar)
main_window.setFocus()
......
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