diff options
| author | Andreas Frisch <andreas.frisch@multimedia-labs.de> | 2008-05-25 12:17:39 +0000 |
|---|---|---|
| committer | Andreas Frisch <andreas.frisch@multimedia-labs.de> | 2008-05-25 12:17:39 +0000 |
| commit | b68fe12ef5f0587353988eac7619adcb8e38ce58 (patch) | |
| tree | 15dc6b75cc937ebb3ae480534645ea2a5b1b4dc5 /lib/python/Plugins/Extensions/DVDPlayer/plugin.py | |
| parent | 924b11457b3276c94631707fc66419b8db6d5cb8 (diff) | |
| download | enigma2-b68fe12ef5f0587353988eac7619adcb8e38ce58.tar.gz enigma2-b68fe12ef5f0587353988eac7619adcb8e38ce58.zip | |
Add callback for playing from physical dvd drives
Diffstat (limited to 'lib/python/Plugins/Extensions/DVDPlayer/plugin.py')
| -rw-r--r-- | lib/python/Plugins/Extensions/DVDPlayer/plugin.py | 18 |
1 files changed, 17 insertions, 1 deletions
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() |
