# HG changeset patch # User Goffi # Date 1306678066 -7200 # Node ID e552a67b933d76d6be6789b2699bc238ed868ce8 # Parent 5fa710058e2d8392e9bf34a015ef0122cfdaf78a Contact update + add dedication in About dialog diff -r 5fa710058e2d -r e552a67b933d browser_side/dialog.py --- a/browser_side/dialog.py Sun May 29 15:25:46 2011 +0200 +++ b/browser_side/dialog.py Sun May 29 16:07:46 2011 +0200 @@ -226,7 +226,7 @@ for group in _groups: self.list_box.addItem(group) - def setGroupsSelected(self, groups): + def setGroupsSelected(self, selected_groups): if groups: self.list_box.setItemTextSelection(selected_groups) diff -r 5fa710058e2d -r e552a67b933d browser_side/panels.py --- a/browser_side/panels.py Sun May 29 15:25:46 2011 +0200 +++ b/browser_side/panels.py Sun May 29 16:07:46 2011 +0200 @@ -112,6 +112,7 @@ Project page: http://wiki.goffi.org/wiki/Salut_à_Toi

Any help welcome :) +

This project is dedicated to Roger Poisson

""") _dialog = dialog.GenericDialog("About", _about) _dialog.show() @@ -137,7 +138,28 @@ _dialog.show() def onUpdateContact(self): - pass + _dialog = None + _contacts_list = ListBox() + + def updateContactCb(sender): + _jid = _contacts_list.getValue(_contacts_list.getSelectedIndex()) + self.host.bridge.call('updateContact', None, _jid, '', _dialog.getSelectedGroups()) + print "contactUpdated" + + def onContactChange(_list): + _jid = _contacts_list.getValue(_contacts_list.getSelectedIndex()) + groups = self.host.contact_panel.getContactGroups(_jid) + _dialog.setGroupsSelected(groups) + + for contact in self.host.contact_panel.getContacts(): + _contacts_list.addItem(contact) + _contacts_list.addChangeListener(onContactChange) + _jid = _contacts_list.getValue(_contacts_list.getSelectedIndex()) + _selected_groups = self.host.contact_panel.getContactGroups(_jid) + _dialog = dialog.GroupSelector([Label('Which contact do you want to update ?'), _contacts_list], + self.host.contact_panel.getGroups(), _selected_groups, updateContactCb) + _dialog.setHTML('Updating contact') + _dialog.show() def onRemoveContact(self): _dialog = None diff -r 5fa710058e2d -r e552a67b933d libervia.py --- a/libervia.py Sun May 29 15:25:46 2011 +0200 +++ b/libervia.py Sun May 29 16:07:46 2011 +0200 @@ -68,7 +68,7 @@ LiberviaJsonProxy.__init__(self, "/json_api", ["getContacts", "addContact", "sendMessage", "sendMblog", "getMblogNodes", "getProfileJid", "getHistory", "getPresenceStatus", "joinMUC", "getRoomJoined", "launchTarotGame", "getTarotCardsPaths", "tarotGameReady", "tarotGameContratChoosed", - "tarotGamePlayCards", "getWaitingSub", "subscription", "delContact"]) + "tarotGamePlayCards", "getWaitingSub", "subscription", "delContact", "updateContact"]) class BridgeSignals(LiberviaJsonProxy): def __init__(self): diff -r 5fa710058e2d -r e552a67b933d libervia.tac --- a/libervia.tac Sun May 29 15:25:46 2011 +0200 +++ b/libervia.tac Sun May 29 16:07:46 2011 +0200 @@ -153,6 +153,11 @@ profile = ISATSession(self.session).profile self.sat_host.bridge.delContact(entity, profile) + def jsonrpc_updateContact(self, entity, name, groups): + """Update contact's roster item""" + profile = ISATSession(self.session).profile + self.sat_host.bridge.updateContact(entity, name, groups, profile) + def jsonrpc_subscription(self, sub_type, entity, name, groups): """Confirm (or infirm) subscription, and setup user roster in case of subscription"""