1 from Screens.Screen import Screen
2 from Components.config import config, getConfigListEntry
3 from Components.ConfigList import ConfigListScreen
4 from Components.Label import Label
5 from Components.ActionMap import ActionMap
7 from enigma import getDesktop
8 DESKTOP_WIDTH = getDesktop(0).size().width()
9 DESKTOP_HEIGHT = getDesktop(0).size().height()
15 return scale(y2, y1, 1280, 720, DESKTOP_WIDTH)
21 return scale(y2, y1, 720, 576, DESKTOP_HEIGHT)
22 def scale(y2, y1, x2, x1, x):
23 return (y2 - y1) * (x - x1) / (x2 - x1) + y1
25 class EmailConfigScreen(ConfigListScreen,Screen):
26 width = max(2*140+100, 550)
28 buttonsGap = (width-2*140)/3
30 <screen position="%d,%d" size="%d,%d" title="Email Setup" >
31 <widget name="config" position="0,0" size="%d,%d" scrollbarMode="showOnDemand" />
32 <ePixmap position="%d,%d" zPosition="4" size="140,40" pixmap="skin_default/buttons/red.png" transparent="1" alphatest="on" />
33 <ePixmap position="%d,%d" zPosition="4" size="140,40" pixmap="skin_default/buttons/green.png" transparent="1" alphatest="on" />
34 <widget name="buttonred" position="%d,%d" zPosition="5" size="140,40" valign="center" halign="center" font="Regular;%d" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
35 <widget name="buttongreen" position="%d,%d" zPosition="5" size="140,40" valign="center" halign="center" font="Regular;%d" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
36 <widget name="info" position="%d,%d" size="100,40" halign="right" zPosition="2" foregroundColor="white" font="Regular;%d"/>
38 (DESKTOP_WIDTH-width)/2, (DESKTOP_HEIGHT-height)/2, width, height,
39 width, height-50, # config
40 buttonsGap, height-45,
41 2*buttonsGap+140, height-45,
42 buttonsGap, height-45, scaleV(22,18),
43 2*buttonsGap+140, height-45, scaleV(22,18),
44 3*buttonsGap+2*140, height-45, scaleV(22,18)
47 def __init__(self, session, args = 0):
48 Screen.__init__(self, session)
50 getConfigListEntry(_("Username"), config.plugins.emailimap.username),
51 getConfigListEntry(_("Password"), config.plugins.emailimap.password),
52 getConfigListEntry(_("IMAP Server"), config.plugins.emailimap.server),
53 getConfigListEntry(_("IMAP Port"), config.plugins.emailimap.port),
54 getConfigListEntry(_("max of Headers to load"), config.plugins.emailimap.maxheadertoload),
55 getConfigListEntry(_("show deleted entries"), config.plugins.emailimap.showDeleted)
58 ConfigListScreen.__init__(self, l)
59 self["buttonred"] = Label(_("cancel"))
60 self["buttongreen"] = Label(_("ok"))
61 self["info"] = Label('by 3c5x9')
62 self["setupActions"] = ActionMap(["SetupActions"],
67 "cancel": self.cancel,
73 for x in self["config"].list:
79 for x in self["config"].list: