- Disable the drop in the SearchEdit

- Disable the drag in the MediaManager/ServiceManager if no item is selected.

bzr-revno: 1536
This commit is contained in:
Andreas Preikschat 2011-05-12 21:51:16 +02:00
commit 2bb59f7051
3 changed files with 7 additions and 0 deletions

View File

@ -49,6 +49,9 @@ class ListWidgetWithDnD(QtGui.QListWidget):
if event.buttons() != QtCore.Qt.LeftButton:
event.ignore()
return
if not self.selectedItems():
event.ignore()
return
drag = QtGui.QDrag(self)
mimeData = QtCore.QMimeData()
drag.setMimeData(mimeData)

View File

@ -62,6 +62,7 @@ class SearchEdit(QtGui.QLineEdit):
self._onSearchEditTextChanged
)
self._updateStyleSheet()
self.setAcceptDrops(False)
def _updateStyleSheet(self):
"""

View File

@ -73,6 +73,9 @@ class ServiceManagerList(QtGui.QTreeWidget):
if event.buttons() != QtCore.Qt.LeftButton:
event.ignore()
return
if not self.selectedItems():
event.ignore()
return
drag = QtGui.QDrag(self)
mimeData = QtCore.QMimeData()
drag.setMimeData(mimeData)