Removed extra profile enabling checks
This commit is contained in:
parent
393087954d
commit
c81ccd0979
1 changed files with 4 additions and 22 deletions
|
@ -1712,9 +1712,7 @@ class MenuPage(Page):
|
|||
def connect(self):
|
||||
self.boton_just.setEnabled(False)
|
||||
self.boton_just_session.setEnabled(False)
|
||||
if self.connection_manager.get_is_profile_being_enabled(int(self.reverse_id)):
|
||||
self.update_status.update_status('Profile is already being enabled...')
|
||||
return
|
||||
|
||||
profile = ProfileController.get(int(self.reverse_id))
|
||||
is_tor = self.update_status.get_current_connection() == 'tor'
|
||||
if profile.connection.code == 'tor' and not profile.application_version.installed and not is_tor:
|
||||
|
@ -1854,7 +1852,6 @@ class MenuPage(Page):
|
|||
self.worker.update_signal.disconnect(self.update_gui_main_thread)
|
||||
self.worker.change_page.disconnect(self.change_app_page)
|
||||
'''
|
||||
self.connection_manager.set_is_profile_being_enabled(profile_data['id'], True)
|
||||
self.worker = Worker(profile_data)
|
||||
self.worker.update_signal.connect(self.update_gui_main_thread)
|
||||
self.worker.change_page.connect(self.change_app_page)
|
||||
|
@ -1909,10 +1906,8 @@ class MenuPage(Page):
|
|||
|
||||
self.boton_just.setEnabled(True)
|
||||
self.boton_just_session.setEnabled(True)
|
||||
self.connection_manager.set_is_profile_being_enabled(self.reverse_id, False)
|
||||
|
||||
def on_finished_update_gui(self, is_enabled, profile_id, profile_type, profile_connection):
|
||||
self.connection_manager.set_is_profile_being_enabled(profile_id, False)
|
||||
try:
|
||||
if is_enabled:
|
||||
self.connection_manager.add_connected_profile(profile_id)
|
||||
|
@ -2028,13 +2023,8 @@ class ConnectionManager:
|
|||
else:
|
||||
return []
|
||||
|
||||
|
||||
|
||||
|
||||
def set_is_profile_being_enabled(self, profile_id: int, status: bool):
|
||||
self._is_profile_being_enabled[profile_id] = status
|
||||
|
||||
def get_is_profile_being_enabled(self, profile_id: int) -> bool:
|
||||
return self._is_profile_being_enabled.get(profile_id, False)
|
||||
|
||||
class InstallSystemPackage(Page):
|
||||
def __init__(self, page_stack, main_window=None, parent=None):
|
||||
|
@ -3384,7 +3374,7 @@ class ScreenPage(Page):
|
|||
boton.setIcon(QIcon(self.create_resolution_button_image(icon_name)))
|
||||
self.buttons.append(boton)
|
||||
self.buttonGroup.addButton(boton, j)
|
||||
boton.clicked.connect(lambda _, dimentions=icon_name: self.on_standard_resolution_clicked(dimentions))
|
||||
boton.clicked.connect(lambda _, dimentions=icon_name: self.show_dimentions(dimentions))
|
||||
|
||||
self.larger_resolutions_button = QPushButton(self)
|
||||
self.larger_resolutions_button.setGeometry(100, 450, 185, 50)
|
||||
|
@ -3450,7 +3440,7 @@ class ScreenPage(Page):
|
|||
button.setCheckable(True)
|
||||
button.setVisible(True)
|
||||
button.setIcon(QIcon(self.create_resolution_button_image(resolution)))
|
||||
button.clicked.connect(lambda _, res=resolution: self.on_larger_resolution_clicked(res))
|
||||
button.clicked.connect(lambda _, res=resolution: self.show_dimentions(res))
|
||||
self.larger_resolution_buttons.append(button)
|
||||
self.buttonGroup.addButton(button, len(self.buttons) + i)
|
||||
|
||||
|
@ -3470,14 +3460,6 @@ class ScreenPage(Page):
|
|||
def show_standard_resolutions(self):
|
||||
for button in self.buttons:
|
||||
button.setVisible(True)
|
||||
|
||||
def on_standard_resolution_clicked(self, dimentions):
|
||||
self.custom_resolution_button.setChecked(False)
|
||||
self.show_dimentions(dimentions)
|
||||
|
||||
def on_larger_resolution_clicked(self, dimentions):
|
||||
self.custom_resolution_button.setChecked(False)
|
||||
self.show_dimentions(dimentions)
|
||||
|
||||
def show_custom_resolution_dialog(self):
|
||||
dialog = QDialog(self)
|
||||
|
|
Loading…
Reference in a new issue