Mercurial > libervia-backend
comparison frontends/src/primitivus/gateways.py @ 587:952322b1d490
Remove trailing whitespaces.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Fri, 18 Jan 2013 17:55:34 +0100 |
parents | ca13633d3b6b |
children | 84a6e83157c2 |
comparison
equal
deleted
inserted
replaced
586:6a718ede8be1 | 587:952322b1d490 |
---|---|
42 ext_serv_col = urwid.Columns([self.ext_serv,('fixed',go_button.getSize(),go_button)]) | 42 ext_serv_col = urwid.Columns([self.ext_serv,('fixed',go_button.getSize(),go_button)]) |
43 widget_list.append(ext_serv_col) | 43 widget_list.append(ext_serv_col) |
44 list_wid = urwid.ListBox(widget_list) | 44 list_wid = urwid.ListBox(widget_list) |
45 decorated = sat_widgets.LabelLine(list_wid, sat_widgets.SurroundedText(title)) | 45 decorated = sat_widgets.LabelLine(list_wid, sat_widgets.SurroundedText(title)) |
46 urwid.WidgetWrap.__init__(self, decorated) | 46 urwid.WidgetWrap.__init__(self, decorated) |
47 | 47 |
48 def browseExternalServer(self, button): | 48 def browseExternalServer(self, button): |
49 """Open the gateway manager on given server""" | 49 """Open the gateway manager on given server""" |
50 server = self.ext_serv.get_edit_text() | 50 server = self.ext_serv.get_edit_text() |
51 if not server: | 51 if not server: |
52 popup = sat_widgets.Alert(_("Error"), _("You must enter an external server JID"), ok_cb=self.host.removePopUp) | 52 popup = sat_widgets.Alert(_("Error"), _("You must enter an external server JID"), ok_cb=self.host.removePopUp) |
56 self.host.current_action_ids.add(action_id) | 56 self.host.current_action_ids.add(action_id) |
57 self.host.current_action_ids_cb[action_id] = self.host.onGatewaysFound | 57 self.host.current_action_ids_cb[action_id] = self.host.onGatewaysFound |
58 self.host.removeWindow() | 58 self.host.removeWindow() |
59 | 59 |
60 def addGateway(self, widget_list, gateway, param): | 60 def addGateway(self, widget_list, gateway, param): |
61 | 61 |
62 widget_col = [] | 62 widget_col = [] |
63 widget_col.append(('weight',4,urwid.Text(unicode(param['name'])))) #FIXME: unicode to be remove when DBus bridge will not give dbus.String anymore | 63 widget_col.append(('weight',4,urwid.Text(unicode(param['name'])))) #FIXME: unicode to be remove when DBus bridge will not give dbus.String anymore |
64 | 64 |
65 #Then the transport type message | 65 #Then the transport type message |
66 widget_col.append(('weight',6,urwid.Text(self.getGatewayDesc(param['type'])))) | 66 widget_col.append(('weight',6,urwid.Text(self.getGatewayDesc(param['type'])))) |
67 | 67 |
68 #The buttons | 68 #The buttons |
69 | 69 |
70 reg_button = sat_widgets.CustomButton( _("Register"), self.onRegister) | 70 reg_button = sat_widgets.CustomButton( _("Register"), self.onRegister) |
71 reg_button.gateway_jid = JID(gateway) | 71 reg_button.gateway_jid = JID(gateway) |
72 widget_col.append(('fixed',reg_button.getSize(),reg_button)) | 72 widget_col.append(('fixed',reg_button.getSize(),reg_button)) |
73 unreg_button = sat_widgets.CustomButton( _("Unregister"), self.onUnregister) | 73 unreg_button = sat_widgets.CustomButton( _("Unregister"), self.onUnregister) |
74 unreg_button.gateway_jid = JID(gateway) | 74 unreg_button.gateway_jid = JID(gateway) |
75 widget_col.append(('fixed',unreg_button.getSize(),unreg_button)) | 75 widget_col.append(('fixed',unreg_button.getSize(),unreg_button)) |
76 widget_list.append(urwid.Columns(widget_col,1)) | 76 widget_list.append(urwid.Columns(widget_col,1)) |
77 | 77 |
78 def onRegister(self, button): | 78 def onRegister(self, button): |
79 """Called when register button is clicked""" | 79 """Called when register button is clicked""" |
80 gateway_jid = button.gateway_jid | 80 gateway_jid = button.gateway_jid |
81 action_id = self.host.bridge.in_band_register(gateway_jid, self.host.profile) | 81 action_id = self.host.bridge.in_band_register(gateway_jid, self.host.profile) |
82 self.host.current_action_ids.add(action_id) | 82 self.host.current_action_ids.add(action_id) |