示例#1
0
    def on_checktoplevel_enabled(self, cell, path):
        it = self.store.get_iter(path)
        checkcol = self.columns.index("toplevel")
        idcol = self.columns.index("plugin_id")
        srccol = self.columns.index("source")
        is_toplevel = not self.store.get_value(it, checkcol)
        plugin_id = self.store.get_value(it, idcol)
        src = self.store.get_value(it, srccol)

        sc = sources.GetSourceController()
        sc.set_toplevel(src, is_toplevel)

        setctl = settings.GetSettingsController()
        setctl.set_source_is_toplevel(plugin_id, src, is_toplevel)
        self.store.set_value(it, checkcol, is_toplevel)
示例#2
0
    def _refresh(self, *ignored):
        self.store.clear()
        setctl = settings.GetSettingsController()
        sc = sources.GetSourceController()
        srcs = sorted(sc.get_sources(), key=str)

        for src in srcs:
            name = str(src)
            plugin_id = sc.get_plugin_id_for_object(src)
            if not plugin_id or setctl.get_plugin_is_hidden(plugin_id):
                continue
            if not kobject_should_show(src):
                continue
            gicon = src.get_icon()
            toplevel = setctl.get_source_is_toplevel(plugin_id, src)

            self.store.append((src, plugin_id, toplevel, gicon, name))