mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-12 07:49:39 -05:00
Move drag and drop logic into dropEvent
This commit is contained in:
parent
bfce4b005c
commit
3eb912bf5a
@ -225,6 +225,14 @@ class FileList(QtWidgets.QListWidget):
|
|||||||
"""
|
"""
|
||||||
dropEvent for dragging files and directories into the widget.
|
dropEvent for dragging files and directories into the widget.
|
||||||
"""
|
"""
|
||||||
|
# Drag and drop doesn't work in Flatpak, because of the sandbox
|
||||||
|
if self.common.platform == "Linux" and os.path.exists("/app/manifest.json"):
|
||||||
|
Alert(
|
||||||
|
self.common, strings._("gui_dragdrop_sandbox_flatpak").format(filename)
|
||||||
|
)
|
||||||
|
event.ignore()
|
||||||
|
return
|
||||||
|
|
||||||
if event.mimeData().hasUrls:
|
if event.mimeData().hasUrls:
|
||||||
event.setDropAction(QtCore.Qt.CopyAction)
|
event.setDropAction(QtCore.Qt.CopyAction)
|
||||||
event.accept()
|
event.accept()
|
||||||
@ -243,13 +251,6 @@ class FileList(QtWidgets.QListWidget):
|
|||||||
"""
|
"""
|
||||||
Add a file or directory to this widget.
|
Add a file or directory to this widget.
|
||||||
"""
|
"""
|
||||||
# Drag and drop doesn't work in Flatpak, because of the sandbox
|
|
||||||
if self.common.platform == "Linux" and os.path.exists("/app/manifest.json"):
|
|
||||||
Alert(
|
|
||||||
self.common, strings._("gui_dragdrop_sandbox_flatpak").format(filename)
|
|
||||||
)
|
|
||||||
return
|
|
||||||
|
|
||||||
filenames = []
|
filenames = []
|
||||||
for index in range(self.count()):
|
for index in range(self.count()):
|
||||||
filenames.append(self.item(index).filename)
|
filenames.append(self.item(index).filename)
|
||||||
|
Loading…
Reference in New Issue
Block a user