add dialog to unmount all archives before creating a new one

This commit is contained in:
Andreas Zweili 2019-02-15 21:27:00 +01:00
parent a2936ba1e9
commit d283c58a2f
1 changed files with 9 additions and 0 deletions

View File

@ -74,6 +74,9 @@ class MainWindow(QMainWindow):
super(QMainWindow, self).closeEvent(*args, **kwargs)
# When the application gets close unmount all the archives and remove
# their paths.
self._umount_archives()
def _umount_archives(self):
if self.mount_paths:
for path in self.mount_paths:
if os.path.exists(path):
@ -98,6 +101,12 @@ class MainWindow(QMainWindow):
def create_backup(self):
"""Creates a backup of the selected item in the treeview."""
if self.mount_paths:
if self.yes_no("To create an archive you need to unmout all "
"archives. Do you want to continue?"):
self._umount_archives()
else:
return
try:
self._check_path()
thread = borg.BackupThread([self.src_path],