def __init__(self, parent=None): super(PgaSourceDialog, self).__init__(parent=parent) # GtkBuilder Objects self.sources_selection = self.builder.get_object("sources_selection") self.sources_treeview = self.builder.get_object("sources_treeview") self.remove_source_button = self.builder.get_object("remove_source_button") # Treeview setup self.sources_liststore = Gtk.ListStore(str) renderer = Gtk.CellRendererText() renderer.set_padding(4, 10) uri_column = Gtk.TreeViewColumn("URI", renderer, text=0) self.sources_treeview.append_column(uri_column) self.sources_treeview.set_model(self.sources_liststore) sources = pga.read_sources() for index, source in enumerate(sources): self.sources_liststore.append((source,)) self.remove_source_button.set_sensitive(False) self.dialog.show_all()
def __init__(self, parent=None): super(PgaSourceDialog, self).__init__(parent=parent) # GtkBuilder Objects self.sources_selection = self.builder.get_object("sources_selection") self.sources_treeview = self.builder.get_object("sources_treeview") self.remove_source_button = self.builder.get_object("remove_source_button") # Treeview setup self.sources_liststore = Gtk.ListStore(str) renderer = Gtk.CellRendererText() renderer.set_padding(4, 10) uri_column = Gtk.TreeViewColumn("URI", renderer, text=0) self.sources_treeview.append_column(uri_column) self.sources_treeview.set_model(self.sources_liststore) sources = pga.read_sources() for index, source in enumerate(sources): self.sources_liststore.append((source,)) self.remove_source_button.set_sensitive(False) self.dialog.show_all()