Minor: Improve break-lock dialog. (#867)

This commit is contained in:
Manu 2021-02-17 22:45:51 +08:00 committed by GitHub
parent 52233a9844
commit 4e44c88605
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 5 deletions

View File

@ -183,12 +183,15 @@ class VortaApp(QtSingleApplication):
profile = BackupProfileModel.get(name=context['profile_name'])
repo_url = context.get('repo_url')
msg = QMessageBox()
msg.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
msg.setText(
self.tr(
f"The repository at {repo_url} might be in use by another computer. Override it and continue?"))
msg.accepted.connect(lambda: self.break_lock(profile))
msg.setWindowTitle(self.tr("Repository In Use"))
msg.setIcon(QMessageBox.Critical)
abortButton = msg.addButton(self.tr("Abort"), QMessageBox.RejectRole)
msg.addButton(self.tr("Continue"), QMessageBox.AcceptRole)
msg.setDefaultButton(abortButton)
msg.setText(self.tr(f"The repository at {repo_url} might be in use elsewhere."))
msg.setInformativeText(self.tr("Only break the lock if you are certain no other Borg process "
"on any machine is accessing the repository. Abort or break the lock?"))
msg.accepted.connect(lambda: self.break_lock(profile))
self._msg = msg
msg.show()
elif msgid == 'LockFailed':