Skip to content

Commit

Permalink
clicking same profile will now toggle settings tab visability
Browse files Browse the repository at this point in the history
  • Loading branch information
bigtedde committed Oct 15, 2023
1 parent 7e5f3b7 commit 45c4c2f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/vorta/views/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ def __init__(self, parent=None):

# Init profile list
self.populate_profile_selector()
self.profileSelector.currentItemChanged.connect(self.profile_select_action)
self.profileSelector.itemClicked.connect(self.profile_clicked_action)
self.profileSelector.currentItemChanged.connect(self.profile_selection_changed_action)
self.profileRenameButton.clicked.connect(self.profile_rename_action)
self.profileExportButton.clicked.connect(self.profile_export_action)
self.profileDeleteButton.clicked.connect(self.profile_delete_action)
Expand Down Expand Up @@ -173,7 +174,7 @@ def populate_profile_selector(self):
if current_item:
self.profileSelector.setCurrentItem(current_item)

def profile_select_action(self, index):
def profile_selection_changed_action(self, index):
profile = self.profileSelector.currentItem()
backup_profile_id = profile.data(Qt.ItemDataRole.UserRole) if profile else None
if not backup_profile_id:
Expand All @@ -187,6 +188,8 @@ def profile_select_action(self, index):
SettingsModel.key == 'previous_profile_id'
).execute()
self.archiveTab.toggle_compact_button_visibility()

def profile_clicked_action(self):
if self.miscWidget.isVisible():
self.toggle_misc_visibility()

Expand Down Expand Up @@ -217,7 +220,7 @@ def profile_delete_action(self):
to_delete.delete_instance(recursive=True)
self.app.scheduler.remove_job(to_delete_id) # Remove pending jobs
self.profileSelector.takeItem(self.profileSelector.currentRow())
self.profile_select_action(0)
self.profile_selection_changed_action(0)

else:
warn = self.tr("Cannot delete the last profile.")
Expand Down

0 comments on commit 45c4c2f

Please sign in to comment.