Jump to content


amisoft

Member Since 12 Jan 2015
Offline Last Active 19 Dec 2016 02:35
-----

Posts I've Made

In Topic: beginner in enigma2 plugin development

26 January 2015 - 16:01

thanks to you all.

 

i have one more question.

 

how can i build a config screen with 3 input.

 

i make that code but it's not working i don't know wher is the problem

import os

from Components.ActionMap import ActionMap
from Components.config import config, ConfigYesNo, ConfigSubsection, getConfigListEntry
from Components.ConfigList import ConfigListScreen
from Components.Label import Label
from Plugins.Plugin import PluginDescriptor
from Screens.Screen import Screen

##############################################################################

config.plugins.testiptv = ConfigSubsection()
config.plugins.testiptv.name = ConfigText(default="", fixed_size=False)
config.plugins.testiptv.server = ConfigText(default="", fixed_size=False)
config.plugins.testiptv.quality_selector = ConfigSelection(default="hd", choices = [("hd", "HD"),("sd", "SD")])


##############################################################################

class testiptvConfigFunction(ConfigListScreen, Screen):
	skin = """
		<screen position="80,170" size="560,270" title="testiptv">
			<ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" transparent="1" alphatest="on" />
			<ePixmap pixmap="skin_default/buttons/green.png" position="140,0" size="140,40" transparent="1" alphatest="on" />
			<ePixmap pixmap="skin_default/buttons/yellow.png" position="280,0" size="140,40" transparent="1" alphatest="on" />
			<ePixmap pixmap="skin_default/buttons/blue.png" position="420,0" size="140,40" transparent="1" alphatest="on" />
			<widget name="key_green" position="140,0" zPosition="1" size="140,40" font="Regular;20" valign="center" halign="center" backgroundColor="#1f771f" transparent="1" />
			<widget name="config" position="0,45" size="560,220" scrollbarMode="showOnDemand" />
		</screen>"""

	def __init__(self, session):
		Screen.__init__(self, session)
		self["key_green"] = Label(_("Save"))
		self.cfglist = []
        self.cfglist.append(getConfigListEntry(_("name:"), config.plugins.testiptv.name))
        self.cfglist.append(getConfigListEntry(_("server:"), config.plugins.testiptv.server))
        self.cfglist.append(getConfigListEntry(_("quality:"), config.plugins.testiptv.quality_selector))
        ConfigListScreen.__init__(self, self.cfglist, session)
		self["actions"] = ActionMap(["OkCancelActions", "ColorActions"], {"green": self.save, "cancel": self.exit}, -1)

	def save(self):
		for x in self["config"].list:
			x[1].save()
		self.close()

	def exit(self):
		for x in self["config"].list:
			x[1].cancel()
		self.close()

##############################################################################

def main(session, **kwargs):
	session.open(testiptvConfigFunction)

def Plugins(**kwargs):
	return PluginDescriptor(
			name="testiptv",
			description="test iptv",
			where = PluginDescriptor.WHERE_PLUGINMENU,
			icon="iptv.png",
			fnc=main)


In Topic: beginner in enigma2 plugin development

20 January 2015 - 00:50

thanks mr pcd for your response.

 

but i don't want to write a open source plugin i said it's a free plugin. because i will use my own database on my own server.

 

if i make it open every could enter to my server.

 

thanks again for your response mr pcd.


In Topic: help in enigma2 plugin

16 January 2015 - 15:17

Thanks mr pcd :)