def render(self, screen, widget_context, x, y, w, h): UIEngine.clear(screen, x, y, w, h) items = [] net = self.network items.append(Spacing(1)) if net.state == IRCState.Network.STATE_CONNECTED: items.append(Text('Status: Connected')) elif net.state == IRCState.Network.STATE_CONNECTING: items.append(Text('Status: Connecting')) elif net.state == IRCState.Network.STATE_DISCONNECTED: items.append(Text('Status: Disconnected')) items.append(Spacing(1)) config = net.get_configuration() if config is None: items.append(Text('Waiting for network configuration...')) else: if config is False: items.append(Text('The network is *not* configured')) else: widget_context.set_text_default_value('config_server', config.server) widget_context.set_text_default_value('config_nickname', config.nickname) items.append( Horizontal( [Text('Server : '), TextInput('config_server', focus=1)])) items.append( Horizontal([ Text('Nickname : '), TextInput('config_nickname', focus=2) ])) items.append(Spacing(1)) Vertical(items).render(screen, widget_context, x, y, w, h)
def render(self, screen, widget_context, x, y, w, h): UIEngine.clear(screen, x, y, w, h) items = [] net = self.network items.append(Spacing(1)) if net.state == IRCState.Network.STATE_CONNECTED: items.append(Text('Status: Connected')) elif net.state == IRCState.Network.STATE_CONNECTING: items.append(Text('Status: Connecting')) elif net.state == IRCState.Network.STATE_DISCONNECTED: items.append(Text('Status: Disconnected')) items.append(Spacing(1)) config = net.get_configuration() if config is None: items.append(Text('Waiting for network configuration...')) else: if config is False: items.append(Text('The network is *not* configured')) else: widget_context.set_text_default_value('config_server', config.server) widget_context.set_text_default_value('config_nickname', config.nickname) items.append(Horizontal([Text('Server : '), TextInput('config_server', focus=1)])) items.append(Horizontal([Text('Nickname : '), TextInput('config_nickname', focus=2)])) items.append(Spacing(1)) Vertical(items).render(screen, widget_context, x, y, w, h)
def __init__(self): self.event = threading.Event() self.mutex = threading.RLock() self.layout = UIEngine.Canvas(self.event, self.mutex, { 'meta': self.on_meta }) self.thread = None self.networks = [] # setup windows self.status_window = UIComponents.TextWindow('status') self.windows = [self.status_window] self.current_window_index = 0 self.set_layout(self.windows[self.current_window_index].get_layout())
def render(self, screen, widget_context, x, y, w, h): UIEngine.nullRender(screen, self.name, x, y, w, h)
def renderNicklist(self, screen, widget_context, panel_id, x, y, w, h): UIEngine.nullRender(screen,panel_id,x,y,w,h)