Ejemplo n.º 1
0
    def menuCallback(self, ret):
        ret = ret and ret[1]
        if ret:
            if ret == "help":
                from plugin import autotimerHelp
                autotimerHelp.open(self.session)
            elif ret == "faq":
                from Plugins.SystemPlugins.MPHelp import PluginHelp, XMLHelpReader
                from Tools.Directories import resolveFilename, SCOPE_PLUGINS
                reader = XMLHelpReader(resolveFilename(
                    SCOPE_PLUGINS, "Extensions/AutoTimer/faq.xml"),
                                       translate=_)
                autotimerFaq = PluginHelp(*reader)
                autotimerFaq.open(self.session)
            elif ret == "preview":
                total, new, modified, timers, conflicts, similars = self.autotimer.parseEPG(
                    simulateOnly=True)
                self.session.open(AutoTimerPreview, timers)
            elif ret == "import":
                newTimer = self.autotimer.defaultTimer.clone()
                newTimer.id = self.autotimer.getUniqueId()

                self.session.openWithCallback(self.importCallback,
                                              AutoTimerImportSelector,
                                              newTimer)
            elif ret == "import_epg":
                self.session.openWithCallback(self.refresh,
                                              AutoTimerChannelSelection,
                                              self.autotimer)
            elif ret == "setup":
                self.session.open(AutoTimerSettings)
            elif ret == "defaults":
                self.session.open(AutoTimerEditor,
                                  self.autotimer.defaultTimer,
                                  editingDefaults=True)
            elif ret == "newwizard":
                newTimer = self.autotimer.defaultTimer.clone()
                newTimer.id = self.autotimer.getUniqueId()

                self.session.openWithCallback(
                    self.
                    addCallback,  # XXX: we could also use importCallback... dunno what seems more natural
                    AutoTimerWizard,
                    newTimer)
            elif ret == "newplain":
                newTimer = self.autotimer.defaultTimer.clone()
                newTimer.id = self.autotimer.getUniqueId()

                self.session.openWithCallback(self.addCallback,
                                              AutoTimerEditor, newTimer)
            elif ret == "clone":
                current = self["entries"].getCurrent()
                if current is not None:
                    newTimer = current.clone()
                    newTimer.id = self.autotimer.getUniqueId()

                    self.session.openWithCallback(self.addCallback,
                                                  AutoTimerEditor, newTimer)
Ejemplo n.º 2
0
	def menuCallback(self, ret):
		ret = ret and ret[1]
		if ret:
			if ret == "help":
				from plugin import autotimerHelp
				autotimerHelp.open(self.session)
			elif ret == "faq":
				from Plugins.SystemPlugins.MPHelp import PluginHelp, XMLHelpReader
				from Tools.Directories import resolveFilename, SCOPE_PLUGINS
				reader = XMLHelpReader(resolveFilename(SCOPE_PLUGINS, "Extensions/AutoTimer/faq.xml"))
				autotimerFaq = PluginHelp(*reader)
				autotimerFaq.open(self.session)
			elif ret == "preview":
				# todo timeout / error handling
				self.autotimer.parseEPG(simulateOnly = True, callback = self.openPreview)
			elif ret == "import":
				newTimer = self.autotimer.defaultTimer.clone()
				newTimer.id = self.autotimer.getUniqueId()

				self.session.openWithCallback(
					self.importCallback,
					AutoTimerImportSelector,
					newTimer
				)
			elif ret == "import_epg":
				self.session.openWithCallback(
					self.refresh,
					AutoTimerChannelSelection,
					self.autotimer
				)
			elif ret == "setup":
				self.session.open(
					AutoTimerSettings
				)
			elif ret == "defaults":
				self.session.open(
					AutoTimerEditor,
					self.autotimer.defaultTimer,
					editingDefaults = True
				)
			elif ret == "newwizard":
				newTimer = self.autotimer.defaultTimer.clone()
				newTimer.id = self.autotimer.getUniqueId()

				self.session.openWithCallback(
					self.addCallback, # XXX: we could also use importCallback... dunno what seems more natural
					AutoTimerWizard,
					newTimer
				)
			elif ret == "newplain":
				newTimer = self.autotimer.defaultTimer.clone()
				newTimer.id = self.autotimer.getUniqueId()

				self.session.openWithCallback(
					self.addCallback,
					AutoTimerEditor,
					newTimer
				)
Ejemplo n.º 3
0
	def menuCallback(self, ret):
		ret = ret and ret[1]
		if ret:
			if ret == "help":
				from plugin import autotimerHelp
				autotimerHelp.open(self.session)
			elif ret == "faq":
				from Plugins.SystemPlugins.MPHelp import PluginHelp, XMLHelpReader
				from Tools.Directories import resolveFilename, SCOPE_PLUGINS
				reader = XMLHelpReader(resolveFilename(SCOPE_PLUGINS, "Extensions/AutoTimer/faq.xml"))
				autotimerFaq = PluginHelp(*reader)
				autotimerFaq.open(self.session)
			elif ret == "preview":
				# todo timeout / error handling
				self.autotimer.parseEPG(simulateOnly = True, callback = self.openPreview)
			elif ret == "import":
				newTimer = self.autotimer.defaultTimer.clone()
				newTimer.id = self.autotimer.getUniqueId()

				self.session.openWithCallback(
					self.importCallback,
					AutoTimerImportSelector,
					newTimer
				)
			elif ret == "import_epg":
				self.session.openWithCallback(
					self.refresh,
					AutoTimerChannelSelection,
					self.autotimer
				)
			elif ret == "setup":
				self.session.open(
					AutoTimerSettings
				)
			elif ret == "defaults":
				self.session.open(
					AutoTimerEditor,
					self.autotimer.defaultTimer,
					editingDefaults = True
				)
			elif ret == "newwizard":
				newTimer = self.autotimer.defaultTimer.clone()
				newTimer.id = self.autotimer.getUniqueId()

				self.session.openWithCallback(
					self.addCallback, # XXX: we could also use importCallback... dunno what seems more natural
					AutoTimerWizard,
					newTimer
				)
			elif ret == "newplain":
				newTimer = self.autotimer.defaultTimer.clone()
				newTimer.id = self.autotimer.getUniqueId()

				self.session.openWithCallback(
					self.addCallback,
					AutoTimerEditor,
					newTimer
				)
Ejemplo n.º 4
0
	def menuCallback(self, ret):
		ret = ret and ret[1]
		if ret:
			if ret == "help":
				from plugin import autotimerHelp
				autotimerHelp.open(self.session)
			elif ret == "faq":
				from Plugins.SystemPlugins.MPHelp import PluginHelp, XMLHelpReader
				from Tools.Directories import resolveFilename, SCOPE_PLUGINS
				reader = XMLHelpReader(resolveFilename(SCOPE_PLUGINS, "Extensions/AutoTimer/faq.xml"), translate=_)
				autotimerFaq = PluginHelp(*reader)
				autotimerFaq.open(self.session)
			elif ret == "preview":
				total, new, modified, timers, conflicts, similars = self.autotimer.parseEPG(simulateOnly = True)
				self.session.open(
					AutoTimerPreview,
					timers
				)
			elif ret == "import":
				newTimer = self.autotimer.defaultTimer.clone()
				newTimer.id = self.autotimer.getUniqueId()

				self.session.openWithCallback(
					self.importCallback,
					AutoTimerImportSelector,
					newTimer
				)
			elif ret == "import_epg":
				self.session.openWithCallback(
					self.refresh,
					AutoTimerChannelSelection,
					self.autotimer
				)
			elif ret == "setup":
				self.session.open(
					AutoTimerSettings
				)
			elif ret == "defaults":
				self.session.open(
					AutoTimerEditor,
					self.autotimer.defaultTimer,
					editingDefaults = True
				)
			elif ret == "newwizard":
				newTimer = self.autotimer.defaultTimer.clone()
				newTimer.id = self.autotimer.getUniqueId()

				self.session.openWithCallback(
					self.addCallback, # XXX: we could also use importCallback... dunno what seems more natural
					AutoTimerWizard,
					newTimer
				)
			elif ret == "newplain":
				newTimer = self.autotimer.defaultTimer.clone()
				newTimer.id = self.autotimer.getUniqueId()

				self.session.openWithCallback(
					self.addCallback,
					AutoTimerEditor,
					newTimer
				)
			elif ret == "clone":
				current = self["entries"].getCurrent()
				if current is not None:
					newTimer = current.clone()
					newTimer.id = self.autotimer.getUniqueId()

					self.session.openWithCallback(
						self.addCallback,
						AutoTimerEditor,
						newTimer
					)