mirror of https://github.com/borgbase/vorta
Merge pull request #25 from ThomasWaldmann/mount-fix
fix file dialog and crash when mounting
This commit is contained in:
commit
915fd5f59f
|
@ -59,6 +59,7 @@ def choose_folder_dialog(parent, title):
|
||||||
options = QFileDialog.Options()
|
options = QFileDialog.Options()
|
||||||
options |= QFileDialog.ShowDirsOnly
|
options |= QFileDialog.ShowDirsOnly
|
||||||
dialog = QFileDialog(parent, title, os.path.expanduser('~'), options=options)
|
dialog = QFileDialog(parent, title, os.path.expanduser('~'), options=options)
|
||||||
|
dialog.setFileMode(QFileDialog.Directory)
|
||||||
dialog.setParent(parent, QtCore.Qt.Sheet)
|
dialog.setParent(parent, QtCore.Qt.Sheet)
|
||||||
return dialog
|
return dialog
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import copy
|
import copy
|
||||||
from PyQt5 import uic
|
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.prune import BorgPruneThread
|
||||||
from vorta.borg.list import BorgListThread
|
from vorta.borg.list import BorgListThread
|
||||||
|
@ -139,7 +139,7 @@ class SnapshotTab(SnapshotBase, SnapshotUI, BackupProfileMixin):
|
||||||
def receive():
|
def receive():
|
||||||
dir = dialog.selectedFiles()
|
dir = dialog.selectedFiles()
|
||||||
if dir:
|
if dir:
|
||||||
params['cmd'].append(dir)
|
params['cmd'].append(dir[0])
|
||||||
if params['ok']:
|
if params['ok']:
|
||||||
self._toggle_all_buttons(False)
|
self._toggle_all_buttons(False)
|
||||||
thread = BorgMountThread(params['cmd'], params, parent=self)
|
thread = BorgMountThread(params['cmd'], params, parent=self)
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
from PyQt5 import uic, QtGui
|
from PyQt5 import uic, QtGui
|
||||||
from PyQt5.QtWidgets import QFileDialog
|
|
||||||
from ..models import SourceDirModel, BackupProfileMixin
|
from ..models import SourceDirModel, BackupProfileMixin
|
||||||
from ..utils import get_asset, choose_folder_dialog
|
from ..utils import get_asset, choose_folder_dialog
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue