-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Launch Add new repository
when Add existing repository
fails/is not initialized.
#1816
base: master
Are you sure you want to change the base?
Conversation
…epo in case the addition of an existing one fails/its not initialized
This PR is not complete yet. The problems I'm facing right now are:
I was wondering why this is happening? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You already did very well implementing this although I would suggest a little bit of restructuring.
- Implement a
from_values
method for the repo winows. - Use a
QMessageBox
to inform the user about the failure and ask them whether they want to create a new repository instead. - When the user confirms, call a method on
RepoTab
that opensAddRepoWindow
using thefrom_values
method.
This will make the user experience more clear and the code more modular.
This due to the vorta/src/vorta/views/repo_add_dialog.py Lines 105 to 107 in 55ede38
When using the file selector it is set to vorta/src/vorta/views/repo_add_dialog.py Line 72 in 55ede38
|
I've added the
|
If you only import The add dialogs already have a |
src/vorta/views/repo_add_dialog.py
Outdated
self.exception_handler() | ||
|
||
def exception_handler(self): | ||
exception_window = QMessageBox.question( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't answer
be a better name for this variable?
…ting setting of values from the values method
@real-yfprojects I've implemented the setting of values from the |
…ting setting of values from the values method
@real-yfprojects I've made the necessary changes. |
This improves the code that open the `AddRepoWindow` when one tries to add an existing repo although it doesn't exist. * src/vorta/views/repo_add_dialog.py
This allows accessing `msgid` from `ExistingRepoWindow`. * src/vorta/application.py * src/vorta/borg/borg_job.py * src/vorta/views/repo_add_dialog.py * tests/unit/test_repo.py
wow, that simplifies a lot of things, the 'confirm password' field is not auto-filled. And, the repo is still unable to be added for some reason. |
I implemented that on purpose.
You are right. Fixed that in the following commit. |
Now when the `AddRepoWindow` with the values from `ExistingRepoWindow` the `is_remote_repo` attribute will be restored, preventing an error message when trying to add the repository. * src/vorta/views/repo_add_dialog.py
Looks like all macOS tests are timing out on Github today. Likely unrelated to this PR, seeing it elsewhere too. |
@m3nu ping |
@m3nu Works fine on mine. When you try to add an empty directory which is not a repository already. It will simply ask you to make it into one. Maybe, you're not running the same branch untitled.mp4 |
I tried with a remote repo. Maybe that's the reason? Should it also work for an empty remote repo? |
that's odd, the |
src/vorta/views/repo_add_dialog.py
Outdated
if 'msgid' in error and error['msgid'] in ['Repository.DoesNotExist', 'Repository.InvalidRepository']: | ||
self.init_new_repo() | ||
break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@real-yfprojects need some help here.
It seems like this condition is not turning True
in case of uninitiated (empty) remote repos, while it is working fine for local repos. What could be going wrong here?
And due to this, the new init_new_repo
method is never called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure. E.g. by using the cmd, can you find out what the command outputs as an error/warning. Use the json flag so that you can find out which msgid
is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, for remote repository it was just InvalidRepository
So now it works for both local and remote repositories.
@m3nu Can you check again? |
Description
The
Add new window
window will automatically pop up when an existing repository fails/is not initialized.#1799
Motivation and Context
This will reduce confusion in
adding new
andadding existing
repositories. Will fill some entries automatically when theadd new repository
window is opened through this route.How Has This Been Tested?
Types of changes
Checklist:
I provide my contribution under the terms of the license of this repository and I affirm the Developer Certificate of Origin.