88from openpilot .system .ui .widgets import Widget , DialogResult
99from openpilot .system .ui .widgets .confirm_dialog import ConfirmDialog
1010from openpilot .system .ui .widgets .list_view import button_item , text_item , ListItem
11- from openpilot .system .ui .widgets .option_dialog import MultiOptionDialog
1211from openpilot .system .ui .widgets .scroller import Scroller
1312
1413# TODO: remove this. updater fails to respond on startup if time is not correct
@@ -53,9 +52,6 @@ def __init__(self):
5352 self ._install_btn = button_item (lambda : tr ("Install Update" ), lambda : tr ("INSTALL" ), callback = self ._on_install_update )
5453 self ._install_btn .set_visible (False )
5554
56- self ._select_branch_dialog : MultiOptionDialog | None = None
57- self ._target_branch_btn = button_item (tr ("Target Branch" ), tr ("SELECT" ), callback = self ._on_select_branch )
58-
5955 # Track waiting-for-updater transition to avoid brief re-enable while still idle
6056 self ._waiting_for_updater = False
6157 self ._waiting_start_ts : float = 0.0
@@ -69,7 +65,8 @@ def _init_items(self):
6965 self ._version_item ,
7066 self ._download_btn ,
7167 self ._install_btn ,
72- self ._target_branch_btn ,
68+ # TODO: implement branch switching
69+ # button_item("Target Branch", "SELECT", callback=self._on_select_branch),
7370 button_item (lambda : tr ("Uninstall" ), lambda : tr ("UNINSTALL" ), callback = self ._on_uninstall ),
7471 ]
7572 return items
@@ -90,8 +87,6 @@ def _update_state(self):
9087 self ._version_item .action_item .set_text (current_desc )
9188 self ._version_item .set_description (current_release_notes )
9289
93- self ._target_branch_btn .action_item .set_value (ui_state .params .get ("UpdaterTargetBranch" ) or "" )
94-
9590 # Update download button visibility and state
9691 self ._download_btn .set_visible (ui_state .is_offroad ())
9792
@@ -168,25 +163,4 @@ def _on_install_update(self):
168163 self ._install_btn .action_item .set_enabled (False )
169164 ui_state .params .put_bool ("DoReboot" , True )
170165
171- def _on_select_branch (self ):
172- current_branch = ui_state .params .get ("GitBranch" ) or ""
173- branches_str = ui_state .params .get ("UpdaterAvailableBranches" ) or ""
174-
175- available_branches = [b .strip () for b in branches_str .split ("," ) if b .strip ()]
176- priority_branches = [current_branch , "devel-staging" , "devel" , "nightly" , "nightly-dev" , "master" ]
177- for branch in priority_branches :
178- if branch in available_branches :
179- available_branches .remove (branch )
180- available_branches .insert (0 , branch )
181-
182- self ._select_branch_dialog = MultiOptionDialog (tr ("Select a branch" ), available_branches , current = current_branch )
183- gui_app .set_modal_overlay (self ._select_branch_dialog , callback = self ._handle_branch_selection )
184-
185- def _handle_branch_selection (self , result : int ):
186- if result == 1 and self ._select_branch_dialog :
187- selected = self ._select_branch_dialog .selection
188- self ._target_branch_btn .action_item .set_value (selected )
189- ui_state .params .put ("UpdaterTargetBranch" , selected )
190- os .system ("pkill -SIGHUP -f system.updated.updated" )
191-
192- self ._select_branch_dialog = None
166+ def _on_select_branch (self ): pass
0 commit comments