From b68fe12ef5f0587353988eac7619adcb8e38ce58 Mon Sep 17 00:00:00 2001 From: Andreas Frisch Date: Sun, 25 May 2008 12:17:39 +0000 Subject: [PATCH] Add callback for playing from physical dvd drives --- .../Plugins/Extensions/DVDPlayer/plugin.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/python/Plugins/Extensions/DVDPlayer/plugin.py b/lib/python/Plugins/Extensions/DVDPlayer/plugin.py index 96ed5f67..4c66a5c4 100644 --- a/lib/python/Plugins/Extensions/DVDPlayer/plugin.py +++ b/lib/python/Plugins/Extensions/DVDPlayer/plugin.py @@ -318,6 +318,13 @@ class DVDPlayer(Screen, InfoBarBase, InfoBarNotifications, InfoBarSeek, InfoBarP }) self.onClose.append(self.__onClose) + + if fileExists("/dev/cdroms/cdrom0"): + print "physical dvd found (/dev/cdroms/cdrom0)" + self.physicalDVD = True + else: + self.physicalDVD = False + self.onFirstExecBegin.append(self.showFileBrowser) self.service = None self.in_menu = False @@ -504,7 +511,16 @@ class DVDPlayer(Screen, InfoBarBase, InfoBarNotifications, InfoBarSeek, InfoBarP self.askLeavePlayer() def showFileBrowser(self): - self.session.openWithCallback(self.FileBrowserClosed, FileBrowser) + if self.physicalDVD: + self.session.openWithCallback(self.DVDdriveCB, MessageBox, text=_("Do you want to play DVD in drive?"), timeout=5 ) + else: + self.session.openWithCallback(self.FileBrowserClosed, FileBrowser) + + def DVDdriveCB(self, answer): + if answer == True: + self.FileBrowserClosed("/dev/cdroms/cdrom0") + else: + self.session.openWithCallback(self.FileBrowserClosed, FileBrowser) def FileBrowserClosed(self, val): curref = self.session.nav.getCurrentlyPlayingServiceReference() -- 2.30.2