update: show button only for session profiles
This commit is contained in:
parent
54c4f0ed35
commit
d1346e4238
2 changed files with 13 additions and 2 deletions
|
|
@ -403,12 +403,14 @@ class CustomWindow(QMainWindow):
|
|||
connection_observer.subscribe('connecting', lambda event: self.update_status(
|
||||
f'[{event.subject.get("attempt_count")}/{event.subject.get("maximum_number_of_attempts")}] Performing connection attempt...'))
|
||||
|
||||
connection_observer.subscribe('tor_bootstrapping', lambda event: self.update_status('Establishing Tor connection...'))
|
||||
connection_observer.subscribe('tor_bootstrapping', lambda event: self.update_status(
|
||||
'Establishing Tor connection...'))
|
||||
|
||||
connection_observer.subscribe('tor_bootstrap_progressing', lambda event: self.update_status(
|
||||
f'Bootstrapping Tor {event.meta.get('progress'):.2f}%'))
|
||||
|
||||
connection_observer.subscribe('tor_bootstrapped', lambda event: self.update_status('Tor connection established.'))
|
||||
connection_observer.subscribe(
|
||||
'tor_bootstrapped', lambda event: self.update_status('Tor connection established.'))
|
||||
|
||||
self.setFixedSize(800, 570)
|
||||
self.central_widget = QWidget(self)
|
||||
|
|
@ -1508,6 +1510,7 @@ class MenuPage(Page):
|
|||
boton.setEnabled(False)
|
||||
if icon_name == "p2p_request":
|
||||
self.request_button = boton
|
||||
boton.setVisible(False)
|
||||
if icon_name == "disconnect":
|
||||
boton.setEnabled(True)
|
||||
boton.setVisible(False)
|
||||
|
|
@ -1987,6 +1990,8 @@ class MenuPage(Page):
|
|||
def print_profile_details(self, profile_name):
|
||||
self.reverse_id = int(profile_name.split('_')[1])
|
||||
|
||||
profile_type = ProfileController.get(self.reverse_id)
|
||||
|
||||
target_button = self.profile_button_map.get(self.reverse_id)
|
||||
if target_button:
|
||||
self.connection_manager.set_profile_button_objects(
|
||||
|
|
@ -1995,6 +2000,12 @@ class MenuPage(Page):
|
|||
print(f"No button found for profile {self.reverse_id}")
|
||||
is_connected = self.connection_manager.is_profile_connected(
|
||||
int(self.reverse_id))
|
||||
|
||||
if isinstance(profile_type, SessionProfile):
|
||||
self.request_button.setVisible(True)
|
||||
else:
|
||||
self.request_button.setVisible(False)
|
||||
|
||||
if is_connected:
|
||||
self.boton_edit.setEnabled(False)
|
||||
else:
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in a new issue