Accept filedrops in configuration GUI
This commit is contained in:
parent
b8caa1a896
commit
1a6bd40eb0
@ -155,6 +155,22 @@ class ConfigDialog(QtGui.QDialog):
|
||||
raise GuiConfiguration.WindowClosed
|
||||
event.accept()
|
||||
|
||||
def dragEnterEvent(self, event):
|
||||
data = event.mimeData()
|
||||
urls = data.urls()
|
||||
if (urls and urls[0].scheme() == 'file'):
|
||||
event.acceptProposedAction()
|
||||
|
||||
def dropEvent(self, event):
|
||||
data = event.mimeData()
|
||||
urls = data.urls()
|
||||
if (urls and urls[0].scheme() == 'file'):
|
||||
dropfilepath = unicode(urls[0].path())[1:]
|
||||
if dropfilepath[-4:] == ".exe":
|
||||
self.executablepathCombobox.setEditText(dropfilepath)
|
||||
else:
|
||||
self.mediapathTextbox.setText(dropfilepath)
|
||||
|
||||
def __init__(self, config, playerpaths, error):
|
||||
|
||||
from syncplay import utils
|
||||
@ -288,3 +304,4 @@ class ConfigDialog(QtGui.QDialog):
|
||||
self.setLayout(self.mainLayout)
|
||||
self.runButton.setFocus()
|
||||
self.setFixedSize(self.sizeHint())
|
||||
self.setAcceptDrops(True)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user