Skip to content
This repository was archived by the owner on Apr 3, 2025. It is now read-only.

Commit 19a21ac

Browse files
committed
UI: Set proper active profile when setting the same profile
1 parent b58214d commit 19a21ac

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

eduvpn/ui/ui.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,14 @@ def on_profile_combo_changed(self, combo):
12051205
# Restore the previous profile
12061206
if not self.profile_ask_reconnect():
12071207
self.set_same_profile = True
1208-
combo.set_active(self.app.model.current_server.profiles.current_index)
1208+
profiles = self.app.model.current_server.profiles
1209+
active_profile = 0
1210+
sorted_profiles = sorted(profiles.profiles, key=lambda p: str(p))
1211+
for index, profile in enumerate(sorted_profiles):
1212+
if profiles.current is not None and profile.identifier == profiles.current.identifier:
1213+
active_profile = index
1214+
1215+
combo.set_active(active_profile)
12091216
return
12101217

12111218
# Set profile and connect

0 commit comments

Comments
 (0)