# HG changeset patch # User Goffi # Date 1278932127 -28800 # Node ID 55d3ef84f01f6dde48ab2df0975837d2e31118cc # Parent 1b33b681ebd85a7dab179cdd2bc7865265087a25 Primitivus: mouse wheel changed to 'up' and 'down' key press diff -r 1b33b681ebd8 -r 55d3ef84f01f frontends/primitivus/primitivus --- a/frontends/primitivus/primitivus Mon Jul 12 18:54:55 2010 +0800 +++ b/frontends/primitivus/primitivus Mon Jul 12 18:55:27 2010 +0800 @@ -84,7 +84,7 @@ ## main loop setup ## self.main_widget = ProfileManager(self) - self.loop = urwid.MainLoop(self.main_widget, const_PALETTE, event_loop=urwid.GLibEventLoop(), unhandled_input=self.key_handler) + self.loop = urwid.MainLoop(self.main_widget, const_PALETTE, event_loop=urwid.GLibEventLoop(), input_filter=self.inputFilter, unhandled_input=self.keyHandler) ##misc setup## self.chat_wins=ChatList(self) @@ -105,7 +105,17 @@ self.loop.set_alarm_in(0,lambda a,b: self.postInit()) self.loop.run() - def key_handler(self, input): + def inputFilter(self, input, raw): + for i in input: + if i.__class__==tuple: + if i[0] == 'mouse press': + if i[1] == 4: #Mouse wheel up + input[input.index(i)] = 'up' + if i[1] == 5: #Mouse wheel down + input[input.index(i)] = 'down' + return input + + def keyHandler(self, input): if input in ('q', 'Q') or input == 'ctrl x': raise urwid.ExitMainLoop() elif input == 'ctrl d' and 'D' in self.bridge.getVersion(): #Debug only for dev versions diff -r 1b33b681ebd8 -r 55d3ef84f01f plugins/plugin_xep_0065.py --- a/plugins/plugin_xep_0065.py Mon Jul 12 18:54:55 2010 +0800 +++ b/plugins/plugin_xep_0065.py Mon Jul 12 18:55:27 2010 +0800 @@ -508,7 +508,7 @@ IQ_id = iq['id'] for element in SI_elem.elements(): if element.name == "streamhost": - info (_("Stream proposed: host=[%(host)s] port=[%(post)s]") % {'host':element['host'], 'port':element['port']}) + info (_("Stream proposed: host=[%(host)s] port=[%(port)s]") % {'host':element['host'], 'port':element['port']}) factory = self.client_factory self.server_factory.protocol.mode = "target" factory.protocol.host = self.host #needed for progress CB