def __init__(self, session, message='', title='', menulist=[], type=0, exitid=-1, default=0, timeout=0): Screen.__init__(self, session) self.skin = ExtraMessageBox.skin self.session = session self.ctitle = title self.exitid = exitid self.default = default self.timeout = timeout self.elapsed = 0 self.list = [] for item in menulist: self.list.append(MessageBoxEntry(item[0], item[1])) self['menu'] = ExtrasList(self.list) self['menu'].onSelectionChanged.append(self.selectionChanged) self['message'] = Label(message) self['actions'] = ActionMap(['SetupActions'], { 'ok': self.ok, 'cancel': self.cancel }, -2) self.onLayoutFinish.append(self.layoutFinished) self.timer = eTimer() self.timer.callback.append(self.timeoutStep) if self.timeout > 0: self.timer.start(1000, 1)
def __init__(self, session, args = 0): self.session = session Screen.__init__(self, session) self.disks = list() self.mdisks = Disks() for disk in self.mdisks.disks: capacity = '%d MB' % (disk[1] / 1048576) self.disks.append(DiskEntry(disk[3], capacity, disk[2])) self['menu'] = ExtrasList(self.disks) self['key_red'] = Button(_('Partitions')) self['key_green'] = Button('Info') self['key_yellow'] = Button(_('Initialize')) self['key_blue'] = Button(_('Exit')) self['actions'] = ActionMap(['OkCancelActions', 'ColorActions'], {'blue': self.quit, 'yellow': self.yellow, 'green': self.green, 'red': self.red, 'cancel': self.quit}, -2) self.onShown.append(self.setWindowTitle)