Merge pull request #25 from ThomasWaldmann/mount-fix

fix file dialog and crash when mounting
This commit is contained in:
Manuel Riel 2018-11-21 21:00:53 +08:00 committed by GitHub
commit 915fd5f59f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -59,6 +59,7 @@ def choose_folder_dialog(parent, title):
options = QFileDialog.Options()
options |= QFileDialog.ShowDirsOnly
dialog = QFileDialog(parent, title, os.path.expanduser('~'), options=options)
dialog.setFileMode(QFileDialog.Directory)
dialog.setParent(parent, QtCore.Qt.Sheet)
return dialog

View File

@ -1,7 +1,7 @@
from datetime import timedelta
import copy
from PyQt5 import uic
from PyQt5.QtWidgets import QFileDialog, QTableWidgetItem, QTableView, QHeaderView
from PyQt5.QtWidgets import QTableWidgetItem, QTableView, QHeaderView
from vorta.borg.prune import BorgPruneThread
from vorta.borg.list import BorgListThread
@ -139,7 +139,7 @@ class SnapshotTab(SnapshotBase, SnapshotUI, BackupProfileMixin):
def receive():
dir = dialog.selectedFiles()
if dir:
params['cmd'].append(dir)
params['cmd'].append(dir[0])
if params['ok']:
self._toggle_all_buttons(False)
thread = BorgMountThread(params['cmd'], params, parent=self)

View File

@ -1,5 +1,4 @@
from PyQt5 import uic, QtGui
from PyQt5.QtWidgets import QFileDialog
from ..models import SourceDirModel, BackupProfileMixin
from ..utils import get_asset, choose_folder_dialog