Skip to content

Commit

Permalink
Merge pull request thinkle#276 from eginhard/fix-shopping
Browse files Browse the repository at this point in the history
Fix shopping list buttons and dialogs
  • Loading branch information
cydanil authored Oct 28, 2020
2 parents 472b6f3 + ac985d0 commit 30e1b21
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions gourmet/GourmetRecipeManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,8 @@ def shop_recs (self, *args):
parent=self.app.get_toplevel(),
digits=2)
if not mult:
mult = float(1)
debug('getNumber cancelled', 2)
return
d=self.sl.getOptionalIngDic(self.rd.get_ings(r),mult,self.prefs)
self.sl.addRec(r,mult,d)
self.sl.show()
Expand Down Expand Up @@ -1029,7 +1030,8 @@ def setup_actions (self):
#None,None,self.email_recs),
('BatchEdit',None,_('Batch _edit recipes'),
'<Control><Shift>E',None,self.batch_edit_recs),
('ShopRec','add-to-shopping-list',None,None,None,self.shop_recs)
('ShopRec', 'add-to-shopping-list', _('Add to Shopping List'),
'<Control>B', None, self.shop_recs)
])

self.mainActionGroup = Gtk.ActionGroup(name='MainActions')
Expand Down
4 changes: 2 additions & 2 deletions gourmet/reccard.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,8 @@ def setup_actions (self):
# None,None,self.email_cb),
('Print',Gtk.STOCK_PRINT,_('Print recipe'),
'<Control>P',None,self.print_cb),
('ShopRec','add-to-shopping-list',None,None,None,self.shop_for_recipe_cb),
('ShopRec', 'add-to-shopping-list', _('Add to Shopping List'),
'<Control>B', None, self.shop_for_recipe_cb),
('ForgetRememberedOptionals',None,_('Forget remembered optional ingredients'),
None,_('Before adding to shopping list, ask about all optional ingredients, even ones you previously wanted remembered'),self.forget_remembered_optional_ingredients),
])
Expand Down Expand Up @@ -3122,4 +3123,3 @@ def getYieldSelection (rec, parent=None):
return yd.run()
except:
return 1

3 changes: 2 additions & 1 deletion gourmet/shopgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,8 @@ def clear_recipes (self, *args):
self.recs.__delitem__(t.id)
debug("clear removed %s"%t,3)
self.reset()
elif de.getBoolean(label=_("No recipes selected. Do you want to clear the entire list?")):
elif de.getBoolean(label=_("No recipes selected. Do you want to clear the entire list?"),
cancel=False):
self.recs = {}
self.extras = []
self.reset()
Expand Down

0 comments on commit 30e1b21

Please sign in to comment.