Mercurial > libervia-backend
comparison frontends/src/primitivus/primitivus @ 1103:a096b8579a3c
frontends: signals are managed in a more generic way
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 11 Aug 2014 19:10:24 +0200 |
parents | 11e2bb20e896 |
children | e2e1e27a3680 |
comparison
equal
deleted
inserted
replaced
1102:4c48e2549592 | 1103:a096b8579a3c |
---|---|
389 if contact: | 389 if contact: |
390 assert(len(self.center_part.widget_list)==2) | 390 assert(len(self.center_part.widget_list)==2) |
391 self.center_part.widget_list[1] = self.chat_wins[contact] | 391 self.center_part.widget_list[1] = self.chat_wins[contact] |
392 self.menu_roller.addMenu(_('Chat menu'), self.chat_wins[contact].getMenu()) | 392 self.menu_roller.addMenu(_('Chat menu'), self.chat_wins[contact].getMenu()) |
393 | 393 |
394 def newMessage(self, from_jid, to_jid, msg, _type, extra, profile): | 394 def newMessageHandler(self, from_jid, to_jid, msg, _type, extra, profile): |
395 QuickApp.newMessage(self, from_jid, to_jid, msg, _type, extra, profile) | 395 QuickApp.newMessageHandler(self, from_jid, to_jid, msg, _type, extra, profile) |
396 | 396 |
397 if not from_jid in self.contact_list and from_jid.bare != self.profiles[profile]['whoami'].bare: | 397 if not from_jid in self.contact_list and from_jid.bare != self.profiles[profile]['whoami'].bare: |
398 #XXX: needed to show entities which haven't sent any | 398 #XXX: needed to show entities which haven't sent any |
399 # presence information and which are not in roster | 399 # presence information and which are not in roster |
400 self.contact_list.replace(from_jid, [C.GROUP_NOT_IN_ROSTER]) | 400 self.contact_list.replace(from_jid, [C.GROUP_NOT_IN_ROSTER]) |
479 def action_eb(failure): | 479 def action_eb(failure): |
480 self.showPopUp(sat_widgets.Alert(failure.fullname, failure.message, ok_cb=self.removePopUp)) | 480 self.showPopUp(sat_widgets.Alert(failure.fullname, failure.message, ok_cb=self.removePopUp)) |
481 | 481 |
482 self.bridge.launchAction(callback_id, data, profile_key, callback=action_cb, errback=action_eb) | 482 self.bridge.launchAction(callback_id, data, profile_key, callback=action_cb, errback=action_eb) |
483 | 483 |
484 def askConfirmation(self, confirmation_id, confirmation_type, data, profile): | 484 def askConfirmationHandler(self, confirmation_id, confirmation_type, data, profile): |
485 if not self.check_profile(profile): | |
486 return | |
487 answer_data={} | 485 answer_data={} |
488 | 486 |
489 def dir_selected_cb(path): | 487 def dir_selected_cb(path): |
490 dest_path = join(path, data['filename']) | 488 dest_path = join(path, data['filename']) |
491 answer_data["dest_path"] = getNewPath(dest_path) | 489 answer_data["dest_path"] = getNewPath(dest_path) |
511 | 509 |
512 elif confirmation_type == "YES/NO": | 510 elif confirmation_type == "YES/NO": |
513 pop_up_widget = sat_widgets.ConfirmDialog(data["message"], no_cb=refuse_cb, yes_cb=accept_cb) | 511 pop_up_widget = sat_widgets.ConfirmDialog(data["message"], no_cb=refuse_cb, yes_cb=accept_cb) |
514 self.showPopUp(pop_up_widget) | 512 self.showPopUp(pop_up_widget) |
515 | 513 |
516 def actionResult(self, type_, id, data, profile): | 514 def actionResultHandler(self, type_, id, data, profile): |
517 # FIXME: to be removed | 515 # FIXME: to be removed |
518 if not self.check_profile(profile): | |
519 return | |
520 | 516 |
521 if not id in self.current_action_ids: | 517 if not id in self.current_action_ids: |
522 log.debug (_('unknown id, ignoring')) | 518 log.debug (_('unknown id, ignoring')) |
523 return | 519 return |
524 if type_ == "SUPPRESS": | 520 if type_ == "SUPPRESS": |