Ejemplo n.º 1
0
    def get_ui(self):
        ui = self.app.inflate('dashboard:main')
        self._mgr.refresh()

        self.fill('l', self._mgr.list_left(), ui, 'cleft')
        self.fill('r', self._mgr.list_right(), ui, 'cright')

        ui.insertText('host', platform.node())
        ui.insertText('distro', detect_distro())
        ui.find('icon').set('src', '/dl/dashboard/distributor-logo-%s.png'%detect_platform(mapping=False))

        if self._adding_widget == True:
            dlg = self.app.inflate('dashboard:add-widget')
            idx = 0
            for prov in sorted(self.app.grab_plugins(apis.dashboard.IWidget)):
                if hasattr(prov, 'hidden'):
                    continue
                dlg.append('list', UI.ListItem(
                    UI.HContainer(
                        UI.Image(file=prov.icon),
                        UI.Label(text=prov.name),
                    ),
                    id=prov.plugin_id,
                ))
                idx += 1
            ui.append('main', dlg)

        elif self._adding_widget != None:
            ui.append('main', self._mgr.get_by_name(self._adding_widget).get_config_dialog())

        return ui
Ejemplo n.º 2
0
 def __init__(self):
     ConfigParser.__init__(self)
     self.set('platform', detect_platform())  # TODO: move this out
Ejemplo n.º 3
0
 def __init__(self):
     ConfigParser.__init__(self)
     self.set('platform', detect_platform()) # TODO: move this out