From d0cb41003665c2f6ad27604974fb64ce427449bf Mon Sep 17 00:00:00 2001 From: Boris 'billiob' Faure Date: Sun, 22 Aug 2010 20:37:38 +0200 Subject: [PATCH] web: set titles on cw. closes #24 --- amsn2/ui/front_ends/web/chat_window.py | 3 +++ amsn2/ui/front_ends/web/static/js/amsn2.js | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/amsn2/ui/front_ends/web/chat_window.py b/amsn2/ui/front_ends/web/chat_window.py index c04fb520..3ce19c84 100644 --- a/amsn2/ui/front_ends/web/chat_window.py +++ b/amsn2/ui/front_ends/web/chat_window.py @@ -58,6 +58,9 @@ def flash(self): """TODO: move, remove, detach, attach (shouldn't we use add ?), close, flash...""" + def set_title(self, title): + self._main.send("setTitleCW", self._uid, title); + class aMSNChatWidget(base.aMSNChatWidget): """ This interface will present a chat widget of the UI """ diff --git a/amsn2/ui/front_ends/web/static/js/amsn2.js b/amsn2/ui/front_ends/web/static/js/amsn2.js index b0dbb86b..79421d9e 100644 --- a/amsn2/ui/front_ends/web/static/js/amsn2.js +++ b/amsn2/ui/front_ends/web/static/js/amsn2.js @@ -356,6 +356,10 @@ function ChatWindow(_uid) win.setContent(widget.getElement()); widget.setParent(this); } + + this.setTitle = function(title) { + win.setTitle(title); + } } function ChatWidget(_uid) @@ -481,6 +485,11 @@ function onMessageReceivedChatWidget(uid, msg) function nudgeChatWidget(uid) { chatWidgets[uid].nudge(); +} + +function setTitleCW(uid, title) +{ + chatWindows[uid].setTitle(title); } // }}} // main {{{