From 1fe29dc86bbd5be44cd5d752a9aa76143b82142e Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sat, 11 Sep 2021 13:20:44 -0400 Subject: [PATCH] Revert "Drop extra method" This reverts commit 6fa8958acf95bc2faba0ecd343ebdca4ace0f733. We actually do need it since the selection widget of course won't tell you its "key" that we assign and further we'd have to use a (value, key) style invocation which isn't super pythonic. --- piker/ui/_position.py | 14 +++++++++++++- piker/ui/order_mode.py | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/piker/ui/_position.py b/piker/ui/_position.py index 225663bc..77098f6b 100644 --- a/piker/ui/_position.py +++ b/piker/ui/_position.py @@ -62,6 +62,19 @@ class SettingsPane: # encompasing high level namespace order_mode: Optional['OrderMode'] = None # typing: ignore # noqa + def on_selection_change( + self, + + text: str, + key: str, + + ) -> None: + '''Called on any order pane drop down selection change. + + ''' + log.info(f'selection input: {text}') + self.on_ui_settings_change(key, text) + def on_ui_settings_change( self, @@ -72,7 +85,6 @@ class SettingsPane: '''Called on any order pane edit field value change. ''' - log.info(f'selection input: {value}') mode = self.order_mode # an account switch request diff --git a/piker/ui/order_mode.py b/piker/ui/order_mode.py index 0460638a..83b193ba 100644 --- a/piker/ui/order_mode.py +++ b/piker/ui/order_mode.py @@ -733,7 +733,7 @@ async def open_order_mode( w.currentTextChanged.connect( partial( - order_pane.on_ui_settings_change, + order_pane.on_selection_change, key=key, ) )