# HG changeset patch # User KarstenBock@gmx.net # Date 1318076748 -7200 # Node ID 6d07093e9d51fc0c84900dc4c67d9832f5a8ba45 # Parent ede6f6b31bf83148a7fd5492ef545461d043a828 Added context menu to the inventory. diff -r ede6f6b31bf8 -r 6d07093e9d51 src/parpg/gui/containergui_base.py --- a/src/parpg/gui/containergui_base.py Sat Oct 08 14:19:35 2011 +0200 +++ b/src/parpg/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 ede6f6b31bf8 -r 6d07093e9d51 src/parpg/gui/inventorygui.py --- a/src/parpg/gui/inventorygui.py Sat Oct 08 14:19:35 2011 +0200 +++ b/src/parpg/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)