mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-13 16:29:31 -05:00
Merge branch 'mig5-select_multiple_folders'
This commit is contained in:
commit
de4739e458
@ -214,21 +214,39 @@ class FileSelection(QtWidgets.QVBoxLayout):
|
||||
"""
|
||||
Add files button clicked.
|
||||
"""
|
||||
filenames = QtWidgets.QFileDialog.getOpenFileNames(
|
||||
caption=strings._('gui_choose_files', True), options=QtWidgets.QFileDialog.ReadOnly)
|
||||
if filenames:
|
||||
for filename in filenames[0]:
|
||||
self.file_list.add_file(filename)
|
||||
file_dialog = QtWidgets.QFileDialog(caption=strings._('gui_choose_files', True))
|
||||
file_dialog.setFileMode(QtWidgets.QFileDialog.ExistingFiles)
|
||||
file_dialog.setOption(QtWidgets.QFileDialog.DontUseNativeDialog, True)
|
||||
file_dialog.setOption(QtWidgets.QFileDialog.ReadOnly, True)
|
||||
tree_view = file_dialog.findChild(QtWidgets.QTreeView)
|
||||
tree_view.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
|
||||
list_view = file_dialog.findChild(QtWidgets.QListView, "listView")
|
||||
list_view.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
|
||||
|
||||
if file_dialog.exec_() == QtWidgets.QDialog.Accepted:
|
||||
for filename in file_dialog.selectedFiles():
|
||||
self.file_list.add_file(filename)
|
||||
|
||||
self.update()
|
||||
|
||||
def add_dir(self):
|
||||
"""
|
||||
Add folder button clicked.
|
||||
"""
|
||||
filename = QtWidgets.QFileDialog.getExistingDirectory(
|
||||
caption=strings._('gui_choose_folder', True), options=QtWidgets.QFileDialog.ReadOnly)
|
||||
if filename:
|
||||
self.file_list.add_file(str(filename))
|
||||
file_dialog = QtWidgets.QFileDialog(caption=strings._('gui_choose_folder', True))
|
||||
file_dialog.setFileMode(QtWidgets.QFileDialog.Directory)
|
||||
file_dialog.setOption(QtWidgets.QFileDialog.DontUseNativeDialog, True)
|
||||
file_dialog.setOption(QtWidgets.QFileDialog.ReadOnly, True)
|
||||
file_dialog.setOption(QtWidgets.QFileDialog.ShowDirsOnly, True)
|
||||
tree_view = file_dialog.findChild(QtWidgets.QTreeView)
|
||||
tree_view.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
|
||||
list_view = file_dialog.findChild(QtWidgets.QListView, "listView")
|
||||
list_view.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
|
||||
|
||||
if file_dialog.exec_() == QtWidgets.QDialog.Accepted:
|
||||
for filename in file_dialog.selectedFiles():
|
||||
self.file_list.add_file(filename)
|
||||
|
||||
self.update()
|
||||
|
||||
def delete_file(self):
|
||||
|
@ -24,10 +24,10 @@
|
||||
"help_filename": "List of files or folders to share",
|
||||
"gui_drag_and_drop": "Drag and drop\nfiles here",
|
||||
"gui_add_files": "Add Files",
|
||||
"gui_add_folder": "Add Folder",
|
||||
"gui_add_folder": "Add Folders",
|
||||
"gui_delete": "Delete",
|
||||
"gui_choose_files": "Choose files",
|
||||
"gui_choose_folder": "Choose folder",
|
||||
"gui_choose_folder": "Choose folders",
|
||||
"gui_start_server": "Start Sharing",
|
||||
"gui_stop_server": "Stop Sharing",
|
||||
"gui_copy_url": "Copy URL",
|
||||
|
@ -21,10 +21,10 @@
|
||||
"help_filename": "Liste des fichiers ou dossiers à partager",
|
||||
"gui_drag_and_drop": "Glissez déposez\nles fichiers ici",
|
||||
"gui_add_files": "Ajouter des fichiers",
|
||||
"gui_add_folder": "Ajouter un dossier",
|
||||
"gui_add_folder": "Ajouter des dossiers",
|
||||
"gui_delete": "Supprimer",
|
||||
"gui_choose_files": "Sélectionnez des fichiers",
|
||||
"gui_choose_folder": "Sélectionnez un dossier",
|
||||
"gui_choose_folder": "Sélectionnez des dossiers",
|
||||
"gui_start_server": "Démarrer le serveur",
|
||||
"gui_stop_server": "Arrêter le serveur",
|
||||
"gui_copy_url": "Copier URL",
|
||||
|
Loading…
Reference in New Issue
Block a user