Fixed drag and drop dependencies on PySide2
This commit is contained in:
parent
1db4d7adfc
commit
fda0331662
@ -1,7 +1,7 @@
|
|||||||
from PySide2 import QtCore, QtWidgets, QtGui
|
from PySide2 import QtCore, QtWidgets, QtGui
|
||||||
from PySide2.QtCore import Qt, QSettings, QCoreApplication, QSize, QPoint, QUrl, QLine
|
from PySide2.QtCore import Qt, QSettings, QCoreApplication, QSize, QPoint, QUrl, QLine, QStandardPaths
|
||||||
from PySide2.QtWidgets import QApplication, QLineEdit, QLabel, QCheckBox, QButtonGroup, QRadioButton, QDoubleSpinBox, QPlainTextEdit
|
from PySide2.QtWidgets import QApplication, QLineEdit, QLabel, QCheckBox, QButtonGroup, QRadioButton, QDoubleSpinBox, QPlainTextEdit
|
||||||
from PySide2.QtGui import QCursor, QIcon, QImage, QDesktopServices
|
from PySide2.QtGui import QCursor, QIcon, QImage
|
||||||
from syncplay.players.playerFactory import PlayerFactory
|
from syncplay.players.playerFactory import PlayerFactory
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from syncplay import utils
|
from syncplay import utils
|
||||||
@ -114,7 +114,7 @@ class ConfigDialog(QtWidgets.QDialog):
|
|||||||
self.executablepathCombobox.setFixedWidth(self.mediapathTextbox.width())
|
self.executablepathCombobox.setFixedWidth(self.mediapathTextbox.width())
|
||||||
|
|
||||||
def openHelp(self):
|
def openHelp(self):
|
||||||
self.QtWidgets.QDesktopServices.openUrl(QUrl("http://syncplay.pl/guide/client/"))
|
self.QtGui.QDesktopServices.openUrl(QUrl("http://syncplay.pl/guide/client/"))
|
||||||
|
|
||||||
def safenormcaseandpath(self, path):
|
def safenormcaseandpath(self, path):
|
||||||
if utils.isURL(path):
|
if utils.isURL(path):
|
||||||
@ -346,10 +346,10 @@ class ConfigDialog(QtWidgets.QDialog):
|
|||||||
defaultdirectory = self.config["mediaSearchDirectories"][0]
|
defaultdirectory = self.config["mediaSearchDirectories"][0]
|
||||||
elif os.path.isdir(self.mediadirectory):
|
elif os.path.isdir(self.mediadirectory):
|
||||||
defaultdirectory = self.mediadirectory
|
defaultdirectory = self.mediadirectory
|
||||||
elif os.path.isdir(QDesktopServices.storageLocation(QDesktopServices.MoviesLocation)):
|
elif os.path.isdir(QStandardPaths.standardLocations(QStandardPaths.MoviesLocation)[0]):
|
||||||
defaultdirectory = QDesktopServices.storageLocation(QDesktopServices.MoviesLocation)
|
defaultdirectory = QStandardPaths.standardLocations(QStandardPaths.MoviesLocation)[0]
|
||||||
elif os.path.isdir(QDesktopServices.storageLocation(QDesktopServices.HomeLocation)):
|
elif os.path.isdir(QStandardPaths.standardLocations(QStandardPaths.HomeLocation)[0]):
|
||||||
defaultdirectory = QDesktopServices.storageLocation(QDesktopServices.HomeLocation)
|
defaultdirectory = QStandardPaths.standardLocations(QStandardPaths.HomeLocation)[0]
|
||||||
else:
|
else:
|
||||||
defaultdirectory = ""
|
defaultdirectory = ""
|
||||||
browserfilter = "All files (*)"
|
browserfilter = "All files (*)"
|
||||||
|
|||||||
@ -152,8 +152,8 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
if not window.playlist.isEnabled():
|
if not window.playlist.isEnabled():
|
||||||
return
|
return
|
||||||
window.setPlaylistInsertPosition(None)
|
window.setPlaylistInsertPosition(None)
|
||||||
if QtWidgets.QDropEvent.proposedAction(event) == Qt.MoveAction:
|
if QtGui.QDropEvent.proposedAction(event) == Qt.MoveAction:
|
||||||
QtWidgets.QDropEvent.setDropAction(event, Qt.CopyAction) # Avoids file being deleted
|
QtGui.QDropEvent.setDropAction(event, Qt.CopyAction) # Avoids file being deleted
|
||||||
data = event.mimeData()
|
data = event.mimeData()
|
||||||
urls = data.urls()
|
urls = data.urls()
|
||||||
|
|
||||||
@ -251,8 +251,8 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
if not window.playlist.isEnabled():
|
if not window.playlist.isEnabled():
|
||||||
return
|
return
|
||||||
window.setPlaylistInsertPosition(None)
|
window.setPlaylistInsertPosition(None)
|
||||||
if QtWidgets.QDropEvent.proposedAction(event) == Qt.MoveAction:
|
if QtGui.QDropEvent.proposedAction(event) == Qt.MoveAction:
|
||||||
QtWidgets.QDropEvent.setDropAction(event, Qt.CopyAction) # Avoids file being deleted
|
QtGui.QDropEvent.setDropAction(event, Qt.CopyAction) # Avoids file being deleted
|
||||||
data = event.mimeData()
|
data = event.mimeData()
|
||||||
urls = data.urls()
|
urls = data.urls()
|
||||||
|
|
||||||
@ -1490,8 +1490,8 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
|
|
||||||
def dropEvent(self, event):
|
def dropEvent(self, event):
|
||||||
rewindFile = False
|
rewindFile = False
|
||||||
if QtWidgets.QDropEvent.proposedAction(event) == Qt.MoveAction:
|
if QtGui.QDropEvent.proposedAction(event) == Qt.MoveAction:
|
||||||
QtWidgets.QDropEvent.setDropAction(event, Qt.CopyAction) # Avoids file being deleted
|
QtGui.QDropEvent.setDropAction(event, Qt.CopyAction) # Avoids file being deleted
|
||||||
rewindFile = True
|
rewindFile = True
|
||||||
data = event.mimeData()
|
data = event.mimeData()
|
||||||
urls = data.urls()
|
urls = data.urls()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user