def __init__(self, session, csel, service):
        self.csel = csel
        serviceHandler = ServiceCenter.getInstance()
        info = serviceHandler.info(service)
        self.sourcepath = service.getPath().rsplit('/', 1)[0]
        if len(self.csel.list.multiSelection) == 0:
            self.name = info.getName(service)
            self.service_list = [service]
        else:
            self.name = _("Selected movies")
            self.service_list = self.csel.list.multiSelection  
        
        for s in self.service_list:
            info = serviceHandler.info(s)
            name = info.getName(s)
            s.setName(name)

        cbkeys = []
        listpath = []
        listpath.append((_("To adjusted move/copy location"), "CALLFUNC", self.selectedLocation))
        cbkeys.append("blue")
        listpath.append((_("Directory Selection"), "CALLFUNC", self.selectDir))
        cbkeys.append("yellow")
        listpath.append((_("Show active move/copy processes"), "CALLFUNC", self.showActive))
        cbkeys.append("green")
        listpath.append((_("Close"), "CALLFUNC", self.close))
        cbkeys.append("red")

        ChoiceBox.__init__(self, session, list=listpath, keys=cbkeys)
        self.onShown.append(self.setWindowTitle)
Exemple #2
0
 def __init__(self, session, service):
     self.service = service
     serviceHandler = eServiceCenter.getInstance()
     path = self.service.getPath()
     info = serviceHandler.info(self.service)
     if not info:
         self.name = path
     else:
         self.name = info.getName(self.service)
     tlist = [
         (_("Don't reconstruct"), "CALLFUNC", self.confirmed0),
         (_("Reconstruct the .ap and .sc files of the selected movie"),
          "CALLFUNC", self.confirmed1),
         (_("Reconstruct all missing .ap and .sc files in this directory"),
          "CALLFUNC", self.confirmed2),
         (_("Check any running reconstruct process"), "CALLFUNC",
          self.confirmed3),
     ]
     ChoiceBox.__init__(self,
                        session,
                        _("What would you like to reconstruct?  (\"%s\")") %
                        (self.name),
                        list=tlist,
                        selection=0)
     self.skinName = "ChoiceBox"
Exemple #3
0
		def __init__(self, session, type=MediaCore.TYPE_AUDIO):
			menu = []
			playlists = DatabasePlaylist.getPlaylists(type)
			for playlist in playlists:
				menu.append( (playlist.name, playlist) )
			ChoiceBox.__init__(self, session, list=menu)
			self.setTitle(_("Playlists"))
Exemple #4
0
    def __init__(self, session, csel, service):
        self.csel = csel
        serviceHandler = ServiceCenter.getInstance()
        info = serviceHandler.info(service)
        self.sourcepath = service.getPath().rsplit('/', 1)[0]
        if len(self.csel.list.multiSelection) == 0:
            self.name = info.getName(service)
            self.service_list = [service]
        else:
            self.name = _("Selected movies")
            self.service_list = self.csel.list.multiSelection

        for s in self.service_list:
            info = serviceHandler.info(s)
            name = info.getName(s)
            s.setName(name)

        cbkeys = []
        listpath = []
        listpath.append((_("To adjusted move/copy location"), "CALLFUNC",
                         self.selectedLocation))
        cbkeys.append("blue")
        listpath.append((_("Directory Selection"), "CALLFUNC", self.selectDir))
        cbkeys.append("yellow")
        listpath.append((_("Show active move/copy processes"), "CALLFUNC",
                         self.showActive))
        cbkeys.append("green")
        listpath.append((_("Close"), "CALLFUNC", self.close))
        cbkeys.append("red")

        ChoiceBox.__init__(self, session, list=listpath, keys=cbkeys)
        self.onShown.append(self.setWindowTitle)
Exemple #5
0
 def __init__(self, session, service):
     self.service = service
     serviceHandler = eServiceCenter.getInstance()
     self.path = self.service.getPath()
     info = serviceHandler.info(self.service)
     if not info:
         self.name = path
         self.len = 0
     else:
         self.name = info.getName(self.service)
         self.len = info.getLength(self.service)
     tlist = [
         (_("Don't cut"), "CALLFUNC", self.confirmed0),
         (_("Replace the original movie with the cut movie"), "CALLFUNC",
          self.confirmed1),
         (_("Place the cut movie in a new file ending with \" cut\""),
          "CALLFUNC", self.confirmed2),
         (_("Advanced cut specification..."), "CALLFUNC", self.confirmed3),
     ]
     ChoiceBox.__init__(self,
                        session,
                        _("How would you like to cut \"%s\"?") %
                        (self.name),
                        list=tlist)
     self.skinName = "ChoiceBox"
Exemple #6
0
 def __init__(self, session, service):
     self.service = service
     serviceHandler = eServiceCenter.getInstance()
     self.offline = serviceHandler.offlineOperations(self.service)
     path = self.service.getPath()
     info = serviceHandler.info(self.service)
     if not info:
         self.name = path
     else:
         self.name = info.getName(self.service)
     if self.offline is None:
         tlist = [
             (_("Cannot reconstruct this item"), "CALLFUNC",
              self.confirmed0),
         ]
     else:
         tlist = [
             (_("Don't reconstruct"), "CALLFUNC", self.confirmed0),
             (_("Reconstruct the .ap and .sc files of the selected movie"),
              "CALLFUNC", self.confirmed1),
             # not yet #  (_("Reconstruct all missing .ap and .sc files in this directory"), "CALLFUNC", self.confirmed2),
         ]
     ChoiceBox.__init__(self,
                        session,
                        _("What would you like to reconstruct?  (\"%s\")") %
                        (self.name),
                        list=tlist,
                        selection=0)
     self.skinName = "ChoiceBox"
 def __init__(self, session, csel, service):
     self.csel = csel
     serviceHandler = eServiceCenter.getInstance()
     info = serviceHandler.info(service)
     self.sourcepath = service.getPath().rsplit("/", 1)[0]
     if len(self.csel.list.multiSelection) == 0:
         self.name = info.getName(service)
         self.service_list = [service]
     else:
         self.service_list = self.csel.list.multiSelection
         self.name = _("Selected movies")
     cbkeys = []
     listpath = []
     for element in range(len(listpath)):
         if element <= 10:
             cbkeys.append(str(element))
         else:
             cbkeys.append("")
     listpath.append((_("To adjusted move/copy location"), "CALLFUNC", self.selectedLocation))
     cbkeys.append("blue")
     listpath.append((_("Directory Selection"), "CALLFUNC", self.selectDir))
     cbkeys.append("yellow")
     listpath.append((_("Show active move/copy processes"), "CALLFUNC", self.showActive))
     cbkeys.append("green")
     listpath.append((_("Abort"), "CALLFUNC", self.close))
     cbkeys.append("red")
     if (
         len(os.listdir(config.movielist.last_videodir.value)) == 0
         and defaultMoviePath() <> config.movielist.last_videodir.value
     ):
         listpath.append((_("Remove ' %s '") % config.movielist.last_videodir.value, "CALLFUNC", self.remove))
         cbkeys.append("red")
     ChoiceBox.__init__(self, session, list=listpath, keys=cbkeys)
     self.onShown.append(self.setWindowTitle)
Exemple #8
0
    def __init__(self,
                 session,
                 title="",
                 list=[],
                 keys=None,
                 selection=0,
                 zap_time=0,
                 zap_service=None,
                 monitored_event=None,
                 monitored_service=None,
                 skin_name=[]):
        ChoiceBox.__init__(self, session, title, list, keys, selection,
                           skin_name)

        self.update_timer = eTimer()
        self.update_timer.callback.append(self.update)

        self.zap_time = zap_time
        self.zap_service = zap_service
        self.monitored_event = monitored_event
        self.monitored_service = monitored_service

        # Start timer to update the ChoiceBox every second
        self.update_timer.start(1000)
        self.setTitle("WerbeZapper")
        self.update()
Exemple #9
0
		def __init__(self, session, type=MediaCore.TYPE_AUDIO):
			menu = []
			playlists = DatabasePlaylist.getPlaylists(type)
			for playlist in playlists:
				menu.append( (playlist.name, playlist) )
			ChoiceBox.__init__(self, session, list=menu)
			self.setTitle(_("Playlists"))
Exemple #10
0
    def __init__(self,
                 session,
                 title="",
                 list=None,
                 keys=None,
                 selection=0,
                 skin_name=None,
                 text="",
                 reorderConfig="",
                 var=""):
        print 'title:', title
        ChoiceBox.__init__(self, session, title, list, keys, selection,
                           skin_name, text, reorderConfig, var)
        print 'title:', title

        if var and var in ('unstable', 'updating', 'stable', 'unknown'):
            self.var = var
            self['feedStatusMSG'] = Label()
            self['tl_off'] = Pixmap()
            self['tl_red'] = Pixmap()
            self['tl_yellow'] = Pixmap()
            self['tl_green'] = Pixmap()

        self["menuActions"] = NumberActionMap(
            ["MenuActions"], {"menu": self.opensettings},
            prio=-3)  # Override ChoiceBox "menu" action
        self.onShown.append(self.onshow)
Exemple #11
0
	def __init__(self, session):
		Screen.__init__(self, session)

		self.list = [(_("cancel factory reset"), "CALLFUNC", self.quitMainloopScreen),
		(_("do factory reset"), "CALLFUNC", self.quitMainloopScreen),
		(_("do full factory reset"), "CALLFUNC", self.quitMainloopScreen) ]

		ChoiceBox.__init__(self, session, _("When you do a factory reset,"
			"you will lose your configuration data\n"
			"(including bouquets, services...)\n"
			"Really do a factory reset?"), self.list)

		ProtectedScreen2.__init__(self)
	def __init__(self, session, title="", list=[], keys=None, selection=0, zap_time=0, zap_service=None, monitored_event=None, monitored_service=None, skin_name=[]):
		ChoiceBox.__init__(self, session, title, list, keys, selection, skin_name)
		
		self.update_timer = eTimer()
		self.update_timer_conn = self.update_timer.timeout.connect(self.update)
		
		self.zap_time = zap_time
		self.zap_service = zap_service
		self.monitored_event = monitored_event
		self.monitored_service = monitored_service
		
		# Start timer to update the ChoiceBox every second
		self.update_timer.start(1000)
		self.setTitle( "WerbeZapper" )
		self.update()
Exemple #13
0
class DMC_SubtitleDownloader(ChoiceBox):
	service = "OpenSubtitles"

	def __init__(self, session, args):
		global Manager
		global utf8ToLatin
		if Manager is None:
			from Plugins.Extensions.ProjectValerie.DMC_Plugins.DMC_SyncExtras.Manager import Manager
		if utf8ToLatin is None:
			from Plugins.Extensions.ProjectValerie.DMC_Plugins.DMC_SyncExtras.Utf8 import utf8ToLatin
		self.session = session
		self.service = config.plugins.pvmc.plugins.subdown.provider.value
		self.language_1 = config.plugins.pvmc.plugins.subdown.language1.value
		self.language_2 = config.plugins.pvmc.plugins.subdown.language2.value
		self.language_3 = config.plugins.pvmc.plugins.subdown.language3.value
		
		year = str(args["Year"])
		title = args["Title"] # + " (" + str(year) + ")"
		if args.has_key("Season"):
			season = str(args["Season"])
			episode = str(args["Episode"])
			
			#tvshowEntry = Manager("SubtitleDownloader").getElement_ByUsingPrimaryKey(Manager.TVSHOWS, \
			#	dict({'thetvdbid': args["TheTvDbId"]}))			
			tvshowEntry = Manager("SubtitleDownloader").getMedia(args["Id"])
			tvshow = tvshowEntry.Title
		else:
			season = ""
			episode = ""
			tvshow = ""
		self.file_original_path = args["Path"]
		
		set_temp = False
		rar = False
		
		self.tmp_sub_dir = "/tmp/subdir"
		try:
			shutil.rmtree(str(self.tmp_sub_dir))
		except Exception, ex:
			printl("Exception: " + str(ex), __name__, "E")
		os.mkdir(str(self.tmp_sub_dir))
		self.sub_folder = self.file_original_path.rsplit("/", 1)[0]
		
		exec ( "from DMC_SubtitleDownloaderExtras.services.%s import service as Service" % (self.service))
		self.Service = Service
		printl("Searching sub for " + str(self.file_original_path), self, "I")
		self.subtitles_list, self.session_id, msg = self.Service.search_subtitles( self.file_original_path, title, tvshow, year, season, episode, set_temp, rar, self.language_1, self.language_2, self.language_3 )
		
		subtitleList = []
		for subtitle in self.subtitles_list:
			printl("Subtitle: " + str(subtitle), self, "D")
			lang = ""
			if subtitle.has_key("language_id"):
				lang = utf8ToLatin(subtitle["language_id"])
			elif subtitle.has_key("language_name"):
				lang = utf8ToLatin(subtitle["language_name"])
			subtitleList.append(("[" + lang + "] " + utf8ToLatin(subtitle["filename"]), "CALLFUNC", self.Download_Subtitles, subtitle))
		
		ChoiceBox.__init__(self, self.session, list = subtitleList, title = self.file_original_path)
Exemple #14
0
	def __init__(self, session, service):
		self.service = service
		serviceHandler = eServiceCenter.getInstance()
		path = self.service.getPath()
		info = serviceHandler.info(self.service)
		if not info:
			self.name = path
		else:
			self.name = info.getName(self.service)
		tlist = [
			(_("Don't reconstruct"), "CALLFUNC", self.confirmed0),
			(_("Reconstruct the .ap and .sc files of the selected movie"), "CALLFUNC", self.confirmed1),
			(_("Reconstruct all missing .ap and .sc files in this directory"), "CALLFUNC", self.confirmed2),
			(_("Check any running reconstruct process"), "CALLFUNC", self.confirmed3),
		]
		ChoiceBox.__init__(self, session, _("What would you like to reconstruct?  (\"%s\")") % (self.name), list = tlist, selection = 0)
		self.skinName = "ChoiceBox"
Exemple #15
0
	def __init__(self, session, service):
		self.service = service
		serviceHandler = eServiceCenter.getInstance()
		path = self.service.getPath()
		info = serviceHandler.info(self.service)
		if not info:
			self.name = path
		else:
			self.name = info.getName(self.service)
		tlist = [
			(_("Don't cut"), "CALLFUNC", self.confirmed0),
			(_("Replace the original movie with the cut movie"), "CALLFUNC", self.confirmed1),
			(_("Place the cut movie in a new file ending with \" cut\""), "CALLFUNC", self.confirmed2),
			(_("Advanced cut specification..."), "CALLFUNC", self.confirmed3),
		]
		ChoiceBox.__init__(self, session, _("How would you like to cut \"%s\"?") % (self.name), list = tlist, selection = 0)
		self.skinName = "ChoiceBox"
Exemple #16
0
    def __init__(self, session):
        Screen.__init__(self, session)

        self.list = [
            (_("cancel factory reset"), "CALLFUNC", self.quitMainloopScreen),
            (_("do factory reset"), "CALLFUNC", self.quitMainloopScreen),
            (_("do full factory reset"), "CALLFUNC", self.quitMainloopScreen)
        ]

        ChoiceBox.__init__(
            self, session,
            _("When you do a factory reset,"
              "you will lose your configuration data\n"
              "(including bouquets, services...)\n"
              "Really do a factory reset?"), self.list)

        ProtectedScreen2.__init__(self)
Exemple #17
0
	def __init__(self, session, title="", list=None, keys=None, selection=0, skin_name=None, text="", reorderConfig="", var=""):
		print('title:', title)
		ChoiceBox.__init__(self, session, title, list, keys, selection, skin_name, text, reorderConfig, var)
		print('title:', title)

		self.var = None
		if var and var in ("unstable", "updating", "stable", "unknown", "alien", "developer"):
			self.var = var
		self['feedStatusMSG'] = Label()
		self['tl_off'] = Pixmap()
		self['tl_red'] = Pixmap()
		self['tl_yellow'] = Pixmap()
		self['tl_green'] = Pixmap()
		self['tl_off'].hide()
		self['tl_red'].hide()
		self['tl_yellow'].hide()
		self['tl_green'].hide()

		self.onShown.append(self.onshow)
Exemple #18
0
	def __init__(self, session, service):
		self.service = service
		serviceHandler = eServiceCenter.getInstance()
		self.offline = serviceHandler.offlineOperations(self.service)
		path = self.service.getPath()
		info = serviceHandler.info(self.service)
		if not info:
			self.name = path
		else:
			self.name = info.getName(self.service)
		if self.offline is None:
			tlist = [(_("Cannot reconstruct this item"),  "CALLFUNC", self.confirmed0),]
		else:
			tlist = [
				(_("Don't reconstruct"), "CALLFUNC", self.confirmed0),
				(_("Reconstruct the .ap and .sc files of the selected movie"), "CALLFUNC", self.confirmed1),
				# not yet #  (_("Reconstruct all missing .ap and .sc files in this directory"), "CALLFUNC", self.confirmed2),
			]
		ChoiceBox.__init__(self, session, _("What would you like to reconstruct?  (\"%s\")") % (self.name), list = tlist, selection = 0)
		self.skinName = "ChoiceBox"
Exemple #19
0
	def __init__(self, session, title="", list=None, keys=None, selection=0, skin_name=None, text="", reorderConfig="", var="", menu_path=""):
		print 'title:',title
		ChoiceBox.__init__(self, session, title, list, keys, selection, skin_name, text, reorderConfig, var, menu_path)
		print 'title:',title

		if var and var in ('unstable', 'updating', 'stable', 'unknown'):
			self.var = var
			self['feedStatusMSG'] = Label()
			self['tl_off'] = Pixmap()
			self['tl_red'] = Pixmap()
			self['tl_yellow'] = Pixmap()
			self['tl_green'] = Pixmap()
		if skin_name and 'SoftwareUpdateChoices' in skin_name:
			self["menu_path_compressed"] = StaticText(menu_path)

		self["actions"] = NumberActionMap(["WizardActions", "InputActions", "ColorActions", "DirectionActions", "MenuActions"],
		{
			"ok": self.go,
			"1": self.keyNumberGlobal,
			"2": self.keyNumberGlobal,
			"3": self.keyNumberGlobal,
			"4": self.keyNumberGlobal,
			"5": self.keyNumberGlobal,
			"6": self.keyNumberGlobal,
			"7": self.keyNumberGlobal,
			"8": self.keyNumberGlobal,
			"9": self.keyNumberGlobal,
			"0": self.keyNumberGlobal,
			"red": self.keyRed,
			"green": self.keyGreen,
			"yellow": self.keyYellow,
			"blue": self.keyBlue,
			"up": self.up,
			"down": self.down,
			"left": self.left,
			"right": self.right,
			"shiftUp": self.additionalMoveUp,
			"shiftDown": self.additionalMoveDown,
			"menu": self.opensettings
		}, prio=-2)
		self.onShown.append(self.onshow)
Exemple #20
0
 def __init__(self, session, user="******"):
     options = [
         (_("Enter a new password"), self.KEY_SET),
         (_("Generate a random password"), self.KEY_RANDOM),
         (_("Disable password-based login"), self.KEY_LOCK),
         (_("Remove password protection (DANGEROUS!)"), self.KEY_REMOVE),
     ]
     ChoiceBox.__init__(
         self,
         session,
         title=
         _("If you want to login to your Dreambox using SSH, FTP or a remote web browser, you need to configure a password first.\nThe username will be '%s'."
           ) % (user),
         list=options,
         windowTitle=ChangePasswordScreen.WINDOW_TITLE)
     self._user = user
     self._password = ""
     self._wasLocked = False
     self._container = eConsoleAppContainer()
     self.__appClosed_conn = self._container.appClosed.connect(
         self._commandFinished)
Exemple #21
0
	def __init__(self, session, service):
		self.serviceHandler = eServiceCenter.getInstance()
		offline = self.serviceHandler.offlineOperations(service)
		path = service.getPath()
		name = self.getName(service, path)

		if offline is None:
			tlist = [(_("Cannot reconstruct this item"),  "CALLFUNC", self.confirmed0),]
		else:
			tlist = [(_("Don't reconstruct"), "CALLFUNC", self.confirmed0),]
			tnext = [
				(_("Reconstruct missing .ap and .sc files in this directory"), "CALLFUNC", self.confirmed2),
				(_("Reconstruct all .ap and .sc files in this directory"), "CALLFUNC", self.confirmed3),
			]
			if not path.endswith('.ts'):
				tlist += tnext
				name = _("more files...")
			else:
				tlist.append((_("Reconstruct the .ap and .sc files of the selected movie"), "CALLFUNC", self.confirmed1, service, path))
				tlist += tnext

		ChoiceBox.__init__(self, session, _("What would you like to reconstruct?  (\"%s\")") % (name), list = tlist, selection = 0)
		self.skinName = "ChoiceBox"
Exemple #22
0
	def __init__(self, session, service):
		self.serviceHandler = eServiceCenter.getInstance()
		offline = self.serviceHandler.offlineOperations(service)
		path = service.getPath()
		name = self.getName(service, path)

		if offline is None:
			tlist = [(_("Cannot reconstruct this item"), "CALLFUNC", self.confirmed0), ]
		else:
			tlist = [(_("Don't reconstruct"), "CALLFUNC", self.confirmed0), ]
			tnext = [
				(_("Reconstruct missing .ap and .sc files in this directory"), "CALLFUNC", self.confirmed2),
				(_("Reconstruct all .ap and .sc files in this directory"), "CALLFUNC", self.confirmed3),
			]
			if not path.endswith('.ts'):
				tlist += tnext
				name = _("more files...")
			else:
				tlist.append((_("Reconstruct the .ap and .sc files of the selected movie"), "CALLFUNC", self.confirmed1, service, path))
				tlist += tnext

		ChoiceBox.__init__(self, session, _("What would you like to reconstruct?  (\"%s\")") % (name), list=tlist, selection=0)
		self.skinName = "ChoiceBox"
Exemple #23
0
 def __init__(self, session, csel, service):
     self.csel = csel
     serviceHandler = eServiceCenter.getInstance()
     info = serviceHandler.info(service)
     self.sourcepath = service.getPath().rsplit('/', 1)[0]
     if len(self.csel.list.multiSelection) == 0:
         self.name = info.getName(service)
         self.service_list = [service]
     else:
         self.service_list = self.csel.list.multiSelection
         self.name = _("Selected movies")
     cbkeys = []
     listpath = []
     for element in range(len(listpath)):
         if element <= 10:
             cbkeys.append(str(element))
         else:
             cbkeys.append("")
     listpath.append((_("To adjusted move/copy location"), "CALLFUNC",
                      self.selectedLocation))
     cbkeys.append("blue")
     listpath.append((_("Directory Selection"), "CALLFUNC", self.selectDir))
     cbkeys.append("yellow")
     listpath.append((_("Show active move/copy processes"), "CALLFUNC",
                      self.showActive))
     cbkeys.append("green")
     listpath.append((_("Abort"), "CALLFUNC", self.close))
     cbkeys.append("red")
     if len(
             os.listdir(config.movielist.last_videodir.value)
     ) == 0 and defaultMoviePath() <> config.movielist.last_videodir.value:
         listpath.append(
             (_("Remove ' %s '") % config.movielist.last_videodir.value,
              "CALLFUNC", self.remove))
         cbkeys.append("red")
     ChoiceBox.__init__(self, session, list=listpath, keys=cbkeys)
     self.onShown.append(self.setWindowTitle)
	def close(self, param=None):
		self.update_timer.stop()
		ChoiceBox.close(self, param)
	def close(self, param=None):
		self.update_timer.stop()
		ChoiceBox.close(self, param)
	def __init__(self, session, title = "", list = [], keys = None, selection = 0, skin_name = [], windowTitle = None, allow_cancel = True, titlebartext = _("Input")):
		ChoiceBox.__init__(self, session, title, list, keys, selection, skin_name)
		if isinstance(skin_name, str):
			skin_name = [skin_name]
		self.skinName = skin_name + ["ChoiceBoxGPU", "ChoiceBox"]