40 lines
839 B
Python
40 lines
839 B
Python
# Bryan Schumaker (1 / 24 / 2010)
|
|
|
|
import ocarina
|
|
gtk = ocarina.gtk
|
|
libsaria = ocarina.libsaria
|
|
plugin = libsaria.plugin
|
|
|
|
cell = gtk.CellRendererText()
|
|
cell.set_fixed_height_from_font(1)
|
|
|
|
class PluginColumn(gtk.TreeViewColumn):
|
|
def __init__(self):
|
|
gtk.TreeViewColumn.__init__(self, "Plugin", cell)
|
|
self.add_attribute(cell, 'text', 0)
|
|
|
|
class PluginList(gtk.ListStore):
|
|
def __init__(self):
|
|
gtk.ListStore.__init__(self, str)
|
|
|
|
class PluginView(gtk.TreeView):
|
|
def __init__(self):
|
|
gtk.TreeView.__init__(self)
|
|
self.list = PluginList()
|
|
self.col = PluginColumn()
|
|
|
|
self.append_column(self.col)
|
|
names = []
|
|
for mod in plugin.loaded.values():
|
|
names.append(mod.__NAME__)
|
|
names.sort()
|
|
for name in names:
|
|
self.list.append([name])
|
|
|
|
self.set_model(self.list)
|
|
self.show_all()
|
|
|
|
|
|
def get_page():
|
|
return PluginView()
|