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
|
self.window = window # For tests
|
||||||
window.setParent(self, QtCore.Qt.Sheet)
|
window.setParent(self, QtCore.Qt.Sheet)
|
||||||
window.open()
|
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()))
|
window.rejected.connect(lambda: self.profileSelector.setCurrentIndex(self.profileSelector.currentIndex()))
|
||||||
|
|
||||||
def profile_delete_action(self):
|
def profile_delete_action(self):
|
||||||
|
@ -160,12 +160,17 @@ def profile_add_action(self):
|
||||||
self.window = window # For tests
|
self.window = window # For tests
|
||||||
window.setParent(self, QtCore.Qt.Sheet)
|
window.setParent(self, QtCore.Qt.Sheet)
|
||||||
window.open()
|
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()))
|
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):
|
||||||
self.profileSelector.addItem(profile_name, profile_id)
|
# Profile is renamed
|
||||||
self.profileSelector.setCurrentIndex(self.profileSelector.count() - 1)
|
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)
|
||||||
|
|
||||||
def backup_started_event(self):
|
def backup_started_event(self):
|
||||||
self._toggle_buttons(create_enabled=False)
|
self._toggle_buttons(create_enabled=False)
|
||||||
|
|
Loading…
Reference in a new issue