def __init__(self, exaile, callback): Gtk.Window.__init__(self) self.set_title(_('Get all tags from collection')) self.set_resizable(True) self.set_size_request(150, 400) self.add(Gtk.Frame()) vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) self._callback = callback self.model = AllTagsListStore() self.view = AllTagsListView() scroll = Gtk.ScrolledWindow() scroll.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) scroll.set_shadow_type(Gtk.ShadowType.IN) scroll.add(self.view) scroll.hide() vbox.pack_start(scroll, True, True, 0) button = Gtk.Button(_('Add selected to choices')) button.connect('clicked', self.on_add_selected_to_choices) vbox.pack_end(button, False, False, 0) self.get_child().add(vbox) # get the collection groups groups = gt_common.get_all_collection_groups(exaile.collection) for group in groups: self.model.add_group(group) self.view.set_model(self.model) self.show_all()
def __init__(self, exaile, callback): gtk.Window.__init__(self) self.set_title(_('Get all tags from collection')) self.set_resizable(True) self.set_size_request( 150, 400 ) self.add(gtk.Frame()) vbox = gtk.VBox() self._callback = callback self.model = AllTagsListStore() self.view = AllTagsListView() scroll = gtk.ScrolledWindow() scroll.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) scroll.set_shadow_type(gtk.SHADOW_IN) scroll.add( self.view ) scroll.hide() vbox.pack_start(scroll, True, True) button = gtk.Button(_('Add selected to choices')) button.connect('clicked', self.on_add_selected_to_choices) vbox.pack_end(button, False, False) self.get_child().add(vbox) # get the collection groups groups = gt_common.get_all_collection_groups(exaile.collection) for group in groups: self.model.add_group(group) self.view.set_model(self.model) self.show_all()