Esempio n. 1
0
    def play(self, arg=None, menuw=None):
        """
        Play the item.
        """
        if not self.player or self.player_rating < 10:
            AlertBox(text=_('No player for this item found')).show()
            return

        if not self['resume'] and self['autobookmark_resume']:
            self.__play_args = (arg, menuw)
            dialog.show_confirmation(_('Do you want to resume play back or play from the start?'),
                    cancel_handler=self.resume_play, cancel_text=_('From Start'),
                    proceed_handler=self.resume_resume, proceed_text=_('Resume'))
        else:
            self.__play(arg, menuw)
Esempio n. 2
0
 def play(self, arg=None, menuw=None):
     """ Start watching TV """
     logger.log(9, 'play(arg=%r, menuw=%r)', arg, menuw)
     # watching TV should only be possible from the guide
     if not self.context == 'guide':
         rc.post_event(MENU_SELECT)
         return
     now = time.time()
     if menuw: menuw.delete_submenu()
     # Check if the selected program is >7 min in the future
     if self.prog.start > now + (7 * 60):
         if menuw: menuw.show()
         # this program is in the future
         if self.scheduled:
             msgtext = _(
                 'Do you want to remove the Program from the record schedule?'
             )
             confirmbtn = _('Remove')
         else:
             msgtext = _(
                 'This Program is in the future. Do you want to record it?')
             confirmbtn = _('Record')
         dialog.show_confirmation(msgtext,
                                  lambda: self.toggle_rec(menuw=menuw),
                                  proceed_text=confirmbtn)
         return
     else:
         # check if the device is free
         fc = FreevoChannels()
         # for that we need the name of the lock file
         suffix = fc.getVideoGroup(self.prog.channel_id, True,
                                   CHANNEL_ID).vdev
         suffix = suffix.split('/')[-1]
         tvlockfile = config.FREEVO_CACHEDIR + '/record.' + suffix
         if os.path.exists(tvlockfile):
             if menuw: menuw.show()
             # XXX: In the future add the options to watch what we are
             #      recording or cancel it and watch TV.
             msgtext = _('Sorry, you cannot watch TV while recording. ')
             msgtext += _('If this is not true then remove ')
             msgtext += tvlockfile + '.'
             dialog.show_alert(msgtext)
         else:
             # everything is ok, we can start watching!
             self.parent.hide()
             self.parent.player('tv', self.prog.channel_id)
Esempio n. 3
0
    def play(self, arg=None, menuw=None):
        """
        Play the item.
        """
        if not self.player or self.player_rating < 10:
            AlertBox(text=_('No player for this item found')).show()
            return

        if not self['resume'] and self['autobookmark_resume']:
            self.__play_args = (arg, menuw)
            dialog.show_confirmation(
                _('Do you want to resume play back or play from the start?'),
                cancel_handler=self.resume_play,
                cancel_text=_('From Start'),
                proceed_handler=self.resume_resume,
                proceed_text=_('Resume'))
        else:
            self.__play(arg, menuw)
Esempio n. 4
0
 def play(self, arg=None, menuw=None):
     """ Start watching TV """
     logger.log( 9, 'play(arg=%r, menuw=%r)', arg, menuw)
     # watching TV should only be possible from the guide
     if not self.context == 'guide':
         rc.post_event(MENU_SELECT)
         return
     now = time.time()
     if menuw: menuw.delete_submenu()
     # Check if the selected program is >7 min in the future
     if self.prog.start > now + (7*60):
         if menuw: menuw.show()
         # this program is in the future
         if self.scheduled:
             msgtext= _('Do you want to remove the Program from the record schedule?')
             confirmbtn = _('Remove')
         else:
             msgtext = _('This Program is in the future. Do you want to record it?')
             confirmbtn = _('Record')
         dialog.show_confirmation(msgtext, lambda: self.toggle_rec(menuw=menuw), proceed_text=confirmbtn)
         return
     else:
         # check if the device is free
         fc = FreevoChannels()
         # for that we need the name of the lock file
         suffix = fc.getVideoGroup(self.prog.channel_id, True, CHANNEL_ID).vdev
         suffix = suffix.split('/')[-1]
         tvlockfile = config.FREEVO_CACHEDIR + '/record.'+suffix
         if os.path.exists(tvlockfile):
             if menuw: menuw.show()
             # XXX: In the future add the options to watch what we are
             #      recording or cancel it and watch TV.
             msgtext = _('Sorry, you cannot watch TV while recording. ')
             msgtext += _('If this is not true then remove ')
             msgtext += tvlockfile + '.'
             dialog.show_alert(msgtext)
         else:
             # everything is ok, we can start watching!
             self.parent.hide()
             self.parent.player('tv', self.prog.channel_id)
Esempio n. 5
0
 def confirm_info_delete(self, arg=None, menuw=None):
     self.menuw = menuw
     dialog.show_confirmation(_('Delete info about\n \'%s\'?') %
                              self.item.name,
                              self.delete_info,
                              proceed_text=_('Delete info'))
Esempio n. 6
0
 def confirm_delete(self, arg=None, menuw=None):
     self.menuw = menuw
     dialog.show_confirmation(_('Do you wish to delete\n \'%s\'?') %
                              self.item.name,
                              self.delete_file,
                              proceed_text=_('Delete'))
Esempio n. 7
0
 def remove_reminder(self, arg=None, menuw=None):
     self.menuw = menuw
     dialog.show_confirmation(_('Do you want to remove the reminder for %s') % self.prog.title,
                             proceed_handler=self.__remove_reminder, proceed_text=_('Remove'))
Esempio n. 8
0
 def confirm_edl_delete(self, arg=None, menuw=None):
     self.menuw = menuw
     dialog.show_confirmation(_('Delete edl about\n \'%s\'?') % self.item.name,
                self.delete_edl, proceed_text=_('Delete edl'))
Esempio n. 9
0
 def confirm_delete(self, arg=None, menuw=None):
     self.menuw = menuw
     dialog.show_confirmation(_('Do you wish to delete\n \'%s\'?') % self.item.name,
                self.delete_file, proceed_text=_('Delete'))
Esempio n. 10
0
 def delete(self, arg=None, menuw=None):
     self.menuw = menuw
     dialog.show_confirmation(_('Do you want to delete bookmark \'%s\'?') % self.time_str,
                                 self.__delete_do, proceed_text=_('Delete bookmark'))
Esempio n. 11
0
 def __clear_bookmarks(self, arg=None, menuw=None):
     self.menuw = menuw
     dialog.show_confirmation(_('Do you want to delete all bookmarks?'),
                                 self.__clear_bookmarks_do, proceed_text=_('Delete bookmarks'))
Esempio n. 12
0
 def remove_reminder(self, arg=None, menuw=None):
     self.menuw = menuw
     dialog.show_confirmation(
         _('Do you want to remove the reminder for %s') % self.prog.title,
         proceed_handler=self.__remove_reminder,
         proceed_text=_('Remove'))
Esempio n. 13
0
 def confirm_info_delete(self, arg=None, menuw=None):
     self.menuw = menuw
     dialog.show_confirmation(_('Delete info about\n \'%s\'?') % self.item['title'],
                self.delete_info, proceed_text=_('Delete info'))
Esempio n. 14
0
 def confirm_image_delete(self, arg=None, menuw=None):
     self.menuw = menuw
     dialog.show_confirmation(_('Delete image about\n \'%s\'?') %
                              self.item['title'],
                              self.delete_image,
                              proceed_text=_('Delete image'))
Esempio n. 15
0
 def confirm_delete(self, arg=None, menuw=None):
     """
     Confirm the user wants to delete an entire series.
     """
     self.menuw = menuw
     dialog.show_confirmation(_('Do you wish to delete the series\n \'%s\'?') % self.name, self.delete_all, proceed_text=_('Delete series'))