From bb1c549d9412dec3e89a4e23ca125bc257b068d9 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 31 May 2021 19:48:11 -0400 Subject: [PATCH] Add some initial status updates during startup --- piker/ui/_chart.py | 20 +++++++++++++++++--- piker/ui/order_mode.py | 2 ++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/piker/ui/_chart.py b/piker/ui/_chart.py index a06268e1..0d118b58 100644 --- a/piker/ui/_chart.py +++ b/piker/ui/_chart.py @@ -51,6 +51,7 @@ from ._graphics._lines import ( from ._l1 import L1Labels from ._graphics._ohlc import BarItems from ._graphics._curve import FastAppendCurve +from . import _style from ._style import ( _font, hcolor, @@ -192,6 +193,8 @@ class ChartSpace(QtGui.QWidget): symbol_key, loglevel, ) + self.window.status_bar.showMessage( + f'Loading {symbol_key}.{providername}...') self.set_chart_symbol(fqsn, linkedcharts) @@ -1241,6 +1244,9 @@ async def spawn_fsps( display_name = f'fsp.{fsp_func_name}' + linked_charts.window().status_bar.showMessage( + f'Loading FSP: {display_name}...') + # TODO: load function here and introspect # return stream type(s) @@ -1281,6 +1287,10 @@ async def spawn_fsps( conf, ) + status = linked_charts.window().status_bar + if display_name in status.currentMessage(): + status.clearMessage() + # blocks here until all fsp actors complete @@ -1541,6 +1551,9 @@ async def chart_symbol( add_label=False, ) + chart_app.window.status_bar.showMessage( + f'Finished loading {sym}.{brokername}') + # size view to data once at outset chart._set_yrange() @@ -1619,6 +1632,7 @@ async def chart_symbol( # linked_charts, # ) + linked_charts.window().status_bar.showMessage('Starting order mode...') await start_order_mode(chart, symbol, brokername) @@ -1676,8 +1690,6 @@ async def _async_main( chart_app = widgets['main'] - - # attempt to configure DPI aware font size screen = current_screen() @@ -1692,8 +1704,10 @@ async def _async_main( # configure global DPI aware font size _font.configure_to_dpi(screen) + # TODO: do styling / themeing setup + # _style.style_ze_sheets(chart_app) + sbar = chart_app.window.status_bar - sbar.setStyleSheet(f"font: {_font.px_size - 3}px") sbar.showMessage('starting ze chartz...') async with trio.open_nursery() as root_n: diff --git a/piker/ui/order_mode.py b/piker/ui/order_mode.py index 1535f458..39181078 100644 --- a/piker/ui/order_mode.py +++ b/piker/ui/order_mode.py @@ -336,6 +336,8 @@ async def start_order_mode( # Begin order-response streaming + chart.window().status_bar.showMessage('Ready for trading') + # this is where we receive **back** messages # about executions **from** the EMS actor async for msg in trades_stream: