Mercurial > libervia-backend
comparison frontends/src/primitivus/contact_list.py @ 499:28f4ce741ae5
primitivus: fixed display for selected entity in contacts list + added indentation for status message
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 04 Sep 2012 13:36:14 +0200 |
parents | 50dd2a0196c0 |
children | 00d3679976ab |
comparison
equal
deleted
inserted
replaced
498:9cc2ffd293f2 | 499:28f4ce741ae5 |
---|---|
104 status = self.CM.getAttr(jid, 'status') | 104 status = self.CM.getAttr(jid, 'status') |
105 show = self.CM.getAttr(jid, 'show') | 105 show = self.CM.getAttr(jid, 'show') |
106 show_icon, show_attr = const_SHOW_ICON.get(show,('','default')) | 106 show_icon, show_attr = const_SHOW_ICON.get(show,('','default')) |
107 contact_disp = ('alert' if contact in self.alert_jid else show_attr, nick or name or jid.node or jid.short) | 107 contact_disp = ('alert' if contact in self.alert_jid else show_attr, nick or name or jid.node or jid.short) |
108 display = [ show_icon + " " , contact_disp] | 108 display = [ show_icon + " " , contact_disp] |
109 display_selected = [ show_icon + " " , "[ %s ]" % contact_disp[1]] | |
110 if self.show_status: | 109 if self.show_status: |
111 status_disp = ('status',"\n" + status) if status else "" | 110 status_disp = ('status',"\n " + status) if status else "" |
112 display.append(status_disp) | 111 display.append(status_disp) |
113 display_selected.append(status_disp) | |
114 header = '(*) ' if contact in self.alert_jid else '' | 112 header = '(*) ' if contact in self.alert_jid else '' |
115 widget = sat_widgets.SelectableText(display, | 113 widget = sat_widgets.SelectableText(display, |
116 selected_text = display_selected, | |
117 selected = contact==self.selected, | 114 selected = contact==self.selected, |
118 header=header) | 115 header=header) |
119 widget.data = contact | 116 widget.data = contact |
120 content.append(widget) | 117 content.append(widget) |
121 urwid.connect_signal(widget, 'change', self.__contactClicked) | 118 urwid.connect_signal(widget, 'change', self.__contactClicked) |