vorta icon indicating copy to clipboard operation
vorta copied to clipboard

FR: Ask user whether to init a new repo if adding existing repo fails

Open real-yfprojects opened this issue 2 years ago • 2 comments
trafficstars

The problem

In #1782 a user confused the two options for adding a repo to vorta and tried to initialize a repo by using the add existing repo dialog.

Requested Solution

When adding an existing repo fails because the repo wasn't initialized yet, Vorta should inform the user about that and ask them if they want to initialize the repo instead. Then Vorta could open the init repo dialog and prefill the fields that are also present in the add repo dialog.

Alternatives

  • Prevent confusion over the two options.

real-yfprojects avatar Sep 01 '23 20:09 real-yfprojects

I've looked into the code, it seems like when a repository fails to be added to Vorta (doesn't matter whether through New Repository... or Existing Repository...), we simply get the same error message, "Unable to add your repository." In src/vorta/views/repo_add_dialog.py :

def run_result(self, result):
        self.saveButton.setEnabled(True)
        if result['returncode'] == 0:
            self.added_repo.emit(result)
            self.accept()
        else:
            self._set_status(self.tr('Unable to add your repository.'))

I think we can add a differentiating (if there is really not, I might've failed to see it) parameter between new repo and existing repo , we can accomplish this. Suggestions are most welcome :)

SAMAD101 avatar Sep 04 '23 17:09 SAMAD101

You don't need to addsa parameter because you can use inheritance. RepoWindow will never be instanciated it serves as a super class implementin, common features of the two dialogs for adding a repo to Vorta.

real-yfprojects avatar Sep 05 '23 06:09 real-yfprojects