From 3e82c5f28fa7f24335d37802b5999f78b5ab2812 Mon Sep 17 00:00:00 2001 From: Divyansh Singh Date: Mon, 20 Mar 2023 01:09:04 +0530 Subject: [PATCH 1/5] feat: quick mount --- src/vorta/assets/UI/archivetab.ui | 3 ++ src/vorta/views/archive_tab.py | 65 +++++++++++++++++++++++++++++-- 2 files changed, 64 insertions(+), 4 deletions(-) diff --git a/src/vorta/assets/UI/archivetab.ui b/src/vorta/assets/UI/archivetab.ui index fce8f3f83..0b94901c9 100644 --- a/src/vorta/assets/UI/archivetab.ui +++ b/src/vorta/assets/UI/archivetab.ui @@ -124,6 +124,9 @@ Qt::ToolButtonTextBesideIcon + + QToolButton::InstantPopup + diff --git a/src/vorta/views/archive_tab.py b/src/vorta/views/archive_tab.py index db991f7bc..2a35736be 100644 --- a/src/vorta/views/archive_tab.py +++ b/src/vorta/views/archive_tab.py @@ -1,9 +1,13 @@ import logging +import os +import random +import shutil +import string import sys from datetime import timedelta from typing import Dict, Optional from PyQt5 import QtCore, uic -from PyQt5.QtCore import QItemSelectionModel, QMimeData, QPoint, Qt, pyqtSlot +from PyQt5.QtCore import QItemSelectionModel, QMimeData, QPoint, Qt, QUrl, pyqtSlot from PyQt5.QtGui import QDesktopServices, QKeySequence from PyQt5.QtWidgets import ( QAction, @@ -69,6 +73,8 @@ def __init__(self, parent=None, app=None): self.app = app self.toolBox.setCurrentIndex(0) self.repoactions_enabled = True + self.first_refresh = True + self.quick_mount = False #: Tooltip dict to save the tooltips set in the designer self.tooltip_dict: Dict[QWidget, str] = {} @@ -118,7 +124,12 @@ def __init__(self, parent=None, app=None): self.bPrune.clicked.connect(self.prune_action) self.bCheck.clicked.connect(self.check_action) self.bDiff.clicked.connect(self.diff_action) - self.bMountRepo.clicked.connect(self.bmountrepo_clicked) + self.menuMountRepo = QMenu(self.bMountRepo) + + self.menuMountRepo.addAction(translate("ArchiveTab", "Mount to Folder"), self.bmountrepo_clicked) + self.menuMountRepo.addAction(translate("ArchiveTab", "Quick Mount"), self.quick_mount_action) + + self.bMountRepo.setMenu(self.menuMountRepo) self.archiveNameTemplate.textChanged.connect( lambda tpl, key='new_archive_name': self.save_archive_template(tpl, key) @@ -248,6 +259,9 @@ def populate_from_profile(self): self.mount_points, repo_mount_points = get_mount_points(profile.repo.url) if repo_mount_points: self.repo_mount_point = repo_mount_points[0] + mount_point_filename = os.path.basename(self.repo_mount_point) + if mount_point_filename.startswith("vorta-quick-mount-"): + self.quick_mount = True self.toolBox.setItemText(0, self.tr('Archives for %s') % profile.repo.url) archives = [s for s in profile.repo.archives.select().order_by(ArchiveModel.time.desc())] @@ -519,6 +533,33 @@ def bmountarchive_clicked(self): else: self.mount_action(archive_name=archive_name) + def quick_mount_action(self, archive_name=None): + """ + create a temporary directory in the user's home folder ~/vorta-quick-mount-{randomcharacters} and + mount the selected archive or repository to that directory. + """ + profile = self.profile() + params = BorgMountJob.prepare(profile, archive=archive_name) + if not params['ok']: + self._set_status(params['message']) + return + + mount_point = os.path.join( + os.path.expanduser('~'), + 'vorta-quick-mount-' + ''.join(random.choices(string.ascii_lowercase + string.digits, k=6)), + ) + os.mkdir(mount_point) + + params['cmd'].append(mount_point) + params['mount_point'] = mount_point + + if params['ok']: + self._toggle_all_buttons(False) + job = BorgMountJob(params['cmd'], params, self.profile().repo.id) + job.updated.connect(self.mountErrors.setText) + job.result.connect(lambda result: self.mount_result(result, quick=True)) + self.app.jobs_manager.add_job(job) + def bmountrepo_clicked(self): """ Handle `bMountRepo` being clicked. @@ -561,10 +602,18 @@ def bmountrepo_refresh(self): self.bMountRepo.setText(self.tr("Unmount")) self.bMountRepo.setToolTip(self.tr('Unmount the repository from the file system')) self.bMountRepo.setIcon(get_colored_icon('eject')) + self.bMountRepo.setMenu(None) + self.bMountRepo.clicked.connect(self.bmountrepo_clicked) else: - self.bMountRepo.setText(self.tr("Mount…")) + # if this is the first refresh, then dont disconnect the button to avoid a crash + if not self.first_refresh: + # disconnect the button to open the menu + self.bMountRepo.clicked.disconnect() + self.bMountRepo.setText(self.tr("Mount to Folder")) self.bMountRepo.setIcon(get_colored_icon('folder-open')) self.bMountRepo.setToolTip(self.tr("Mount the repository as a folder in the file system")) + self.bMountRepo.setMenu(self.menuMountRepo) + self.first_refresh = False def mount_action(self, archive_name=None): """ @@ -600,12 +649,17 @@ def receive(): dialog = choose_file_dialog(self, self.tr("Choose Mount Point"), want_folder=True) dialog.open(receive) - def mount_result(self, result): + def mount_result(self, result, quick=False): if result['returncode'] == 0: self._set_status(self.tr('Mounted successfully.')) mount_point = result['params']['mount_point'] + if quick: + # open the folder + QDesktopServices.openUrl(QUrl.fromLocalFile(mount_point)) + self.quick_mount = True + if result['params'].get('mounted_archive'): # archive was mounted archive_name = result['params']['mounted_archive'] @@ -675,6 +729,9 @@ def umount_result(self, result): else: # unmount repo self.repo_mount_point = None + if self.quick_mount: + shutil.rmtree(mount_point) + self.quick_mount = False self.bmountrepo_refresh() else: From 24f418e562e3af888852e4591d147ee52174cd37 Mon Sep 17 00:00:00 2001 From: Divyansh Singh Date: Tue, 21 Mar 2023 03:44:40 +0530 Subject: [PATCH 2/5] quick mount for archives --- src/vorta/assets/UI/archivetab.ui | 3 ++ src/vorta/views/archive_tab.py | 58 +++++++++++++++++++++++++------ 2 files changed, 50 insertions(+), 11 deletions(-) diff --git a/src/vorta/assets/UI/archivetab.ui b/src/vorta/assets/UI/archivetab.ui index 0b94901c9..ef68e4633 100644 --- a/src/vorta/assets/UI/archivetab.ui +++ b/src/vorta/assets/UI/archivetab.ui @@ -237,6 +237,9 @@ Qt::ToolButtonTextBesideIcon + + QToolButton::InstantPopup + diff --git a/src/vorta/views/archive_tab.py b/src/vorta/views/archive_tab.py index 2a35736be..bdbe62c29 100644 --- a/src/vorta/views/archive_tab.py +++ b/src/vorta/views/archive_tab.py @@ -68,12 +68,14 @@ def __init__(self, parent=None, app=None): super().__init__(parent) self.setupUi(parent) self.mount_points = {} # mapping of archive name to mount point + self.quick_mount_points = {} # mapping of archive name to quick mount point self.repo_mount_point: Optional[str] = None # mount point of whole repo self.menu = None self.app = app self.toolBox.setCurrentIndex(0) self.repoactions_enabled = True - self.first_refresh = True + self.first_repo_refresh = True + self.first_selection = True self.quick_mount = False #: Tooltip dict to save the tooltips set in the designer @@ -112,7 +114,6 @@ def __init__(self, parent=None, app=None): self.archiveTable.selectionModel().selectionChanged.connect(self.on_selection_change) # connect archive actions - self.bMountArchive.clicked.connect(self.bmountarchive_clicked) self.bRefreshArchive.clicked.connect(self.refresh_archive_info) self.bRename.clicked.connect(self.rename_action) self.bDelete.clicked.connect(self.delete_action) @@ -124,11 +125,16 @@ def __init__(self, parent=None, app=None): self.bPrune.clicked.connect(self.prune_action) self.bCheck.clicked.connect(self.check_action) self.bDiff.clicked.connect(self.diff_action) - self.menuMountRepo = QMenu(self.bMountRepo) - - self.menuMountRepo.addAction(translate("ArchiveTab", "Mount to Folder"), self.bmountrepo_clicked) - self.menuMountRepo.addAction(translate("ArchiveTab", "Quick Mount"), self.quick_mount_action) + self.menuMountArchive = QMenu(self.bMountArchive) + self.menuMountArchive.addAction(translate("MountArchive", "Mount to Folder"), self.bmountarchive_clicked) + self.menuMountArchive.addAction( + translate("MountArchive", "Quick Mount"), lambda: self.bmountarchive_clicked(True) + ) + self.bMountArchive.setMenu(self.menuMountArchive) + self.menuMountRepo = QMenu(self.bMountRepo) + self.menuMountRepo.addAction(translate("MountRepo", "Mount to Folder"), self.bmountrepo_clicked) + self.menuMountRepo.addAction(translate("MountRepo", "Quick Mount"), self.quick_mount_action) self.bMountRepo.setMenu(self.menuMountRepo) self.archiveNameTemplate.textChanged.connect( @@ -262,6 +268,10 @@ def populate_from_profile(self): mount_point_filename = os.path.basename(self.repo_mount_point) if mount_point_filename.startswith("vorta-quick-mount-"): self.quick_mount = True + for mount_point in self.mount_points: + mount_point_filename = os.path.basename(self.mount_points[mount_point]) + if mount_point_filename.startswith("vorta-quick-mount-"): + self.quick_mount_points[mount_point] = self.mount_points[mount_point] self.toolBox.setItemText(0, self.tr('Archives for %s') % profile.repo.url) archives = [s for s in profile.repo.archives.select().order_by(ArchiveModel.time.desc())] @@ -367,6 +377,9 @@ def on_selection_change(self, selected=None, deselected=None): # refresh bMountArchive for the selected archive self.bmountarchive_refresh() + if self.first_selection: + self.first_selection = False + self.bmountarchive_update_menu(disconnect_click=False) else: # too few or too many selected. self.fArchiveActions.setEnabled(False) @@ -516,7 +529,7 @@ def selected_archive_name(self): return archive_cell.text() return None - def bmountarchive_clicked(self): + def bmountarchive_clicked(self, quick=False): """ Handle `bMountArchive` being clicked. @@ -531,7 +544,10 @@ def bmountarchive_clicked(self): if archive_name in self.mount_points: self.unmount_action(archive_name=archive_name) else: - self.mount_action(archive_name=archive_name) + if quick: + self.quick_mount_action(archive_name=archive_name) + else: + self.mount_action(archive_name=archive_name) def quick_mount_action(self, archive_name=None): """ @@ -591,6 +607,19 @@ def bmountarchive_refresh(self, icon_only=False): self.bMountArchive.setText(self.tr("Mount…")) self.bMountArchive.setToolTip(self.tr("Mount the selected archive " + "as a folder in the file system")) + def bmountarchive_update_menu(self, disconnect_click=True): + """ + Update the menu of `bMountArchive`. + """ + archive_name = self.selected_archive_name() + if archive_name in self.mount_points: + self.bMountArchive.setMenu(None) + self.bMountArchive.clicked.connect(self.bmountarchive_clicked) + else: + if disconnect_click: + self.bMountArchive.clicked.disconnect() + self.bMountArchive.setMenu(self.menuMountArchive) + def bmountrepo_refresh(self): """ Update label, tooltip and state of `bMountRepo`. @@ -606,14 +635,14 @@ def bmountrepo_refresh(self): self.bMountRepo.clicked.connect(self.bmountrepo_clicked) else: # if this is the first refresh, then dont disconnect the button to avoid a crash - if not self.first_refresh: + if not self.first_repo_refresh: # disconnect the button to open the menu self.bMountRepo.clicked.disconnect() - self.bMountRepo.setText(self.tr("Mount to Folder")) + self.bMountRepo.setText(self.tr("Mount…")) self.bMountRepo.setIcon(get_colored_icon('folder-open')) self.bMountRepo.setToolTip(self.tr("Mount the repository as a folder in the file system")) self.bMountRepo.setMenu(self.menuMountRepo) - self.first_refresh = False + self.first_repo_refresh = False def mount_action(self, archive_name=None): """ @@ -670,7 +699,10 @@ def mount_result(self, result, quick=False): item = QTableWidgetItem(result['cmd'][-1]) self.archiveTable.setItem(row, 3, item) + if quick: + self.quick_mount_points[archive_name] = mount_point # update button + self.bmountarchive_update_menu() self.bmountarchive_refresh() else: # whole repo was mounted @@ -719,12 +751,16 @@ def umount_result(self, result): if archive_name: # unmount single archive + if archive_name in self.quick_mount_points: + shutil.rmtree(self.quick_mount_points[archive_name]) + del self.quick_mount_points[archive_name] del self.mount_points[archive_name] row = self.row_of_archive(archive_name) item = QTableWidgetItem('') self.archiveTable.setItem(row, 3, item) # update button + self.bmountarchive_update_menu() self.bmountarchive_refresh() else: # unmount repo From eaf03b250da9e15f73a4db0b83d6545fd9217faf Mon Sep 17 00:00:00 2001 From: Divyansh Singh Date: Tue, 21 Mar 2023 04:05:34 +0530 Subject: [PATCH 3/5] handle multiple signal connections --- src/vorta/views/archive_tab.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/vorta/views/archive_tab.py b/src/vorta/views/archive_tab.py index bdbe62c29..b0380b17b 100644 --- a/src/vorta/views/archive_tab.py +++ b/src/vorta/views/archive_tab.py @@ -74,8 +74,6 @@ def __init__(self, parent=None, app=None): self.app = app self.toolBox.setCurrentIndex(0) self.repoactions_enabled = True - self.first_repo_refresh = True - self.first_selection = True self.quick_mount = False #: Tooltip dict to save the tooltips set in the designer @@ -377,9 +375,7 @@ def on_selection_change(self, selected=None, deselected=None): # refresh bMountArchive for the selected archive self.bmountarchive_refresh() - if self.first_selection: - self.first_selection = False - self.bmountarchive_update_menu(disconnect_click=False) + self.bmountarchive_update_menu() else: # too few or too many selected. self.fArchiveActions.setEnabled(False) @@ -607,18 +603,24 @@ def bmountarchive_refresh(self, icon_only=False): self.bMountArchive.setText(self.tr("Mount…")) self.bMountArchive.setToolTip(self.tr("Mount the selected archive " + "as a folder in the file system")) - def bmountarchive_update_menu(self, disconnect_click=True): + def bmountarchive_update_menu(self): """ Update the menu of `bMountArchive`. """ archive_name = self.selected_archive_name() if archive_name in self.mount_points: self.bMountArchive.setMenu(None) - self.bMountArchive.clicked.connect(self.bmountarchive_clicked) + try: + self.bMountArchive.clicked.disconnect() + self.bMountArchive.clicked.connect(self.bmountarchive_clicked) + except TypeError: + self.bMountArchive.clicked.connect(self.bmountarchive_clicked) else: - if disconnect_click: + try: self.bMountArchive.clicked.disconnect() - self.bMountArchive.setMenu(self.menuMountArchive) + self.bMountArchive.setMenu(self.menuMountArchive) + except TypeError: + pass def bmountrepo_refresh(self): """ @@ -634,15 +636,15 @@ def bmountrepo_refresh(self): self.bMountRepo.setMenu(None) self.bMountRepo.clicked.connect(self.bmountrepo_clicked) else: - # if this is the first refresh, then dont disconnect the button to avoid a crash - if not self.first_repo_refresh: + try: # disconnect the button to open the menu self.bMountRepo.clicked.disconnect() + except TypeError: + pass self.bMountRepo.setText(self.tr("Mount…")) self.bMountRepo.setIcon(get_colored_icon('folder-open')) self.bMountRepo.setToolTip(self.tr("Mount the repository as a folder in the file system")) self.bMountRepo.setMenu(self.menuMountRepo) - self.first_repo_refresh = False def mount_action(self, archive_name=None): """ From fdf9c69975ab5ed18141ea0f0248a3bc98272622 Mon Sep 17 00:00:00 2001 From: Divyansh Singh Date: Tue, 21 Mar 2023 21:34:50 +0530 Subject: [PATCH 4/5] use names instead of booleans to detect mounted status --- src/vorta/views/archive_tab.py | 94 +++++++++++++--------------------- 1 file changed, 37 insertions(+), 57 deletions(-) diff --git a/src/vorta/views/archive_tab.py b/src/vorta/views/archive_tab.py index b0380b17b..3058b3bf4 100644 --- a/src/vorta/views/archive_tab.py +++ b/src/vorta/views/archive_tab.py @@ -68,13 +68,11 @@ def __init__(self, parent=None, app=None): super().__init__(parent) self.setupUi(parent) self.mount_points = {} # mapping of archive name to mount point - self.quick_mount_points = {} # mapping of archive name to quick mount point self.repo_mount_point: Optional[str] = None # mount point of whole repo self.menu = None self.app = app self.toolBox.setCurrentIndex(0) self.repoactions_enabled = True - self.quick_mount = False #: Tooltip dict to save the tooltips set in the designer self.tooltip_dict: Dict[QWidget, str] = {} @@ -124,15 +122,15 @@ def __init__(self, parent=None, app=None): self.bCheck.clicked.connect(self.check_action) self.bDiff.clicked.connect(self.diff_action) self.menuMountArchive = QMenu(self.bMountArchive) - self.menuMountArchive.addAction(translate("MountArchive", "Mount to Folder"), self.bmountarchive_clicked) + self.menuMountArchive.addAction(translate("MountArchive", "Mount to Folder…"), self.bmountarchive_clicked) self.menuMountArchive.addAction( - translate("MountArchive", "Quick Mount"), lambda: self.bmountarchive_clicked(True) + translate("MountArchive", "Quick Mount…"), lambda: self.bmountarchive_clicked(True) ) self.bMountArchive.setMenu(self.menuMountArchive) self.menuMountRepo = QMenu(self.bMountRepo) - self.menuMountRepo.addAction(translate("MountRepo", "Mount to Folder"), self.bmountrepo_clicked) - self.menuMountRepo.addAction(translate("MountRepo", "Quick Mount"), self.quick_mount_action) + self.menuMountRepo.addAction(translate("MountRepo", "Mount to Folder…"), self.bmountrepo_clicked) + self.menuMountRepo.addAction(translate("MountRepo", "Quick Mount…"), self.quick_mount_action) self.bMountRepo.setMenu(self.menuMountRepo) self.archiveNameTemplate.textChanged.connect( @@ -263,13 +261,6 @@ def populate_from_profile(self): self.mount_points, repo_mount_points = get_mount_points(profile.repo.url) if repo_mount_points: self.repo_mount_point = repo_mount_points[0] - mount_point_filename = os.path.basename(self.repo_mount_point) - if mount_point_filename.startswith("vorta-quick-mount-"): - self.quick_mount = True - for mount_point in self.mount_points: - mount_point_filename = os.path.basename(self.mount_points[mount_point]) - if mount_point_filename.startswith("vorta-quick-mount-"): - self.quick_mount_points[mount_point] = self.mount_points[mount_point] self.toolBox.setItemText(0, self.tr('Archives for %s') % profile.repo.url) archives = [s for s in profile.repo.archives.select().order_by(ArchiveModel.time.desc())] @@ -375,7 +366,6 @@ def on_selection_change(self, selected=None, deselected=None): # refresh bMountArchive for the selected archive self.bmountarchive_refresh() - self.bmountarchive_update_menu() else: # too few or too many selected. self.fArchiveActions.setEnabled(False) @@ -389,6 +379,7 @@ def on_selection_change(self, selected=None, deselected=None): # special treatment for dynamic mount/unmount button. self.bmountarchive_refresh() + self.bmountrepo_refresh() tooltip = self.bMountArchive.toolTip() self.bMountArchive.setToolTip(tooltip + " " + self.tr("(Select exactly one archive)")) @@ -539,16 +530,23 @@ def bmountarchive_clicked(self, quick=False): if archive_name in self.mount_points: self.unmount_action(archive_name=archive_name) + elif quick: + self.quick_mount_action(archive_name=archive_name) else: - if quick: - self.quick_mount_action(archive_name=archive_name) - else: - self.mount_action(archive_name=archive_name) + self.mount_action(archive_name=archive_name) + + def get_vorta_quick_mountpoint(self): + """ + return a temporary directory in the user's home folder ~/vorta-quick-mount-{randomcharacters} + """ + return os.path.join( + os.path.expanduser('~'), + 'vorta-quick-mount-' + ''.join(random.choices(string.ascii_lowercase + string.digits, k=6)), + ) def quick_mount_action(self, archive_name=None): """ - create a temporary directory in the user's home folder ~/vorta-quick-mount-{randomcharacters} and - mount the selected archive or repository to that directory. + mount the selected archive or repository to a temporary directory. """ profile = self.profile() params = BorgMountJob.prepare(profile, archive=archive_name) @@ -556,10 +554,10 @@ def quick_mount_action(self, archive_name=None): self._set_status(params['message']) return - mount_point = os.path.join( - os.path.expanduser('~'), - 'vorta-quick-mount-' + ''.join(random.choices(string.ascii_lowercase + string.digits, k=6)), - ) + mount_point = self.get_vorta_quick_mountpoint() + while os.path.exists(mount_point) and os.listdir(mount_point): + mount_point = self.get_vorta_quick_mountpoint() + os.mkdir(mount_point) params['cmd'].append(mount_point) @@ -597,30 +595,22 @@ def bmountarchive_refresh(self, icon_only=False): if not icon_only: self.bMountArchive.setText(self.tr("Unmount")) self.bMountArchive.setToolTip(self.tr('Unmount the selected archive from the file system')) + self.bMountArchive.setMenu(None) + try: + self.bMountArchive.clicked.disconnect(self.bmountarchive_clicked) # avoid race condition + self.bMountArchive.clicked.connect(self.bmountarchive_clicked) + except TypeError: + self.bMountArchive.clicked.connect(self.bmountarchive_clicked) else: self.bMountArchive.setIcon(get_colored_icon('folder-open')) if not icon_only: self.bMountArchive.setText(self.tr("Mount…")) self.bMountArchive.setToolTip(self.tr("Mount the selected archive " + "as a folder in the file system")) - - def bmountarchive_update_menu(self): - """ - Update the menu of `bMountArchive`. - """ - archive_name = self.selected_archive_name() - if archive_name in self.mount_points: - self.bMountArchive.setMenu(None) - try: - self.bMountArchive.clicked.disconnect() - self.bMountArchive.clicked.connect(self.bmountarchive_clicked) - except TypeError: - self.bMountArchive.clicked.connect(self.bmountarchive_clicked) - else: - try: - self.bMountArchive.clicked.disconnect() - self.bMountArchive.setMenu(self.menuMountArchive) - except TypeError: - pass + try: + self.bMountArchive.clicked.disconnect(self.bmountarchive_clicked) + self.bMountArchive.setMenu(self.menuMountArchive) + except TypeError: # when bMountArchive.clicked is not connected + pass def bmountrepo_refresh(self): """ @@ -638,8 +628,8 @@ def bmountrepo_refresh(self): else: try: # disconnect the button to open the menu - self.bMountRepo.clicked.disconnect() - except TypeError: + self.bMountRepo.clicked.disconnect(self.bmountrepo_clicked) + except TypeError: # on first run, when the button is not connected pass self.bMountRepo.setText(self.tr("Mount…")) self.bMountRepo.setIcon(get_colored_icon('folder-open')) @@ -689,7 +679,6 @@ def mount_result(self, result, quick=False): if quick: # open the folder QDesktopServices.openUrl(QUrl.fromLocalFile(mount_point)) - self.quick_mount = True if result['params'].get('mounted_archive'): # archive was mounted @@ -701,10 +690,7 @@ def mount_result(self, result, quick=False): item = QTableWidgetItem(result['cmd'][-1]) self.archiveTable.setItem(row, 3, item) - if quick: - self.quick_mount_points[archive_name] = mount_point # update button - self.bmountarchive_update_menu() self.bmountarchive_refresh() else: # whole repo was mounted @@ -750,26 +736,20 @@ def umount_result(self, result): if result['returncode'] == 0: self._set_status(self.tr('Un-mounted successfully.')) + if os.path.basename(mount_point).startswith("vorta-quick-mount-"): + shutil.rmtree(mount_point) if archive_name: # unmount single archive - if archive_name in self.quick_mount_points: - shutil.rmtree(self.quick_mount_points[archive_name]) - del self.quick_mount_points[archive_name] del self.mount_points[archive_name] row = self.row_of_archive(archive_name) item = QTableWidgetItem('') self.archiveTable.setItem(row, 3, item) - # update button - self.bmountarchive_update_menu() self.bmountarchive_refresh() else: # unmount repo self.repo_mount_point = None - if self.quick_mount: - shutil.rmtree(mount_point) - self.quick_mount = False self.bmountrepo_refresh() else: From 317cd0b3600b1fc85710c95050503eed8b92834c Mon Sep 17 00:00:00 2001 From: Aryaman Date: Fri, 8 Mar 2024 22:05:58 +0530 Subject: [PATCH 5/5] resolved merge conflict --- src/vorta/views/archive_tab.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vorta/views/archive_tab.py b/src/vorta/views/archive_tab.py index 3058b3bf4..d86628313 100644 --- a/src/vorta/views/archive_tab.py +++ b/src/vorta/views/archive_tab.py @@ -6,10 +6,10 @@ import sys from datetime import timedelta from typing import Dict, Optional -from PyQt5 import QtCore, uic -from PyQt5.QtCore import QItemSelectionModel, QMimeData, QPoint, Qt, QUrl, pyqtSlot -from PyQt5.QtGui import QDesktopServices, QKeySequence -from PyQt5.QtWidgets import ( +from PyQt6 import QtCore, uic +from PyQt6.QtCore import QItemSelectionModel, QMimeData, QPoint, Qt, QUrl, pyqtSlot +from PyQt6.QtGui import QDesktopServices, QKeySequence +from PyQt6.QtWidgets import ( QAction, QApplication, QHeaderView,