From a416f9c7f7ac351244b34c5509967aedc6a950c0 Mon Sep 17 00:00:00 2001 From: DaffyTheDuck <34976093+DaffyTheDuck@users.noreply.github.com> Date: Sun, 12 Mar 2023 16:02:29 +0530 Subject: [PATCH] [Enhancement] Better status message when adding existing repo - Avoids Blocking UI When Adding Existing Repo Closes #1306 --- src/vorta/views/repo_add_dialog.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vorta/views/repo_add_dialog.py b/src/vorta/views/repo_add_dialog.py index dbb88a299e..ab9f9b9cfa 100644 --- a/src/vorta/views/repo_add_dialog.py +++ b/src/vorta/views/repo_add_dialog.py @@ -242,10 +242,10 @@ def run(self): params = BorgInfoRepoJob.prepare(self.values) if params['ok']: self.saveButton.setEnabled(False) - thread = BorgInfoRepoJob(params['cmd'], params) - thread.updated.connect(self._set_status) - thread.result.connect(self.run_result) - self.thread = thread # Needs to be connected to self for tests to work. - self.thread.run() + job = BorgInfoRepoJob(params['cmd'], params) + job.updated.connect(self._set_status) + job.result.connect(self.run_result) + self.job = job # Needs to be connected to self for tests to work. + QApplication.instance().jobs_manager.add_job(job) else: self._set_status(params['message'])