diff --git a/src/vorta/views/main_window.py b/src/vorta/views/main_window.py index a0bb988e..a1f32f06 100644 --- a/src/vorta/views/main_window.py +++ b/src/vorta/views/main_window.py @@ -189,6 +189,7 @@ def profile_selection_changed_action(self, index): self.repoTab.populate_from_profile() self.sourceTab.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.key == 'previous_profile_id' ).execute() diff --git a/src/vorta/views/shell_commands_page.py b/src/vorta/views/shell_commands_page.py index 70c78fb4..54dfddaf 100644 --- a/src/vorta/views/shell_commands_page.py +++ b/src/vorta/views/shell_commands_page.py @@ -14,14 +14,24 @@ def __init__(self, parent=None): self.preBackupCmdLineEdit: QLineEdit = self.findChild(QLineEdit, 'preBackupCmdLineEdit') self.postBackupCmdLineEdit: QLineEdit = self.findChild(QLineEdit, 'postBackupCmdLineEdit') self.createCmdLineEdit: QLineEdit = self.findChild(QLineEdit, 'createCmdLineEdit') + self.populate_from_profile() + self.setup_connections() + + def populate_from_profile(self): profile = self.profile() if profile.repo: self.createCmdLineEdit.setText(profile.repo.create_backup_cmd) 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: self.createCmdLineEdit.setEnabled(False) - - self.setup_connections() + self.preBackupCmdLineEdit.setEnabled(False) + self.postBackupCmdLineEdit.setEnabled(False) def setup_connections(self): self.preBackupCmdLineEdit.textEdited.connect(