Allow players to have custom open dialogs (e.g. for XBMC)
This commit is contained in:
parent
d9dfffefbb
commit
30b28afa14
@ -82,7 +82,13 @@ class BasePlayer(object):
|
||||
@staticmethod
|
||||
def getExpandedPath(path):
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
'''
|
||||
Opens a custom media browse dialog, and then changes to that media if appropriate
|
||||
'''
|
||||
@staticmethod
|
||||
def openCustomOpenDialog(self):
|
||||
raise NotImplementedError()
|
||||
|
||||
class DummyPlayer(BasePlayer):
|
||||
|
||||
|
||||
@ -306,6 +306,7 @@ class MpcHcApi:
|
||||
|
||||
class MPCHCAPIPlayer(BasePlayer):
|
||||
speedSupported = False
|
||||
customOpenDialog = False
|
||||
|
||||
def __init__(self, client):
|
||||
from twisted.internet import reactor
|
||||
|
||||
@ -9,6 +9,7 @@ import os
|
||||
|
||||
class MplayerPlayer(BasePlayer):
|
||||
speedSupported = True
|
||||
customOpenDialog = False
|
||||
RE_ANSWER = re.compile(constants.MPLAYER_ANSWER_REGEX)
|
||||
POSITION_QUERY = 'time_pos'
|
||||
OSD_QUERY = 'osd_show_text'
|
||||
|
||||
@ -13,6 +13,7 @@ from syncplay.messages import getMessage
|
||||
|
||||
class VlcPlayer(BasePlayer):
|
||||
speedSupported = True
|
||||
customOpenDialog = False
|
||||
RE_ANSWER = re.compile(constants.VLC_ANSWER_REGEX)
|
||||
SLAVE_ARGS = constants.VLC_SLAVE_ARGS
|
||||
if not sys.platform.startswith('darwin'):
|
||||
|
||||
@ -341,6 +341,10 @@ class MainWindow(QtGui.QMainWindow):
|
||||
settings.endGroup()
|
||||
|
||||
def browseMediapath(self):
|
||||
if self._syncplayClient._player.customOpenDialog == True:
|
||||
self._syncplayClient._player.openCustomOpenDialog()
|
||||
return
|
||||
|
||||
self.loadMediaBrowseSettings()
|
||||
options = QtGui.QFileDialog.Options()
|
||||
if os.path.isdir(self.mediadirectory):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user