[cookboob] [qcookboob] better nb_person interval display
This commit is contained in:
parent
7a6132cbca
commit
76c3454617
2 changed files with 2 additions and 6 deletions
|
|
@ -44,9 +44,7 @@ class RecipeInfoFormatter(IFormatter):
|
|||
if not empty(obj.cooking_time):
|
||||
result += 'Cooking time: %smin\n' % obj.cooking_time
|
||||
if not empty(obj.nb_person):
|
||||
nbstr = '%s' % obj.nb_person[0]
|
||||
if len(obj.nb_person) > 1:
|
||||
nbstr += '/%s' % obj.nb_person[1]
|
||||
nbstr = '-'.join(str(num) for num in obj.nb_person)
|
||||
result += 'Amount of people: %s\n' % nbstr
|
||||
result += '\n%sIngredients%s\n' % (self.BOLD, self.NC)
|
||||
for i in obj.ingredients:
|
||||
|
|
|
|||
|
|
@ -43,9 +43,7 @@ class Recipe(QFrame):
|
|||
if not empty(recipe.title):
|
||||
self.ui.titleLabel.setText(recipe.title)
|
||||
if not empty(recipe.nb_person):
|
||||
nbstr = '%s' % recipe.nb_person[0]
|
||||
if len(recipe.nb_person) > 1:
|
||||
nbstr += '/%s' % recipe.nb_person[1]
|
||||
nbstr = '-'.join(str(num) for num in recipe.nb_person)
|
||||
self.ui.nbPersonLabel.setText(nbstr)
|
||||
else:
|
||||
self.ui.nbPersonLabel.parent().hide()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue