Example #1
0
    def loadMenu(self, iters, parent=None):
        for menu, show in self.editor.getMenus(parent):
            name = cgi.escape(menu.get_name())
            if not show:
                name = "<small><i>%s</i></small>" % (name,)

            icon = util.getIcon(menu)
            iters[menu] = self.menu_store.append(iters[parent], (icon, name, menu))
            self.loadMenu(iters, menu)
Example #2
0
    def loadMenu(self, iters, parent=None):
        for menu, show in self.editor.getMenus(parent):
            name = html.escape(menu.get_name())
            if not show:
                name = "<small><i>%s</i></small>" % (name,)

            icon = util.getIcon(menu, self.main_window)
            iters[menu] = self.menu_store.append(iters[parent], (icon, name, False, menu))
            self.loadMenu(iters, menu)
Example #3
0
    def loadItems(self, menu):
        self.item_store.clear()
        for item, show in self.editor.getItems(menu):
            icon = util.getIcon(item)
            if isinstance(item, GMenu.TreeDirectory):
                name = item.get_name()
            elif isinstance(item, GMenu.TreeEntry):
                name = item.get_app_info().get_display_name()
            elif isinstance(item, GMenu.TreeSeparator):
                name = '---'
            else:
                assert False, 'should not be reached'

            name = cgi.escape(name)
            if not show:
                name = "<small><i>%s</i></small>" % (name,)

            self.item_store.append((show, icon, name, item))
    def loadItems(self, menu):
        self.item_store.clear()
        for item, show in self.editor.getItems(menu):
            icon = util.getIcon(item, self.main_window)
            if isinstance(item, CMenu.TreeDirectory):
                name = item.get_name()
            elif isinstance(item, CMenu.TreeEntry):
                name = item.get_app_info().get_display_name()
            elif isinstance(item, CMenu.TreeSeparator):
                name = '---'
            else:
                assert False, 'should not be reached'

            name = cgi.escape(name)
            if not show:
                name = "<small><i>%s</i></small>" % (name, )

            self.item_store.append((show, icon, name, item))