mirror of
https://github.com/Syncplay/syncplay
synced 2025-02-16 19:06:52 +00:00
commit
0f2f8fa651
@ -11,6 +11,8 @@ import os
|
||||
from syncplay.utils import formatTime, sameFilename, sameFilesize, sameFileduration, RoomPasswordProvider, formatSize, isURL
|
||||
from functools import wraps
|
||||
from twisted.internet import task
|
||||
if sys.platform.startswith('darwin'):
|
||||
from Foundation import NSURL
|
||||
lastCheckedForUpdates = None
|
||||
|
||||
class UserlistItemDelegate(QtGui.QStyledItemDelegate):
|
||||
@ -161,6 +163,9 @@ class MainWindow(QtGui.QMainWindow):
|
||||
indexRow = window.playlist.count() if window.clearedPlaylistNote else 0
|
||||
|
||||
for url in urls[::-1]:
|
||||
if sys.platform.startswith('darwin'):
|
||||
dropfilepath = os.path.abspath(NSURL.URLWithString_(str(url.toString())).filePathURL().path())
|
||||
else:
|
||||
dropfilepath = os.path.abspath(unicode(url.toLocalFile()))
|
||||
if os.path.isfile(dropfilepath):
|
||||
window.addFileToPlaylist(dropfilepath, indexRow)
|
||||
@ -263,6 +268,9 @@ class MainWindow(QtGui.QMainWindow):
|
||||
if indexRow == -1:
|
||||
indexRow = window.playlist.count()
|
||||
for url in urls[::-1]:
|
||||
if sys.platform.startswith('darwin'):
|
||||
dropfilepath = os.path.abspath(NSURL.URLWithString_(str(url.toString())).filePathURL().path())
|
||||
else:
|
||||
dropfilepath = os.path.abspath(unicode(url.toLocalFile()))
|
||||
if os.path.isfile(dropfilepath):
|
||||
window.addFileToPlaylist(dropfilepath, indexRow)
|
||||
@ -809,6 +817,9 @@ class MainWindow(QtGui.QMainWindow):
|
||||
return
|
||||
|
||||
self.loadMediaBrowseSettings()
|
||||
if sys.platform.startswith('darwin'):
|
||||
options = QtGui.QFileDialog.Options(QtGui.QFileDialog.DontUseNativeDialog)
|
||||
else:
|
||||
options = QtGui.QFileDialog.Options()
|
||||
self.mediadirectory = ""
|
||||
currentdirectory = os.path.dirname(self._syncplayClient.userlist.currentUser.file["path"]) if self._syncplayClient.userlist.currentUser.file else None
|
||||
@ -1489,6 +1500,9 @@ class MainWindow(QtGui.QMainWindow):
|
||||
data = event.mimeData()
|
||||
urls = data.urls()
|
||||
if urls and urls[0].scheme() == 'file':
|
||||
if sys.platform.startswith('darwin'):
|
||||
dropfilepath = os.path.abspath(NSURL.URLWithString_(str(event.mimeData().urls()[0].toString())).filePathURL().path())
|
||||
else:
|
||||
dropfilepath = os.path.abspath(unicode(event.mimeData().urls()[0].toLocalFile()))
|
||||
if rewindFile == False:
|
||||
self._syncplayClient._player.openFile(dropfilepath)
|
||||
|
Loading…
Reference in New Issue
Block a user