state.modal
state.modal
Modal state transition logic.
Provide pure decision functions for closing, opening, and switching modal screens.
ModalRoute
dataclass
Describe the next high level modal controller route.
action
- "apply": apply modal_state (open, switch, or close)
- "open_data": request opening the GeoIP data folder
- "noop": no change
modal_state
- full next modal_state dict, or None to close, used when action == "apply"
Source code in state/modal.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | |
_decide_close(*, trigger, is_open, current_screen, action, is_geo_enabled, missing_geo_screen)
Return None to close the modal, or no decision if not applicable.
Source code in state/modal.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |
_decide_screen_change(*, trigger, is_open, current_screen, show_system, action, menu_screens, open_ports_prefs, now_iso)
Return full modal_state for screen transitions, or None if not applicable.
Source code in state/modal.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | |
_decide_map_click(*, trigger, click_data, now_iso)
Return full modal_state for map click, or None if not applicable.
Source code in state/modal.py
95 96 97 98 99 100 101 102 103 104 105 106 107 | |
decide_modal_route(*, trigger, is_open, current_screen, action, show_system, menu_screens, open_ports_prefs, click_data, is_geo_enabled, missing_geo_screen, now_iso)
Decide modal routing in a single priority ordered function.
Source code in state/modal.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | |