comparison src/browser/sat_browser/dialog.py @ 669:a8fddccf5b84 frontends_multi_profiles

server and browser sides: fixes joining room with auto-generated name + leave JID error handling to the backend
author souliane <souliane@mailoo.org>
date Sat, 07 Mar 2015 15:08:56 +0100
parents ebb602d8b3f2
children 9877607c719a
comparison
equal deleted inserted replaced
668:cbb3662818c8 669:a8fddccf5b84
84 84
85 @property 85 @property
86 def room(self): 86 def room(self):
87 """Get the room that has been selected or entered by the user 87 """Get the room that has been selected or entered by the user
88 88
89 @return: jid.JID or None 89 @return: jid.JID or None to let the backend generate a new name
90 """ 90 """
91 if self.exist_radio.getChecked(): 91 if self.exist_radio.getChecked():
92 values = self.rooms_list.getSelectedValues() 92 values = self.rooms_list.getSelectedValues()
93 return jid.JID(values[0]) if values else None 93 return jid.JID(values[0]) if values else None
94 value = self.box.getText() 94 value = self.box.getText()
95 return None if value == self.GENERATE_MUC else jid.JID(value) 95 return None if value in ('', self.GENERATE_MUC) else jid.JID(value)
96 96
97 def onFocus(self, sender): 97 def onFocus(self, sender):
98 if sender == self.rooms_list: 98 if sender == self.rooms_list:
99 self.exist_radio.setChecked(True) 99 self.exist_radio.setChecked(True)
100 elif sender == self.box: 100 elif sender == self.box:
136 elif len(nb_contact) == 1: 136 elif len(nb_contact) == 1:
137 nb_contact = (nb_contact[0], nb_contact[0]) 137 nb_contact = (nb_contact[0], nb_contact[0])
138 elif nb_contact is not None: 138 elif nb_contact is not None:
139 nb_contact = (nb_contact, nb_contact) 139 nb_contact = (nb_contact, nb_contact)
140 if nb_contact is None: 140 if nb_contact is None:
141 log.warning("Need to select as many contacts as you want") 141 log.debug("Need to select as many contacts as you want")
142 else: 142 else:
143 log.warning("Need to select between %d and %d contacts" % nb_contact) 143 log.debug("Need to select between %d and %d contacts" % nb_contact)
144 self.nb_contact = nb_contact 144 self.nb_contact = nb_contact
145 self.ok_button = ok_button 145 self.ok_button = ok_button
146 VerticalPanel.__init__(self, Width='100%') 146 VerticalPanel.__init__(self, Width='100%')
147 self.contacts_list = ListBox() 147 self.contacts_list = ListBox()
148 self.contacts_list.setMultipleSelect(True) 148 self.contacts_list.setMultipleSelect(True)