mirror of
https://github.com/borgbase/vorta
synced 2024-12-21 23:33:13 +00:00
parent
ffafcee05c
commit
1b27b9b499
1 changed files with 9 additions and 3 deletions
|
@ -2,7 +2,7 @@
|
|||
from pathlib import PurePath
|
||||
from PyQt5 import QtCore, uic
|
||||
from PyQt5.QtCore import QMimeData, QUrl
|
||||
from PyQt5.QtWidgets import QApplication, QMenu, QMessageBox
|
||||
from PyQt5.QtWidgets import QApplication, QLayout, QMenu, QMessageBox
|
||||
from vorta.store.models import ArchiveModel, BackupProfileMixin, RepoModel
|
||||
from vorta.utils import borg_compat, get_asset, get_private_keys, pretty_bytes
|
||||
from .repo_add_dialog import AddRepoWindow, ExistingRepoWindow
|
||||
|
@ -111,10 +111,12 @@ def init_repo_stats(self):
|
|||
# set labels
|
||||
repo: RepoModel = self.profile().repo
|
||||
if repo is not None:
|
||||
self.frameRepoSettings.setEnabled(True)
|
||||
# remove *unset* item
|
||||
self.repoSelector.removeItem(self.repoSelector.findData(None))
|
||||
|
||||
# Start with every element enabled, then disable SSH-related if relevant
|
||||
for child in self.frameRepoSettings.children():
|
||||
child.setEnabled(True)
|
||||
# local repo doesn't use ssh
|
||||
ssh_enabled = repo.is_remote_repo()
|
||||
# self.bAddSSHKey.setEnabled(ssh_enabled)
|
||||
|
@ -147,7 +149,11 @@ def init_repo_stats(self):
|
|||
self.repoEncryption.setText(str(repo.encryption))
|
||||
else:
|
||||
# Compression and SSH key are only valid entries for a repo
|
||||
self.frameRepoSettings.setEnabled(False)
|
||||
# Yet Add SSH key button must be enabled for bootstrapping
|
||||
for child in self.frameRepoSettings.children():
|
||||
if not isinstance(child, QLayout):
|
||||
child.setEnabled(False)
|
||||
self.bAddSSHKey.setEnabled(True)
|
||||
|
||||
# unset stats
|
||||
self.sizeCompressed.setText(na)
|
||||
|
|
Loading…
Reference in a new issue