mirror of
https://github.com/borgbase/vorta
synced 2025-01-03 05:36:19 +00:00
parent
0f5335ed7f
commit
518df6ff55
1 changed files with 10 additions and 5 deletions
|
@ -135,7 +135,7 @@ def profile_rename_action(self):
|
|||
self.window = window # For tests
|
||||
window.setParent(self, QtCore.Qt.Sheet)
|
||||
window.open()
|
||||
window.profile_changed.connect(self.add_profile_entry)
|
||||
window.profile_changed.connect(self.profile_add_edit_result)
|
||||
window.rejected.connect(lambda: self.profileSelector.setCurrentIndex(self.profileSelector.currentIndex()))
|
||||
|
||||
def profile_delete_action(self):
|
||||
|
@ -160,10 +160,15 @@ def profile_add_action(self):
|
|||
self.window = window # For tests
|
||||
window.setParent(self, QtCore.Qt.Sheet)
|
||||
window.open()
|
||||
window.profile_changed.connect(self.add_profile_entry)
|
||||
window.profile_changed.connect(self.profile_add_edit_result)
|
||||
window.rejected.connect(lambda: self.profileSelector.setCurrentIndex(self.profileSelector.currentIndex()))
|
||||
|
||||
def add_profile_entry(self, profile_name, profile_id):
|
||||
def profile_add_edit_result(self, profile_name, profile_id):
|
||||
# Profile is renamed
|
||||
if self.profileSelector.currentData() == profile_id:
|
||||
self.profileSelector.setItemText(self.profileSelector.currentIndex(), profile_name)
|
||||
# Profile is added
|
||||
else:
|
||||
self.profileSelector.addItem(profile_name, profile_id)
|
||||
self.profileSelector.setCurrentIndex(self.profileSelector.count() - 1)
|
||||
|
||||
|
|
Loading…
Reference in a new issue