mirror of
https://github.com/fergalmoran/picard.git
synced 2026-02-22 23:55:46 +00:00
Drag and drop fix for newer version of Qt.
This commit is contained in:
@@ -51,6 +51,7 @@ class PluginsOptionsPage(OptionsPage):
|
||||
self.connect(self.ui.plugins, QtCore.SIGNAL("itemSelectionChanged()"), self.change_details)
|
||||
self.ui.plugins.__class__.mimeTypes = self.mimeTypes
|
||||
self.ui.plugins.__class__.dropEvent = self.dropEvent
|
||||
self.ui.plugins.__class__.dragEnterEvent = self.dragEnterEvent
|
||||
if sys.platform == "win32":
|
||||
self.loader="file:///%s"
|
||||
else:
|
||||
@@ -154,6 +155,10 @@ class PluginsOptionsPage(OptionsPage):
|
||||
def mimeTypes(self):
|
||||
return ["text/uri-list"]
|
||||
|
||||
def dragEnterEvent(self, event):
|
||||
event.setDropAction(QtCore.Qt.CopyAction)
|
||||
event.accept()
|
||||
|
||||
def dropEvent(self, event):
|
||||
for path in [os.path.normpath(unicode(u.toLocalFile())) for u in event.mimeData().urls()]:
|
||||
self.install_plugin(path)
|
||||
|
||||
Reference in New Issue
Block a user