ocarina: Added initial plugin configuration page

This page will eventually be used to stop, start, and uninstall plugins.
This commit is contained in:
Bryan Schumaker 2011-01-24 22:43:00 -05:00
parent 8c2e7605ef
commit d28ca013f3
2 changed files with 39 additions and 0 deletions

View File

@ -5,6 +5,7 @@ gtk = ocarina.gtk
def configure():
import general
import plugin
window = gtk.Window()
pages = gtk.Notebook()
@ -14,4 +15,5 @@ def configure():
pages.show()
pages.append_page(general.get_page(), gtk.Label("General"))
pages.append_page(plugin.get_page(), gtk.Label("Plugins"))
window.show()

View File

@ -0,0 +1,37 @@
# 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)
keys = plugin.loaded.keys()
keys.sort()
for key in keys:
self.list.append([key])
self.set_model(self.list)
self.show_all()
def get_page():
return PluginView()