1
0
Fork 0
mirror of https://github.com/borgbase/vorta synced 2024-12-21 23:33:13 +00:00

Ensure pre/post-backup cmds are populated (#2153)

This commit is contained in:
Manu 2024-12-04 13:25:12 +00:00 committed by GitHub
parent 108d64816c
commit 64a24d8620
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 2 deletions

View file

@ -189,6 +189,7 @@ def profile_selection_changed_action(self, index):
self.repoTab.populate_from_profile() self.repoTab.populate_from_profile()
self.sourceTab.populate_from_profile() self.sourceTab.populate_from_profile()
self.scheduleTab.schedulePage.populate_from_profile() self.scheduleTab.schedulePage.populate_from_profile()
self.scheduleTab.shellCommandsPage.populate_from_profile()
SettingsModel.update({SettingsModel.str_value: self.current_profile.id}).where( SettingsModel.update({SettingsModel.str_value: self.current_profile.id}).where(
SettingsModel.key == 'previous_profile_id' SettingsModel.key == 'previous_profile_id'
).execute() ).execute()

View file

@ -14,14 +14,24 @@ def __init__(self, parent=None):
self.preBackupCmdLineEdit: QLineEdit = self.findChild(QLineEdit, 'preBackupCmdLineEdit') self.preBackupCmdLineEdit: QLineEdit = self.findChild(QLineEdit, 'preBackupCmdLineEdit')
self.postBackupCmdLineEdit: QLineEdit = self.findChild(QLineEdit, 'postBackupCmdLineEdit') self.postBackupCmdLineEdit: QLineEdit = self.findChild(QLineEdit, 'postBackupCmdLineEdit')
self.createCmdLineEdit: QLineEdit = self.findChild(QLineEdit, 'createCmdLineEdit') self.createCmdLineEdit: QLineEdit = self.findChild(QLineEdit, 'createCmdLineEdit')
self.populate_from_profile()
self.setup_connections()
def populate_from_profile(self):
profile = self.profile() profile = self.profile()
if profile.repo: if profile.repo:
self.createCmdLineEdit.setText(profile.repo.create_backup_cmd) self.createCmdLineEdit.setText(profile.repo.create_backup_cmd)
self.createCmdLineEdit.setEnabled(True) self.createCmdLineEdit.setEnabled(True)
self.preBackupCmdLineEdit.setText(profile.pre_backup_cmd)
self.preBackupCmdLineEdit.setEnabled(True)
self.postBackupCmdLineEdit.setText(profile.post_backup_cmd)
self.postBackupCmdLineEdit.setEnabled(True)
else: else:
self.createCmdLineEdit.setEnabled(False) self.createCmdLineEdit.setEnabled(False)
self.preBackupCmdLineEdit.setEnabled(False)
self.setup_connections() self.postBackupCmdLineEdit.setEnabled(False)
def setup_connections(self): def setup_connections(self):
self.preBackupCmdLineEdit.textEdited.connect( self.preBackupCmdLineEdit.textEdited.connect(