1
1
from __future__ import print_function
2
2
3
3
# Core
4
- from enigma import RT_HALIGN_LEFT , RT_VALIGN_CENTER , getDesktop , eListboxPythonMultiContent
4
+ from enigma import RT_HALIGN_LEFT , eListboxPythonMultiContent
5
5
6
6
# Tools
7
- from Tools .Directories import SCOPE_SKIN_IMAGE , SCOPE_CURRENT_SKIN , resolveFilename
7
+ from Tools .Directories import SCOPE_SKIN_IMAGE , resolveFilename
8
8
from Tools .LoadPixmap import LoadPixmap
9
9
from Tools .Notifications import AddPopup , AddNotificationWithCallback
10
10
23
23
from Components .FileList import FileList , FileEntryComponent , EXTENSIONS
24
24
from Components .Sources .StaticText import StaticText
25
25
from VariableProgressSource import VariableProgressSource
26
- from skin import componentSizes
27
26
28
27
# FTP Client
29
28
from twisted .internet import reactor , defer
38
37
import re
39
38
40
39
def FTPFileEntryComponent (file , directory ):
41
- sizes = componentSizes [componentSizes .FILE_LIST ]
42
- tx = sizes .get ("textX" , 35 )
43
- ty = sizes .get ("textY" , 0 )
44
- tw = sizes .get ("textWidth" , 1000 )
45
- th = sizes .get ("textHeight" , 25 )
46
- pxw = sizes .get ("pixmapWidth" , 20 )
47
- pxh = sizes .get ("pixmapHeight" , 20 )
48
-
49
40
isDir = True if file ['filetype' ] == 'd' else False
50
41
name = file ['filename' ]
51
42
absolute = directory + name
@@ -54,10 +45,10 @@ def FTPFileEntryComponent(file, directory):
54
45
55
46
res = [
56
47
(absolute , isDir , file ['size' ]),
57
- (eListboxPythonMultiContent .TYPE_TEXT , tx , ty , tw , th , 0 , RT_HALIGN_LEFT | RT_VALIGN_CENTER , name )
48
+ (eListboxPythonMultiContent .TYPE_TEXT , 35 , 1 , 470 , 20 , 0 , RT_HALIGN_LEFT , name )
58
49
]
59
50
if isDir :
60
- png = LoadPixmap (resolveFilename (SCOPE_CURRENT_SKIN , "extensions/directory.png" ))
51
+ png = LoadPixmap (resolveFilename (SCOPE_SKIN_IMAGE , "extensions/directory.png" ))
61
52
else :
62
53
extension = name .split ('.' )
63
54
extension = extension [- 1 ].lower ()
@@ -66,7 +57,7 @@ def FTPFileEntryComponent(file, directory):
66
57
else :
67
58
png = None
68
59
if png is not None :
69
- res .append ((eListboxPythonMultiContent .TYPE_PIXMAP_ALPHATEST , 10 , ( th - pxh ) / 2 , pxw , pxh , png ))
60
+ res .append ((eListboxPythonMultiContent .TYPE_PIXMAP_ALPHATEST , 10 , 2 , 20 , 20 , png ))
70
61
71
62
return res
72
63
@@ -141,32 +132,23 @@ def listFailed(self, *args):
141
132
142
133
class FTPBrowser (Screen , Protocol , InfoBarNotifications , HelpableScreen ):
143
134
skin = """
144
- <screen name="FTPBrowser" position="center,80" size="1200,610" title="FTP Browser">
145
- <ePixmap pixmap="skin_default/buttons/red.png" position="10,5" size="200,40" />
146
- <ePixmap pixmap="skin_default/buttons/green.png" position="210,5" size="200,40" />
147
- <ePixmap pixmap="skin_default/buttons/yellow.png" position="410,5" size="200,40" />
148
- <ePixmap pixmap="skin_default/buttons/blue.png" position="610,5" size="200,40" />
149
- <widget source="key_red" render="Label" position="10,5" size="200,40" zPosition="1" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-2,-2" />
150
- <widget source="key_green" render="Label" position="210,5" size="200,40" zPosition="1" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-2,-2" />
151
- <widget source="key_yellow" render="Label" position="410,5" size="200,40" zPosition="1" font="Regular;20" halign="center" valign="center" backgroundColor="#a08500" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-2,-2" />
152
- <widget source="key_blue" render="Label" position="610,5" size="200,40" zPosition="1" font="Regular;20" halign="center" valign="center" backgroundColor="#18188b" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-2,-2" />
153
- <widget source="global.CurrentTime" render="Label" position="1130,12" size="60,25" font="Regular;22" halign="right">
154
- <convert type="ClockToText">Default</convert>
155
- </widget>
156
- <widget source="global.CurrentTime" render="Label" position="820,12" size="300,25" font="Regular;22" halign="right">
157
- <convert type="ClockToText">Format:%A %d. %B</convert>
158
- </widget>
159
- <eLabel position="10,50" size="1180,1" backgroundColor="grey" />
160
- <widget source="localText" foregroundColor="yellow" render="Label" position="20,55" size="500,30" font="Regular;24" />
161
- <widget name="local" position="20,90" size="580,450" enableWrapAround="1" scrollbarMode="showOnDemand" />
162
- <widget source="remoteText" foregroundColor="yellow" render="Label" position="610,55" size="500,30" font="Regular;24" />
163
- <widget name="remote" position="610,90" size="580,450" enableWrapAround="1" scrollbarMode="showOnDemand" />
164
- <eLabel backgroundColor="grey" position="604,60" size="2,480" />
165
- <eLabel position="10,550" size="1180,1" backgroundColor="grey" />
166
- <widget source="eta" render="Label" position="20,560" size="300,30" font="Regular;22" />
167
- <widget source="speed" render="Label" position="350,560" size="300,30" font="Regular;22" />
168
- <widget source="progress" render="Progress" position="20,590" size="650,10" />
169
- <ePixmap pixmap="skin_default/icons/menu.png" position="1130,575" size="60,30" />
135
+ <screen name="FTPBrowser" position="center,center" size="600,440" title="FTP Browser">
136
+ <ePixmap position="0,0" size="140,40" pixmap="skin_default/buttons/red.png" transparent="1" alphatest="on" />
137
+ <ePixmap position="140,0" size="140,40" pixmap="skin_default/buttons/green.png" transparent="1" alphatest="on" />
138
+ <ePixmap position="280,0" size="140,40" pixmap="skin_default/buttons/yellow.png" transparent="1" alphatest="on" />
139
+ <ePixmap position="420,0" size="140,40" pixmap="skin_default/buttons/blue.png" transparent="1" alphatest="on" />
140
+ <ePixmap position="565,10" size="35,25" pixmap="skin_default/buttons/key_menu.png" alphatest="on" />
141
+ <widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" valign="center" halign="center" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
142
+ <widget source="key_green" render="Label" position="140,0" zPosition="1" size="140,40" valign="center" halign="center" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
143
+ <widget source="key_yellow" render="Label" position="280,0" zPosition="1" size="140,40" valign="center" halign="center" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
144
+ <widget source="key_blue" render="Label" position="420,0" zPosition="1" size="140,40" valign="center" halign="center" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
145
+ <widget source="localText" render="Label" position="10,50" size="200,20" font="Regular;18" />
146
+ <widget name="local" position="10,80" size="290,320" scrollbarMode="showOnDemand" />
147
+ <widget source="remoteText" render="Label" position="300,50" size="200,20" font="Regular;18" />
148
+ <widget name="remote" position="300,80" size="290,320" scrollbarMode="showOnDemand" />
149
+ <widget source="eta" render="Label" position="20,410" size="200,30" font="Regular;23" />
150
+ <widget source="speed" render="Label" position="380,410" size="200,30" halign="right" font="Regular;23" />
151
+ <widget source="progress" render="Progress" position="20,440" size="560,10" />
170
152
</screen>"""
171
153
172
154
def __init__ (self , session ):
0 commit comments