def __init__(self, session, device): Screen.__init__(self, session) boxinfo = BoxInfo() boxinfo.detectBox() self.device = device self.list = [] self.list.append(getConfigListEntry(_('Standby timeout:'), config.usage.hdd_standby)) ConfigListScreen.__init__(self, self.list) self['key_green'] = Button('') self['key_red'] = Button(_('Ok')) self['key_blue'] = Button(_('Exit')) self['key_yellow'] = Button('') self['model'] = Label('Model: unknow') self['serial'] = Label('Serial: unknow') self['firmware'] = Label('Firmware: unknow') self['cylinders'] = Label('Cylinders: unknow') self['heads'] = Label('Heads: unknow') self['sectors'] = Label('Sectors: unknow') self['readDisk'] = Label('Read disk speed: unknow') self['readCache'] = Label('Read disk cache speed: unknow') self['temp'] = Label('Disk temperature: unknow') self['actions'] = ActionMap(['OkCancelActions', 'ColorActions'], {'blue': self.keyCancel, 'red': self.keySave, 'cancel': self.keyCancel}, -2) self.onLayoutFinish.append(self.drawInfo) self.onShown.append(self.setWindowTitle)
def __init__(self, session, device): Screen.__init__(self, session) boxinfo = BoxInfo() boxinfo.detectBox() self.device = device self.list = [] self.list.append( getConfigListEntry(_('Standby timeout:'), config.usage.hdd_standby)) ConfigListScreen.__init__(self, self.list) self['key_green'] = Button('') self['key_red'] = Button(_('Ok')) self['key_blue'] = Button(_('Exit')) self['key_yellow'] = Button('') self['model'] = Label('Model: unknow') self['serial'] = Label('Serial: unknow') self['firmware'] = Label('Firmware: unknow') self['cylinders'] = Label('Cylinders: unknow') self['heads'] = Label('Heads: unknow') self['sectors'] = Label('Sectors: unknow') self['readDisk'] = Label('Read disk speed: unknow') self['readCache'] = Label('Read disk cache speed: unknow') self['temp'] = Label('Disk temperature: unknow') self['actions'] = ActionMap(['OkCancelActions', 'ColorActions'], { 'blue': self.keyCancel, 'red': self.keySave, 'cancel': self.keyCancel }, -2) self.onLayoutFinish.append(self.drawInfo) self.onShown.append(self.setWindowTitle)
def __init__(self, session, args=0): Screen.__init__(self, session) self.enable = 0 self.size = '131072' self.place = '/media/usb' self.filename = 'swapfile' boxinfo = BoxInfo() boxinfo.detectBox() self.settingsSwap = boxinfo.settingsSwap self.load() self.list = [] self.list.append( getConfigListEntry(_('Enabled:'), ConfigYesNo(default=self.enable))) self.list.append( getConfigListEntry( _('Size:'), ConfigSelection(default=self.size, choices=[('8192', _('8 MB')), ('16384', _('16 MB')), ('32768', _('32 MB')), ('65536', _('64 MB')), ('131072', _('128 MB')), ('262144', _('256 MB')), ('524288', _('512 MB')), ('1048576', _('1 GB'))]))) self.list.append( getConfigListEntry( _('Place:'), ConfigSelection(choices=[ '/media/hdd', '/media/usb', '/media/usb1', '/media/usb2', '/media/usb3', '/media/cf', '/media/mmc1' ], default=self.place))) self.list.append( getConfigListEntry( _('File name:'), ConfigText(default=self.filename, fixed_size=False))) ConfigListScreen.__init__(self, self.list) self['key_red'] = Button(_('Ok')) self['key_green'] = Button('') self['key_yellow'] = Button('') self['key_blue'] = Button(_('Exit')) self['actions'] = ActionMap( ['OkCancelActions', 'ColorActions', 'CiSelectionActions'], { 'red': self.ok, 'ok': self.ok, 'blue': self.cancel, 'cancel': self.cancel }, -2) self['status'] = Label() swaps = self.getActivedSwaps() if len(swaps) > 0: self['status'].setText( _('Actived on %s (%s bytes)') % (swaps[0][0], swaps[0][2])) else: self['status'].setText(_('Not active'))
def __init__(self, session, args = 0): Screen.__init__(self, session) self.enable = 0 self.size = '131072' self.place = '/media/usb' self.filename = 'swapfile' boxinfo = BoxInfo() boxinfo.detectBox() self.settingsSwap = boxinfo.settingsSwap self.load() self.list = [] self.list.append(getConfigListEntry(_('Enabled:'), ConfigYesNo(default=self.enable))) self.list.append(getConfigListEntry(_('Size:'), ConfigSelection(default=self.size, choices=[('8192', _('8 MB')), ('16384', _('16 MB')), ('32768', _('32 MB')), ('65536', _('64 MB')), ('131072', _('128 MB')), ('262144', _('256 MB')), ('524288', _('512 MB')), ('1048576', _('1 GB'))]))) self.list.append(getConfigListEntry(_('Place:'), ConfigSelection(choices=['/media/hdd', '/media/usb', '/media/usb1', '/media/usb2', '/media/usb3', '/media/cf', '/media/mmc1'], default=self.place))) self.list.append(getConfigListEntry(_('File name:'), ConfigText(default=self.filename, fixed_size=False))) ConfigListScreen.__init__(self, self.list) self['key_red'] = Button(_('Ok')) self['key_green'] = Button('') self['key_yellow'] = Button('') self['key_blue'] = Button(_('Exit')) self['actions'] = ActionMap(['OkCancelActions', 'ColorActions', 'CiSelectionActions'], {'red': self.ok, 'ok': self.ok, 'blue': self.cancel, 'cancel': self.cancel}, -2) self['status'] = Label() swaps = self.getActivedSwaps() if len(swaps) > 0: self['status'].setText(_('Actived on %s (%s bytes)') % (swaps[0][0], swaps[0][2])) else: self['status'].setText(_('Not active'))
def __init__(self, session): Screen.__init__(self, session) boxinfo = BoxInfo() boxinfo.detectBox() self.scriptsPath = boxinfo.scriptsPath self['statuslab'] = Label('') self['key_red'] = Button(_('Execute')) self['key_green'] = Button('') self['key_yellow'] = Button('') self['key_blue'] = Button(_('Exit')) self.mlist = [] try: self.populateSL() except OSError: print '[CTPanel] Could not find any /usr/script Folder to populate' self['list'] = MenuList(self.mlist) self['list'].onSelectionChanged.append(self.schanged) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'ok': self.mygo, 'back': self.close, 'blue': self.close, 'red': self.mygo}) self.onLayoutFinish.append(self.refr_sel)