@@ -73,22 +73,30 @@ def __init__(self, list):
73
73
self .l .setFont (1 , gFont (tlf .face (tlf .SMALL ), tlf .size (tlf .SMALL )))
74
74
75
75
def fstabMenuListEntry (devicename , mountpoint ,fstype , options , dumpfreq , passnum ):
76
+ sizes = componentSizes [fstabViewerScreen .SKIN_COMPONENT_KEY ]
77
+ textPos = sizes .get (fstabViewerScreen .SKIN_COMPONENT_TEXT_POS , 0 )
78
+ text2Pos = sizes .get (fstabViewerScreen .SKIN_COMPONENT_TEXT2_POS , 270 )
79
+ textWidth = sizes .get (fstabViewerScreen .SKIN_COMPONENT_TEXT_WIDTH , 250 )
80
+ text2Width = sizes .get (fstabViewerScreen .SKIN_COMPONENT_TEXT2_WIDTH , 800 )
81
+ textHeight = sizes .get (fstabViewerScreen .SKIN_COMPONENT_TEXT_HEIGHT , 30 )
82
+ itemMargin = sizes .get (fstabViewerScreen .SKIN_COMPONENT_ITEM_MARGIN , 15 )
83
+ itemMargin2 = sizes .get (fstabViewerScreen .SKIN_COMPONENT_ITEM_MARGIN2 , 18 )
84
+
76
85
res = [ (devicename , mountpoint ,fstype , options , dumpfreq , passnum ) ]
77
- res .append (MultiContentEntryText (pos = (270 , 15 ),size = (800 , 30 ), font = 0 , text = devicename ))
78
- res .append (MultiContentEntryText (pos = (270 , 60 ),size = (800 , 30 ), font = 0 , text = mountpoint ))
79
- res .append (MultiContentEntryText (pos = (270 , 90 ),size = (800 , 30 ), font = 0 , text = fstype ))
80
- res .append (MultiContentEntryText (pos = (270 , 120 ),size = (800 , 30 ), font = 0 , text = options ))
81
- res .append (MultiContentEntryText (pos = (270 , 150 ),size = (800 , 30 ), font = 0 , text = dumpfreq ))
82
- res .append (MultiContentEntryText (pos = (270 , 180 ),size = (800 , 30 ), font = 0 , text = passnum ))
83
- res .append (MultiContentEntryText (pos = (0 , 17 ),size = (250 , 30 ), font = 1 , flags = RT_HALIGN_RIGHT , text = "Device name:" ))
84
- res .append (MultiContentEntryText (pos = (0 , 62 ),size = (250 , 30 ), font = 1 , flags = RT_HALIGN_RIGHT , text = "Mount point:" ))
85
- res .append (MultiContentEntryText (pos = (0 , 92 ),size = (250 , 30 ), font = 1 , flags = RT_HALIGN_RIGHT , text = "File system type:" ))
86
- res .append (MultiContentEntryText (pos = (0 , 122 ),size = (250 , 30 ), font = 1 , flags = RT_HALIGN_RIGHT , text = "Options:" ))
87
- res .append (MultiContentEntryText (pos = (0 , 152 ),size = (250 , 30 ), font = 1 , flags = RT_HALIGN_RIGHT , text = "Dump frequency:" ))
88
- res .append (MultiContentEntryText (pos = (0 , 182 ),size = (250 , 30 ), font = 1 , flags = RT_HALIGN_RIGHT , text = "Pass number:" ))
86
+ res .append (MultiContentEntryText (pos = (text2Pos , itemMargin ),size = (text2Width , textHeight ), font = 0 , text = devicename ))
87
+ res .append (MultiContentEntryText (pos = (text2Pos , itemMargin + textHeight ),size = (text2Width , textHeight ), font = 0 , text = mountpoint ))
88
+ res .append (MultiContentEntryText (pos = (text2Pos , itemMargin + textHeight * 2 ),size = (text2Width , textHeight ), font = 0 , text = fstype ))
89
+ res .append (MultiContentEntryText (pos = (text2Pos , itemMargin + textHeight * 3 ),size = (text2Width , textHeight ), font = 0 , text = options ))
90
+ res .append (MultiContentEntryText (pos = (text2Pos , itemMargin + textHeight * 4 ),size = (text2Width , textHeight ), font = 0 , text = dumpfreq ))
91
+ res .append (MultiContentEntryText (pos = (text2Pos , itemMargin + textHeight * 5 ),size = (text2Width , textHeight ), font = 0 , text = passnum ))
92
+ res .append (MultiContentEntryText (pos = (textPos , itemMargin2 ),size = (textWidth , textHeight ), font = 1 , flags = RT_HALIGN_RIGHT , text = "Device name:" ))
93
+ res .append (MultiContentEntryText (pos = (textPos , itemMargin2 + textHeight ),size = (textWidth , textHeight ), font = 1 , flags = RT_HALIGN_RIGHT , text = "Mount point:" ))
94
+ res .append (MultiContentEntryText (pos = (textPos , itemMargin2 + textHeight * 2 ),size = (textWidth , textHeight ), font = 1 , flags = RT_HALIGN_RIGHT , text = "File system type:" ))
95
+ res .append (MultiContentEntryText (pos = (textPos , itemMargin2 + textHeight * 3 ),size = (textWidth , textHeight ), font = 1 , flags = RT_HALIGN_RIGHT , text = "Options:" ))
96
+ res .append (MultiContentEntryText (pos = (textPos , itemMargin2 + textHeight * 4 ),size = (textWidth , textHeight ), font = 1 , flags = RT_HALIGN_RIGHT , text = "Dump frequency:" ))
97
+ res .append (MultiContentEntryText (pos = (textPos , itemMargin2 + textHeight * 5 ),size = (textWidth , textHeight ), font = 1 , flags = RT_HALIGN_RIGHT , text = "Pass number:" ))
89
98
return res
90
99
91
-
92
100
class fstabViewerScreen (Screen ,HelpableScreen ):
93
101
skin = """
94
102
<screen position="center,center" size="820,340" title="fstab-Editor">
@@ -106,6 +114,15 @@ class fstabViewerScreen(Screen,HelpableScreen):
106
114
<widget name="entryinfo" position="10,310" size="800,25" font="Regular;22" halign="center" />
107
115
</screen>"""
108
116
117
+ SKIN_COMPONENT_KEY = "fstabViewer"
118
+ SKIN_COMPONENT_TEXT_POS = "textPos"
119
+ SKIN_COMPONENT_TEXT2_POS = "text2Pos"
120
+ SKIN_COMPONENT_TEXT_WIDTH = "textWidth"
121
+ SKIN_COMPONENT_TEXT2_WIDTH = "text2Width"
122
+ SKIN_COMPONENT_TEXT_HEIGHT = "textHeight"
123
+ SKIN_COMPONENT_ITEM_MARGIN = "itemMargin"
124
+ SKIN_COMPONENT_ITEM_MARGIN2 = "itemMargin2"
125
+
109
126
def __init__ (self , session , args = 0 ):
110
127
self .skin = fstabViewerScreen .skin
111
128
self .session = session
0 commit comments