def deleteEntry(self, entry, parent): if entry.publications: text = _('This entry has been published to weblogs.\n' 'Do you want to delete this entry with all publications?') else: text = _('Do you really want to delete this entry?') if apputils.question(text, parent.window): i = len(entry.publications) - 1 if DEBUG: print entry.publications while i > -1: publication = entry.publications[i] blog = publication.weblog publication.deleteRemoteEntry(blog, parent) publication.destroySelf() i = i - 1 entry.destroySelf() louie.send('entry-deleted')
def _addCategories(self, categories): msg = _('Downloaded %d categories, do you want to update list?') \ % len(categories) if apputils.question(msg): for remoteCat in categories: remoteCat['updated'] = False for (name, desc, category) in self.model: if name.decode('utf-8') == remoteCat['name']: category.description = remoteCat['description'] remoteCat['updated'] = True for remoteCat in categories: if not remoteCat['updated']: name = remoteCat['name'] description = remoteCat['description'] category = datamodel.Category(name=name, description=description) self.model.append((name,\ apputils.ellipsize(description, 80), category)) return False
def deleteWeblog(self, weblog, parent): text = _('Do you really want to delete this weblog?') if apputils.question(text, parent.window): weblog.destroySelf() louie.send('weblog-deleted')
def deleteIdentity(self, identity, parent): text = _('Do you really want to delete this identity?') if apputils.question(text, parent.window): identity.destroySelf() louie.send('identity-deleted')
def deleteCategory(self, category, parent): text = _('Do you really want to delete this category?') if apputils.question(text, parent.window): category.destroySelf() louie.send('category-deleted')