def UpdateCastDisplay(pyCast): '''Update the cast treelist''' ## EXTRA CODE?? Casts = KirbyBase() treeCastList=pyCast.get_widget("podcastlist") modlCastList=gtk.TreeStore(gobject.TYPE_STRING) treeCastList.set_model(modlCastList) treeCastList.set_headers_visible(gtk.FALSE) x=0 for name in delistify(Casts.select(CASTDB, ['name'],[''],['name'])): position=modlCastList.insert_after(None,None) modlCastList.set_value(position,0,name) x=x+1
def Ok(self,widget): '''When the Add Cast Dialog's OK button is hit''' Casts = KirbyBase() CloseWindow=True EditCastName = self.EditCast.get_widget("tEditCastName") EditCastUrl = self.EditCast.get_widget("tEditCastUrl") EditCastUpdate= self.EditCast.get_widget("cEditCastUpdate") for name in delistify(Casts.select(CASTDB, ['name'],[''],['name'])): if EditCastName.get_text()== name: EditCastName.set_text("Name Already Used") CloseWindow=False if CloseWindow is True: UpdateCastDisplay(self.pyCast) self.wEditCast.destroy()
def ListCasts(pyCast): '''Lists all the casts into their container''' treeCastList=pyCast.get_widget("podcastlist") modlCastList=gtk.TreeStore(gobject.TYPE_STRING) Casts = KirbyBase() treeCastList.set_model(modlCastList) treeCastList.set_headers_visible(gtk.FALSE) # Set the columns column=gtk.TreeViewColumn("Podcast",gtk.CellRendererText(), text=0) column.set_resizable(gtk.TRUE) treeCastList.append_column(column) x=0 # Loop through and add the casts for name in delistify(Casts.select(CASTDB, ['name'],[''],['name'])): position=modlCastList.insert_after(None,None) modlCastList.set_value(position, 0, name) x=x+1 selection=treeCastList.get_selection() selection.select_path(0)
def Ok(self,widget): '''When the Add Cast Dialog's OK button is hit''' Casts = KirbyBase() CloseWindow=True AddCastName = self.AddCast.get_widget("tAddCastName") AddCastUrl = self.AddCast.get_widget("tAddCastUrl") AddCastUpdate= self.AddCast.get_widget("cAddCastUpdate") for name in delistify(Casts.select(CASTDB, ['name'],[''],['name'])): if AddCastName.get_text()== name: AddCastName.set_text("Name Already Used") CloseWindow=False if CloseWindow is True: if casts.DownloadTestRSS(AddCastUrl.get_text()): Casts.insert(CASTDB, [AddCastName.get_text(), AddCastUrl.get_text(), AddCastUpdate.get_mode(), datetime.datetime.now()]) casts.DownloadRSS(self.pyCast,AddCastUrl.get_text()) UpdateCastDisplay(self.pyCast) self.wAddCast.destroy()