Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/user_interaction/network_conf.py
diff options
context:
space:
mode:
Diffstat (limited to 'archinstall/lib/user_interaction/network_conf.py')
-rw-r--r--archinstall/lib/user_interaction/network_conf.py20
1 files changed, 9 insertions, 11 deletions
diff --git a/archinstall/lib/user_interaction/network_conf.py b/archinstall/lib/user_interaction/network_conf.py
index 4f22b790..1908603e 100644
--- a/archinstall/lib/user_interaction/network_conf.py
+++ b/archinstall/lib/user_interaction/network_conf.py
@@ -29,7 +29,7 @@ class ManualNetworkConfig(ListManager):
str(_('Delete interface'))
]
- super().__init__(prompt, ifaces, self._actions, self._actions[0])
+ super().__init__(prompt, ifaces, [self._actions[0]], self._actions[1:])
def reformat(self, data: List[NetworkConfiguration]) -> Dict[str, Optional[NetworkConfiguration]]:
table = FormattedOutput.as_table(data)
@@ -49,21 +49,19 @@ class ManualNetworkConfig(ListManager):
def selected_action_display(self, iface: NetworkConfiguration) -> str:
return iface.iface if iface.iface else ''
- def exec_action(self, data: List[NetworkConfiguration]):
- active_iface: Optional[NetworkConfiguration] = self.target if self.target else None
-
- if self.action == self._actions[0]: # add
+ def handle_action(self, action: str, entry: Optional[NetworkConfiguration], data: List[NetworkConfiguration]):
+ if action == self._actions[0]: # add
iface_name = self._select_iface(data)
if iface_name:
iface = NetworkConfiguration(NicType.MANUAL, iface=iface_name)
iface = self._edit_iface(iface)
data += [iface]
- elif active_iface:
- if self.action == self._actions[1]: # edit interface
- data = [d for d in data if d.iface != active_iface.iface]
- data.append(self._edit_iface(active_iface))
- elif self.action == self._actions[2]: # delete
- data = [d for d in data if d != active_iface]
+ elif entry:
+ if action == self._actions[1]: # edit interface
+ data = [d for d in data if d.iface != entry.iface]
+ data.append(self._edit_iface(entry))
+ elif action == self._actions[2]: # delete
+ data = [d for d in data if d != entry]
return data