Esempio n. 1
0
    def init(self):
        self.title = _('Dashboard')
        self.category = ''
        self.icon = 'dashboard'
        self.order = 0

        self.append(self.ui.inflate('dashboard:dash'))
        self.dash = self.find('dash')
        self.dash.on('reorder', self.on_reorder)

        self.autorefresh = False

        self.find('header').platform = ajenti.platform_unmapped
        self.find('header').distro = ajenti.platform_string

        def post_widget_bind(o, c, i, u):
            u.find('listitem').on('click', self.on_add_widget_click, i)

        self.find('add-widgets').post_item_bind = post_widget_bind

        classes = [
            x for x in DashboardWidget.get_classes()
            if not x.hidden and UserManager.get().has_permission(
                self.context, WidgetPermissions.name_for(x))
        ]

        CollectionAutoBinding(sorted(classes, key=lambda x: x.name), None,
                              self.find('add-widgets')).populate()

        self.context.session.spawn(self.worker)
        AjentiUpdater.get().check_for_updates(self.update_check_callback)
Esempio n. 2
0
    def init(self):
        self.title = _('Dashboard')
        self.category = ''
        self.icon = 'dashboard'
        self.order = 0

        self.append(self.ui.inflate('dashboard:dash'))
        self.dash = self.find('dash')
        self.dash.on('reorder', self.on_reorder)

        self.autorefresh = False

        self.find('header').platform = ajenti.platform_unmapped
        self.find('header').distro = ajenti.platform_string

        def post_widget_bind(o, c, i, u):
            u.find('listitem').on('click', self.on_add_widget_click, i)

        self.find('add-widgets').post_item_bind = post_widget_bind

        classes = [
            x for x in DashboardWidget.get_classes()
            if not x.hidden and
            UserManager.get().has_permission(self.context, WidgetPermissions.name_for(x))
        ]

        CollectionAutoBinding(
            sorted(classes, key=lambda x: x.name),
            None, self.find('add-widgets')).populate()

        self.context.session.spawn(self.worker)
        AjentiUpdater.get().check_for_updates(self.update_check_callback)
Esempio n. 3
0
 def install_update(self):
     AjentiUpdater.get().check_for_updates(self.install_updates)
Esempio n. 4
0
 def install_updates(self, updates):
     AjentiUpdater.get().run_update(updates)
Esempio n. 5
0
 def install_update(self):
     AjentiUpdater.get().check_for_updates(self.install_updates)
Esempio n. 6
0
 def install_updates(self, updates):
     AjentiUpdater.get().run_update(updates)