# HG changeset patch # User KarstenBock@gmx.net # Date 1318076748 -7200 # Node ID 9e86c37f550669548b30ca6bc131aadd26ff97ac # Parent 73b7188a461da327e8e0e88e0526210967364af5 Added context menu to the inventory. diff -r 73b7188a461d -r 9e86c37f5506 gui/containergui_base.py --- a/gui/containergui_base.py Sat Oct 08 14:19:35 2011 +0200 +++ b/gui/containergui_base.py Sat Oct 08 14:25:48 2011 +0200 @@ -124,8 +124,9 @@ @return: None""" if event.getButton() == event.RIGHT: item = widget.item - if item: - item = item.entity + if item: + if not isinstance(item, General): + item = item.entity actions = {} if item.usable: actions = deepcopy(item.usable.actions) diff -r 73b7188a461d -r 9e86c37f5506 gui/inventorygui.py --- a/gui/inventorygui.py Sat Oct 08 14:19:35 2011 +0200 +++ b/gui/inventorygui.py Sat Oct 08 14:25:48 2011 +0200 @@ -156,9 +156,10 @@ widget = self.grid.getSlot(counter) slot_name = widget.name widget.index = counter - events_to_map[slot_name + "/mousePressed"] = self.mousePressedOnSlot - #events_to_map[slot_name + "/mouseReleased"] = \ - # self.showContextMenu + events_to_map[slot_name + "/mousePressed"] = ( + self.mousePressedOnSlot + ) + events_to_map[slot_name + "/mouseReleased"] = self.showContextMenu self.grid.mapEvents(events_to_map)