update: fixed error on profile enable
This commit is contained in:
parent
f478505f68
commit
fc944b0cb5
1 changed files with 20 additions and 15 deletions
|
|
@ -2257,19 +2257,22 @@ class MenuPage(Page):
|
|||
try:
|
||||
if is_enabled:
|
||||
self.connection_manager.add_connected_profile(profile_id)
|
||||
target_button: QPushButton = self.connection_manager.get_profile_button_objects(profile_id)
|
||||
|
||||
if profile_type == 1:
|
||||
target_button: QPushButton = self.connection_manager.get_profile_button_objects(profile_id)
|
||||
icon_path = self.connected_tor_profile if profile_connection == 'tor' else self.connected_profile
|
||||
target_button.setIcon(QIcon(icon_path))
|
||||
self.button_states[profile_id] = icon_path
|
||||
if target_button:
|
||||
icon_path = self.connected_tor_profile if profile_connection == 'tor' else self.connected_profile
|
||||
target_button.setIcon(QIcon(icon_path))
|
||||
self.button_states[profile_id] = icon_path
|
||||
else:
|
||||
target_button: QPushButton = self.connection_manager.get_profile_button_objects(profile_id)
|
||||
target_button.setIcon(QIcon(self.system_wide_connected_profile))
|
||||
self.update_status.update_image(appearance_value='background_connected')
|
||||
self.button_states[profile_id] = self.system_wide_connected_profile
|
||||
self.IsSystem += 1
|
||||
if target_button:
|
||||
target_button.setIcon(QIcon(self.system_wide_connected_profile))
|
||||
self.update_status.update_image(appearance_value='background_connected')
|
||||
self.button_states[profile_id] = self.system_wide_connected_profile
|
||||
self.IsSystem += 1
|
||||
|
||||
self.show_disconnect_button(True, profile_type, target_button)
|
||||
if target_button:
|
||||
self.show_disconnect_button(True, profile_type, target_button)
|
||||
self.boton_edit.setEnabled(False)
|
||||
|
||||
if profile_id == self.reverse_id:
|
||||
|
|
@ -2278,22 +2281,24 @@ class MenuPage(Page):
|
|||
self.print_profile_details(f"Profile_{profile_id}")
|
||||
else:
|
||||
self.connection_manager.remove_connected_profile(profile_id)
|
||||
target_button: QPushButton = self.connection_manager.get_profile_button_objects(profile_id)
|
||||
|
||||
if profile_type == 1:
|
||||
target_button: QPushButton = self.connection_manager.get_profile_button_objects(profile_id)
|
||||
target_button.setIcon(QIcon(self.not_connected_profile))
|
||||
if target_button:
|
||||
target_button.setIcon(QIcon(self.not_connected_profile))
|
||||
if profile_id in self.button_states:
|
||||
del self.button_states[profile_id]
|
||||
else:
|
||||
self.IsSystem -= 1
|
||||
target_button: QPushButton = self.connection_manager.get_profile_button_objects(profile_id)
|
||||
target_button.setIcon(QIcon(self.not_connected_profile))
|
||||
if target_button:
|
||||
target_button.setIcon(QIcon(self.not_connected_profile))
|
||||
if profile_id in self.button_states:
|
||||
del self.button_states[profile_id]
|
||||
if self.IsSystem == 0:
|
||||
self.update_status.update_image()
|
||||
|
||||
self.show_disconnect_button(False, profile_type, target_button)
|
||||
if target_button:
|
||||
self.show_disconnect_button(False, profile_type, target_button)
|
||||
self.boton_edit.setEnabled(True)
|
||||
|
||||
if profile_id == self.reverse_id:
|
||||
|
|
|
|||
Loading…
Reference in a new issue