mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-10 19:52:50 -03:00
Move DropHereLabel and DropCountLabel classes out of FileList
This commit is contained in:
parent
52d080d2a3
commit
d892213db1
1 changed files with 44 additions and 42 deletions
|
@ -23,23 +23,6 @@ from .alert import Alert
|
||||||
|
|
||||||
from onionshare import strings, common
|
from onionshare import strings, common
|
||||||
|
|
||||||
class FileList(QtWidgets.QListWidget):
|
|
||||||
"""
|
|
||||||
The list of files and folders in the GUI.
|
|
||||||
"""
|
|
||||||
files_dropped = QtCore.pyqtSignal()
|
|
||||||
files_updated = QtCore.pyqtSignal()
|
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
|
||||||
super(FileList, self).__init__(parent)
|
|
||||||
self.setAcceptDrops(True)
|
|
||||||
self.setIconSize(QtCore.QSize(32, 32))
|
|
||||||
self.setSortingEnabled(True)
|
|
||||||
self.setMinimumHeight(200)
|
|
||||||
self.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
|
|
||||||
|
|
||||||
self.filenames = []
|
|
||||||
|
|
||||||
class DropHereLabel(QtWidgets.QLabel):
|
class DropHereLabel(QtWidgets.QLabel):
|
||||||
"""
|
"""
|
||||||
When there are no files or folders in the FileList yet, display the
|
When there are no files or folders in the FileList yet, display the
|
||||||
|
@ -64,6 +47,7 @@ class FileList(QtWidgets.QListWidget):
|
||||||
self.parent.drop_here_text.hide()
|
self.parent.drop_here_text.hide()
|
||||||
event.accept()
|
event.accept()
|
||||||
|
|
||||||
|
|
||||||
class DropCountLabel(QtWidgets.QLabel):
|
class DropCountLabel(QtWidgets.QLabel):
|
||||||
"""
|
"""
|
||||||
While dragging files over the FileList, this counter displays the
|
While dragging files over the FileList, this counter displays the
|
||||||
|
@ -82,6 +66,24 @@ class FileList(QtWidgets.QListWidget):
|
||||||
self.hide()
|
self.hide()
|
||||||
event.accept()
|
event.accept()
|
||||||
|
|
||||||
|
|
||||||
|
class FileList(QtWidgets.QListWidget):
|
||||||
|
"""
|
||||||
|
The list of files and folders in the GUI.
|
||||||
|
"""
|
||||||
|
files_dropped = QtCore.pyqtSignal()
|
||||||
|
files_updated = QtCore.pyqtSignal()
|
||||||
|
|
||||||
|
def __init__(self, parent=None):
|
||||||
|
super(FileList, self).__init__(parent)
|
||||||
|
self.setAcceptDrops(True)
|
||||||
|
self.setIconSize(QtCore.QSize(32, 32))
|
||||||
|
self.setSortingEnabled(True)
|
||||||
|
self.setMinimumHeight(200)
|
||||||
|
self.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
|
||||||
|
|
||||||
|
self.filenames = []
|
||||||
|
|
||||||
self.drop_here_image = DropHereLabel(self, True)
|
self.drop_here_image = DropHereLabel(self, True)
|
||||||
self.drop_here_text = DropHereLabel(self, False)
|
self.drop_here_text = DropHereLabel(self, False)
|
||||||
self.drop_count = DropCountLabel(self)
|
self.drop_count = DropCountLabel(self)
|
||||||
|
|
Loading…
Reference in a new issue