Beispiel #1
0
	def __init__(self, session, entry, data = None):
		printl("", self, "S")

		Screen.__init__(self, session)

		self.guiElements = getGuiElements()

		self["actions"] = ActionMap(["DPS_ServerConfig", "ColorActions"],
		{
			"green": self.keySave,
			"cancel": self.keyCancel,
		    "exit": self.keyCancel,
			"yellow": self.keyYellow,
			"blue": self.keyBlue,
			"red": self.keyRed,
			"left": self.keyLeft,
			"right": self.keyRight,
		}, -2)

		self["help"] = StaticText()

		self["btn_redText"] = Label()
		self["btn_red"] = Pixmap()

		self["btn_greenText"] = Label()
		self["btn_green"] = Pixmap()

		self["btn_yellowText"] = Label()
		self["btn_yellow"] = Pixmap()

		self["btn_blueText"] = Label()
		self["btn_blue"] = Pixmap()

		if entry is None:
			self.newmode = 1
			self.current = initServerEntryConfig()
			if data is not None:
				ipBlocks = data.get("server").split(".")
				self.current.name.value = data.get("serverName")
				self.current.ip.value = [int(ipBlocks[0]),int(ipBlocks[1]),int(ipBlocks[2]),int(ipBlocks[3])]
				self.current.port.value = int(data.get("port"))
				self.keySave(True)

		else:
			self.newmode = 0
			self.current = entry
			self.currentId = self.current.id.value
			printl("currentId: " + str(self.currentId), self, "D")

		self.cfglist = []
		ConfigListScreen.__init__(self, self.cfglist, session)

		self.createSetup()

		self["config"].onSelectionChanged.append(self.updateHelp)

		self.onLayoutFinish.append(self.finishLayout)

		printl("", self, "C")
Beispiel #2
0
	def __init__(self, session, entry, data = None):
		printl("", self, "S")

		Screen.__init__(self, session)

		self.guiElements = getGuiElements()

		self["actions"] = ActionMap(["DPS_ServerConfig", "ColorActions"],
		{
			"green": self.keySave,
			"cancel": self.keyCancel,
		    "exit": self.keyCancel,
			"yellow": self.keyYellow,
			"blue": self.keyBlue,
			"red": self.keyRed,
			"left": self.keyLeft,
			"right": self.keyRight,
		}, -2)

		self["help"] = StaticText()

		self["btn_redText"] = Label()
		self["btn_red"] = Pixmap()

		self["btn_greenText"] = Label()
		self["btn_green"] = Pixmap()

		self["btn_yellowText"] = Label()
		self["btn_yellow"] = Pixmap()

		self["btn_blueText"] = Label()
		self["btn_blue"] = Pixmap()

		if entry is None:
			self.newmode = 1
			self.current = initServerEntryConfig()
			if data is not None:
				ipBlocks = data.get("server").split(".")
				self.current.name.value = data.get("serverName")
				self.current.ip.value = [int(ipBlocks[0]),int(ipBlocks[1]),int(ipBlocks[2]),int(ipBlocks[3])]
				self.current.port.value = int(data.get("port"))
				self.keySave(True)

		else:
			self.newmode = 0
			self.current = entry
			self.currentId = self.current.id.value
			printl("currentId: " + str(self.currentId), self, "D")

		self.cfglist = []
		ConfigListScreen.__init__(self, self.cfglist, session)

		self.createSetup()

		self["config"].onSelectionChanged.append(self.updateHelp)

		self.onLayoutFinish.append(self.finishLayout)

		printl("", self, "C")
Beispiel #3
0
	def __init__(self, session, mode, serverConfig=None):
		Screen.__init__(self, session)
		DPH_ScreenHelper.__init__(self)
		DPH_PlexScreen.__init__(self)

		self.guiElements = getGuiElements()

		self.initScreen("syncer")
		self.serverConfig = serverConfig

		self.resolution = getSkinResolution()

		if serverConfig is not None:
			# now that we know the server we establish global plexInstance
			self.plexInstance = Singleton().getPlexInstance(PlexLibrary(self.session, self.serverConfig))

		# we are "sync" or "render"
		self._mode = mode

		# we use the global g_mediaSyncerInfo.instance to take care only having one instance
		self.mediaSyncerInfo = g_mediaSyncerInfo.instance

		self["output"] = ScrollLabel()
		self["progress"] = Label()

		# we use this counter to reset scorll label every x entries to stay responsive
		self.counter = 0

		self["btn_greenText"] = Label()
		if self._mode == "sync":
			self["btn_greenText"].setText(_("Start Sync"))
		else:
			self["btn_greenText"].setText(_("Start Rendering"))
		self["btn_green"] = Pixmap()

		self["btn_blueText"] = Label()
		self["btn_blueText"].setText(_("Background"))
		self["btn_blue"] = Pixmap()

		self["btn_redText"] = Label()
		self["btn_redText"].setText(_("Abort"))
		self["btn_red"] = Pixmap()

		self["setupActions"] = ActionMap(["DPS_Syncer"],
		{
			"red": self.keyRed,
			"blue": self.keyBlue,
			"yellow": self.keyYellow,
			"green": self.keyGreen,
			"bouquet_up": self.keyBouquetUp,
			"bouquet_down": self.keyBouquetDown,
			"cancel": self.exit,
		}, -2)

		self.onFirstExecBegin.append(self.startup)
		self.onShown.append(self.finishLayout)
		self.onClose.append(self.__onClose)
Beispiel #4
0
	def __init__(self, session, mode, serverConfig=None):
		Screen.__init__(self, session)
		DPH_ScreenHelper.__init__(self)
		DPH_PlexScreen.__init__(self)

		self.guiElements = getGuiElements()

		self.initScreen("syncer")
		self.serverConfig = serverConfig

		self.resolution = getSkinResolution()

		if serverConfig is not None:
			# now that we know the server we establish global plexInstance
			self.plexInstance = Singleton().getPlexInstance(PlexLibrary(self.session, self.serverConfig))

		# we are "sync" or "render"
		self._mode = mode

		# we use the global g_mediaSyncerInfo.instance to take care only having one instance
		self.mediaSyncerInfo = g_mediaSyncerInfo.instance

		self["output"] = ScrollLabel()
		self["progress"] = Label()

		# we use this counter to reset scorll label every x entries to stay responsive
		self.counter = 0

		self["btn_greenText"] = Label()
		if self._mode == "sync":
			self["btn_greenText"].setText(_("Start Sync"))
		else:
			self["btn_greenText"].setText(_("Start Rendering"))
		self["btn_green"] = Pixmap()

		self["btn_blueText"] = Label()
		self["btn_blueText"].setText(_("Background"))
		self["btn_blue"] = Pixmap()

		self["btn_redText"] = Label()
		self["btn_redText"].setText(_("Abort"))
		self["btn_red"] = Pixmap()

		self["setupActions"] = ActionMap(["DPS_Syncer"],
		{
			"red": self.keyRed,
			"blue": self.keyBlue,
			"yellow": self.keyYellow,
			"green": self.keyGreen,
			"bouquet_up": self.keyBouquetUp,
			"bouquet_down": self.keyBouquetDown,
			"cancel": self.exit,
		}, -2)

		self.onFirstExecBegin.append(self.startup)
		self.onShown.append(self.finishLayout)
		self.onClose.append(self.__onClose)
Beispiel #5
0
    def __init__(self, session, g_serverConfig):
        printl("", self, "S")
        DPH_Screen.__init__(self, session)
        DPH_ScreenHelper.__init__(self)
        DPH_Filter.__init__(self)
        DPH_PlexScreen.__init__(self)

        self.selectionOverride = None
        printl("selectionOverride:" + str(self.selectionOverride), self, "D")
        self.session = session

        self.g_serverConfig = g_serverConfig
        self.plexInstance = Singleton().getPlexInstance()
        self.guiElements = getGuiElements()

        self.initScreen("server_menu")
        self.initMenu()

        if self.g_horizontal_menu:
            self.setHorMenuElements(depth=2)
            self.translateNames()

        self["title"] = StaticText()

        self["menu"] = List(enableWrapAround=True)

        self["actions"] = HelpableActionMap(
            self,
            "DP_MainMenuActions",
            {
                "ok": (self.okbuttonClick, ""),
                "left": (self.left, ""),
                "right": (self.right, ""),
                "up": (self.up, ""),
                "down": (self.down, ""),
                "cancel": (self.cancel, ""),
                "red": (self.onKeyRed, ""),
                "green": (self.onKeyGreen, ""),
            },
            -2,
        )

        self["btn_green"] = Pixmap()
        self["btn_green"].hide()
        self["btn_greenText"] = Label()

        self["text_HomeUserLabel"] = Label()
        self["text_HomeUser"] = Label()

        self.onLayoutFinish.append(self.finishLayout)
        self.onLayoutFinish.append(self.getInitialData)
        self.onLayoutFinish.append(self.checkSelectionOverride)

        printl("", self, "C")
Beispiel #6
0
	def __init__(self, session, g_serverConfig ):
		printl("", self, "S")
		DPH_Screen.__init__(self, session)
		DPH_ScreenHelper.__init__(self)
		DPH_Filter.__init__(self)
		DPH_PlexScreen.__init__(self)

		self.selectionOverride = None
		printl("selectionOverride:" +str(self.selectionOverride), self, "D")
		self.session = session

		self.g_serverConfig = g_serverConfig
		self.plexInstance = Singleton().getPlexInstance()
		self.guiElements = getGuiElements()

		self.initScreen("server_menu")
		self.initMenu()

		if self.g_horizontal_menu:
			self.setHorMenuElements(depth=2)
			self.translateNames()

		self["title"] = StaticText()

		self["menu"]= List(enableWrapAround=True)

		self["actions"] = HelpableActionMap(self, "DP_MainMenuActions",
			{
				"ok":		(self.okbuttonClick, ""),
				"left":		(self.left, ""),
				"right":	(self.right, ""),
				"up":		(self.up, ""),
				"down":		(self.down, ""),
				"cancel":	(self.cancel, ""),
			    "red":		(self.onKeyRed, ""),
			    "green":    (self.onKeyGreen, ""),
			}, -2)

		self["btn_green"]		= Pixmap()
		self["btn_green"].hide()
		self["btn_greenText"]   = Label()

		self["text_HomeUserLabel"]   = Label()
		self["text_HomeUser"]   = Label()

		self.onLayoutFinish.append(self.finishLayout)
		self.onLayoutFinish.append(self.getInitialData)
		self.onLayoutFinish.append(self.checkSelectionOverride)

		printl("", self, "C")
Beispiel #7
0
    def __init__(self, session, initDir, myType):
        printl("", self, "S")

        Screen.__init__(self, session)
        DPH_PlexScreen.__init__(self)

        self.guiElements = getGuiElements()

        self.myType = myType
        inhibitDirs = [
            "/bin", "/boot", "/dev", "/etc", "/lib", "/proc", "/sbin", "/sys",
            "/usr", "/var"
        ]
        inhibitMounts = []
        self["filelist"] = FileList(initDir,
                                    showFiles=False,
                                    inhibitMounts=inhibitMounts,
                                    inhibitDirs=inhibitDirs)
        self["target"] = Label()
        self["target"].setText(initDir)
        self["actions"] = ActionMap(
            [
                "WizardActions", "DirectionActions", "ColorActions",
                "EPGSelectActions"
            ], {
                "back": self.cancel,
                "left": self.left,
                "right": self.right,
                "up": self.up,
                "down": self.down,
                "ok": self.ok,
                "green": self.green,
                "red": self.cancel
            }, -1)

        self["targetText"] = Label()

        self["btn_red"] = Pixmap()
        self["btn_redText"] = Label()

        self["btn_green"] = Pixmap()
        self["btn_greenText"] = Label()

        self.onLayoutFinish.append(self.finishLayout)

        printl("", self, "C")
Beispiel #8
0
    def __init__(self, session, what=None):
        printl("", self, "S")

        Screen.__init__(self, session)
        DPH_PlexScreen.__init__(self)
        self.session = session
        from Components.Sources.List import List

        self.guiElements = getGuiElements()

        self["entryList"] = List(self.builEntryList(), True)
        self["header"] = Label()
        self["columnHeader"] = Label()

        self["btn_redText"] = Label()
        self["btn_red"] = Pixmap()

        self["btn_greenText"] = Label()
        self["btn_green"] = Pixmap()

        self["btn_yellowText"] = Label()
        self["btn_yellow"] = Pixmap()

        self["btn_blueText"] = Label()
        self["btn_blue"] = Pixmap()

        self["actions"] = ActionMap(
            ["WizardActions", "MenuActions", "ShortcutActions"],
            {
                "ok": self.keyOk,
                "back": self.keyClose,
                "red": self.keyRed,
                "yellow": self.keyYellow,
                "green": self.keyGreen,
                "blue": self.keyBlue,
            },
            -1,
        )
        self.what = what

        self.onLayoutFinish.append(self.finishLayout)

        printl("", self, "C")
Beispiel #9
0
    def __init__(self, session, serverID, plexInstance):
        printl("", self, "S")

        Screen.__init__(self, session)
        self["actions"] = ActionMap(
            ["ColorActions", "SetupActions"],
            {
                #"ok": self.startSelection,
                "cancel": self.cancel,
                "red": self.redKey,
                "green": self.greenKey,
                "yellow": self.yellowKey,
            },
            -1)

        self.guiElements = getGuiElements()
        self.plexInstance = plexInstance

        self.location = config.plugins.dreamplex.configfolderpath.value + "homeUsers"

        checkXmlFile(self.location)

        tree = getXmlContent(self.location)

        if tree is not None:
            self["content"] = DPS_UsersEntryList([], serverID, tree)
            self.updateList()
            self.error = False
        else:
            self.error = True

        self["btn_red"] = Pixmap()
        self["btn_redText"] = Label()

        self["btn_green"] = Pixmap()
        self["btn_greenText"] = Label()

        self["btn_yellow"] = Pixmap()
        self["btn_yellowText"] = Label()

        self.onShown.append(self.finishLayout)

        printl("", self, "C")
Beispiel #10
0
	def __init__(self, session, serverID, plexInstance):
		printl("", self, "S")
		
		Screen.__init__(self, session)
		self["actions"] = ActionMap(["ColorActions", "SetupActions" ],
		{
		#"ok": self.startSelection,
		"cancel": self.cancel,
		"red": self.redKey,
		"green": self.greenKey,
		"yellow": self.yellowKey,
		}, -1)
		
		self.guiElements = getGuiElements()
		self.plexInstance = plexInstance

		self.location = config.plugins.dreamplex.configfolderpath.value + "homeUsers"

		checkXmlFile(self.location)

		tree = getXmlContent(self.location)

		if tree is not None:
			self["content"] = DPS_UsersEntryList([], serverID, tree)
			self.updateList()
			self.error = False
		else:
			self.error = True

		self["btn_red"]			= Pixmap()
		self["btn_redText"]		= Label()

		self["btn_green"]		= Pixmap()
		self["btn_greenText"]   = Label()

		self["btn_yellow"]		= Pixmap()
		self["btn_yellowText"]   = Label()

		self.onShown.append(self.finishLayout)
		
		printl("", self, "C")
Beispiel #11
0
    def __init__(self, session, what=None):
        printl("", self, "S")

        Screen.__init__(self, session)
        DPH_PlexScreen.__init__(self)

        from Components.Sources.List import List

        self.guiElements = getGuiElements()

        self["entryList"] = List(self.builEntryList(), True)
        self["header"] = Label()
        self["columnHeader"] = Label()

        self["btn_redText"] = Label()
        self["btn_red"] = Pixmap()

        self["btn_greenText"] = Label()
        self["btn_green"] = Pixmap()

        self["btn_yellowText"] = Label()
        self["btn_yellow"] = Pixmap()

        self["btn_blueText"] = Label()
        self["btn_blue"] = Pixmap()

        self["actions"] = ActionMap(
            ["WizardActions", "MenuActions", "ShortcutActions"], {
                "ok": self.keyOk,
                "back": self.keyClose,
                "red": self.keyRed,
                "yellow": self.keyYellow,
                "green": self.keyGreen,
                "blue": self.keyBlue,
            }, -1)
        self.what = what

        self.onLayoutFinish.append(self.finishLayout)

        printl("", self, "C")
Beispiel #12
0
    def __init__(self, session):
        printl("", self, "S")

        Screen.__init__(self, session)
        HelpableScreen.__init__(self)
        DPH_PlexScreen.__init__(self)

        self.guiElements = getGuiElements()

        self.cfglist = []
        ConfigListScreen.__init__(self,
                                  self.cfglist,
                                  session,
                                  on_change=self._changed)

        self._hasChanged = False

        self["btn_greenText"] = Label()
        self["btn_green"] = Pixmap()

        self["help"] = StaticText()

        self["setupActions"] = ActionMap(
            ["SetupActions", "ColorActions", "DPS_Settings"], {
                "green": self.keySave,
                "red": self.keyCancel,
                "cancel": self.keyCancel,
                "ok": self.ok,
                "left": self.keyLeft,
                "right": self.keyRight,
                "bouquet_up": self.keyBouquetUp,
                "bouquet_down": self.keyBouquetDown,
            }, -2)

        self.createSetup()

        self["config"].onSelectionChanged.append(self.updateHelp)
        self.onLayoutFinish.append(self.finishLayout)

        printl("", self, "C")
Beispiel #13
0
	def __init__(self, session, initDir, myType):
		printl("", self, "S")
		
		Screen.__init__(self, session)
		DPH_PlexScreen.__init__(self)

		self.guiElements = getGuiElements()

		self.myType = myType
		inhibitDirs = ["/bin", "/boot", "/dev", "/etc", "/lib", "/proc", "/sbin", "/sys", "/usr", "/var"]
		inhibitMounts = []
		self["filelist"] = FileList(initDir, showFiles=False, inhibitMounts=inhibitMounts, inhibitDirs=inhibitDirs)
		self["target"] = Label()
		self["target"].setText(initDir)
		self["actions"] = ActionMap(["WizardActions", "DirectionActions", "ColorActions", "EPGSelectActions"],
		{
			"back": self.cancel,
			"left": self.left,
			"right": self.right,
			"up": self.up,
			"down": self.down,
			"ok": self.ok,
			"green": self.green,
			"red": self.cancel
			
		}, -1)

		self["targetText"] = Label()

		self["btn_red"]			= Pixmap()
		self["btn_redText"]		= Label()

		self["btn_green"]		= Pixmap()
		self["btn_greenText"]   = Label()

		self.onLayoutFinish.append(self.finishLayout)
		
		printl("", self, "C")
Beispiel #14
0
	def __init__(self, session):
		printl("", self, "S")
		
		Screen.__init__(self, session)
		HelpableScreen.__init__(self)
		DPH_PlexScreen.__init__(self)

		self.guiElements = getGuiElements()
		
		self.cfglist = []
		ConfigListScreen.__init__(self, self.cfglist, session, on_change = self._changed)
		
		self._hasChanged = False

		self["btn_greenText"] = Label()
		self["btn_green"] = Pixmap()

		self["help"] = StaticText()
		
		self["setupActions"] = ActionMap(["SetupActions", "ColorActions", "DPS_Settings"],
		{
			"green": self.keySave,
			"red": self.keyCancel,
			"cancel": self.keyCancel,
			"ok": self.ok,
			"left": self.keyLeft,
			"right": self.keyRight,
			"bouquet_up":	self.keyBouquetUp,
			"bouquet_down":	self.keyBouquetDown,
		}, -2)

		self.createSetup()
		
		self["config"].onSelectionChanged.append(self.updateHelp)
		self.onLayoutFinish.append(self.finishLayout)

		printl("", self, "C")