From 64a24d86209be7e48a8d6a260ba5afd5a92f9e74 Mon Sep 17 00:00:00 2001 From: Manu <3916435+m3nu@users.noreply.github.com> Date: Wed, 4 Dec 2024 13:25:12 +0000 Subject: [PATCH] Ensure pre/post-backup cmds are populated (#2153) --- src/vorta/views/main_window.py | 1 + src/vorta/views/shell_commands_page.py | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) 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(