]> skyeroc.xyz Git - obs-ctl/commitdiff
Change Changed to Submitted (for clarity)
authorsbkelley <sb24kelley@gmail.com>
Sun, 7 Dec 2025 22:33:41 +0000 (17:33 -0500)
committersbkelley <sb24kelley@gmail.com>
Sun, 7 Dec 2025 22:33:41 +0000 (17:33 -0500)
src/obs_ctl/app.py
src/obs_ctl/interface/molecule/settings_block/pane.py
src/obs_ctl/interface/molecule/settings_block/pane.pyi
src/obs_ctl/interface/molecule/settings_block/settings_block.pyi

index 9fd3f5b3a2be5bee2e1d196ec5fa6641593975b1..832a26bfc6fdd88f3fd392c2db224dffbb88d9ee 100644 (file)
@@ -167,8 +167,8 @@ class OBSCtlApp(App): # type: ignore
     def on_obs_ws_disconnected(self, message: RecordControls.OBSWSDisconnected):
         self.get_api().disconnect()
 
-    @on(OBSSettingsPane.RecordPathChanged, "#obs_settings_pane")
-    def on_settings_block_record_path_changed(self, message: OBSSettingsPane.RecordPathChanged):
+    @on(OBSSettingsPane.RecordPathSubmitted, "#obs_settings_pane")
+    def on_settings_block_record_path_changed(self, message: OBSSettingsPane.RecordPathSubmitted):
         self.get_api().set_record_path(message.value)
 
 
index 1f4cc964555409f079c24c61f10c26dff374050c..821882c205bca496d747d9cf0f80c93f2d8845ef 100644 (file)
@@ -37,7 +37,8 @@ class PaneBase(TabPane):
 
 type SettingsWidgetWidget = type[Input | Select[Any]]
 type SettingsWidgetType = type[int | float | str]
-type SettingsWidgetMsg = type[Input.Submitted | Select.Changed]
+type SettingsWidgetMsg = Input.Submitted | Input.Changed
+type SettingsWidgetMsgType = type[Input.Submitted | Select.Changed]
 type SettingsWidgetExpectedType = type[str]
 class SettingsWidget(Enum):
     """(widget_class, setting type, listener message, widget-expected type)"""
@@ -57,7 +58,7 @@ class SettingsWidget(Enum):
         return self.value[1]
     
     @property
-    def msg(self) -> SettingsWidgetMsg:
+    def msg(self) -> SettingsWidgetMsgType:
         """The message this SettingsType's widget posts when user interacts"""
         return self.value[2]
     
@@ -138,7 +139,7 @@ def make_pane(
         return watch_func
 
     def make_on_control_message(
-            listener_message: SettingsWidgetMsg,
+            listener_message: SettingsWidgetMsgType,
             listener_id: str,
             reactive: reactive[Any],
             post_message: type[SettingsMSGBase]):
@@ -166,9 +167,9 @@ def make_pane(
     new_dict: dict[str, Any] = dict()
     for setting_name, setting_type, setting_default, _ in loop_list:
         setting_control_id: str = f"{setting_type.widget.__name__.lower()}_{setting_name}"
-        SettingChanged_name: str = f"{_snake_to_camel(setting_name)}Changed"
+        SettingChanged_name: str = f"{_snake_to_camel(setting_name)}Submitted"
         watch_setting_name: str = f"watch_{setting_name}"
-        on_setting_changed_name: str = f"on_{setting_name}_changed"
+        on_setting_changed_name: str = f"on_{setting_name}_submitted"
         # For each desired setting (e.g. 'record_path'):
         # Set up a record_path reactive
         new_dict[setting_name] = reactive(setting_type.type(setting_default))
index 9bc72f0f165f185ce48214ef895cbec6ab2fca72..510acdaedb1f71bbe8665f82ad090b65bbd054a3 100644 (file)
@@ -1,8 +1,13 @@
 from enum import Enum
 from typing import Any, ClassVar, Literal, Mapping, Self, Sequence, overload
 
+from textual.widget import Widget
 from textual.widgets import Input, Select, TabPane
 from textual.reactive import reactive
+from ...message import MSGBase
+class SettingsMSGBase(MSGBase):
+    value: Any
+    def __init__(self: Self, control: Widget, value: Any, *, _log_me: bool) -> None: ...
 
 type SettingsWidgetWidget = type[Input | Select[Any]]
 type SettingsWidgetType = type[int | float | str]
index abd473b9561d2a4ab3030576c053ec952597d058..6bd5a0b852e11478a8c81eea2a307eee462c22df 100644 (file)
@@ -17,9 +17,9 @@ class PaneBaseSubclass(PaneBase):
 
 class OBSSettingsPane(PaneBaseSubclass):
     record_path: ClassVar[reactive[str]]
-    class RecordPathChanged(pane.SettingsMSGBase): ...
+    class RecordPathSubmitted(pane.SettingsMSGBase): ...
     def watch_record_path(self: Self, value: str) -> None: ...
-    def on_record_path_changed(self: Self, event: pane.SettingsMSGBase) -> None: ...
+    def on_record_path_submitted(self: Self, event: pane.SettingsMSGBase) -> None: ...
     def compose(self: Self) -> ComposeResult: ...
 
 class OBSWebSocketPane(PaneBaseSubclass):
@@ -27,18 +27,18 @@ class OBSWebSocketPane(PaneBaseSubclass):
     port: ClassVar[reactive[int]]
     password: ClassVar[reactive[str]]
     timeout: ClassVar[reactive[float]]
-    class HostChanged(pane.SettingsMSGBase): ...
-    class PortChanged(pane.SettingsMSGBase): ...
-    class PasswordChanged(pane.SettingsMSGBase): ...
-    class TimeoutChanged(pane.SettingsMSGBase): ...
+    class HostSubmitted(pane.SettingsMSGBase): ...
+    class PortSubmitted(pane.SettingsMSGBase): ...
+    class PasswordSubmitted(pane.SettingsMSGBase): ...
+    class TimeoutSubmitted(pane.SettingsMSGBase): ...
     def watch_host(self: Self, value: str) -> None: ...
     def watch_port(self: Self, value: str) -> None: ...
     def watch_password(self: Self, value: str) -> None: ...
     def watch_timeout(self: Self, value: str) -> None: ...
-    def on_host_changed(self: Self, event: pane.SettingsMSGBase) -> None: ...
-    def on_port_changed(self: Self, event: pane.SettingsMSGBase) -> None: ...
-    def on_password_changed(self: Self, event: pane.SettingsMSGBase) -> None: ...
-    def on_timeout_changed(self: Self, event: pane.SettingsMSGBase) -> None: ...
+    def on_host_submitted(self: Self, event: pane.SettingsMSGBase) -> None: ...
+    def on_port_submitted(self: Self, event: pane.SettingsMSGBase) -> None: ...
+    def on_password_submitted(self: Self, event: pane.SettingsMSGBase) -> None: ...
+    def on_timeout_submitted(self: Self, event: pane.SettingsMSGBase) -> None: ...
     def compose(self: Self) -> ComposeResult: ...
 
 class OBSCTLPane(PaneBaseSubclass): ...