Changeset 59

Show
Ignore:
Timestamp:
03/11/02 23:38:27 (6 years ago)
Author:
sholloway
Message:

*** empty log message ***

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/RBJabber/RBJabber/Client.py

    r55 r59  
    130130        return query 
    131131 
    132     def Message(self, toJID, body, subject='', type='message'): 
     132    def Message(self, toJID, body, subject='', type='message', xml=''): 
    133133        idMessage = self._GetNextID() 
    134134        strXML = '<message id=%s to=%s type=%s>' % (quoteattr(idMessage), quoteattr(toJID), quoteattr(type)) 
     135        strXML += xml 
    135136        if subject:  
    136137            strXML += '<subject>%s</subject>' % escape(subject) 
  • trunk/RBJabber/RBJabber/iqRosterQuery.py

    r56 r59  
    66from xml.sax.saxutils import escape, quoteattr 
    77from iqQuery import iqQueryBase, Subject 
    8 from JID import JIDnormalize  
     8from JID import *  
    99 
    1010#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     
    3131        iq = UpdateDict['iq'] 
    3232        for each in iq.query[0].item: 
    33             self.ByJID[JIDnormalize(each.jid)] = each 
     33            self.ByJID[JIDjoin(JIDsplit(each.jid)[:2])] = each 
    3434        self.UpdateObservers(Roster=self.ByJID) 
    3535 
     36    def Get(self, JID, default=None): 
     37        return self.ByJID.get(JIDjoin(JIDsplit(JID)[:2]), default) 
     38 
  • trunk/RBPrivate/Prototypes/ChatClient/ChatFrame.skin

    r42 r59  
    22<skin:skin xmlns:skin='http://namespaces.runeblade.com/skin' xmlns:py='http://namespaces.runeblade.com/xmlPython' xmlns='http://namespaces.runeblade.com/wxPythonSkin'> 
    33    <frame title='RuneBlade Chat' show='1' size='400,400' > 
     4        <py:script contextvar='Mediator' module='ChatMediator' call='ChatMediator' /> 
    45        <layout sizerOption='1' sizerFlag='wxEXPAND'> 
    5             <text sizerOption='1' sizerFlag='wxEXPAND' /> 
    6             <line size='5,5'  sizerFlag='wxEXPAND'/> 
    7             <text size='10, 40' sizerFlag='wxEXPAND'/> 
     6            <text sizerOption='1' sizerFlag='wxEXPAND' style='wxTE_RICH | wxTE_MULTILINE | wxTE_READONLY | wxTE_AUTO_URL' > 
     7                <py:obj_variable owner='Mediator' name='ChatOutput' /> 
     8            </text> 
     9            <line size='5,5' sizerFlag='wxEXPAND'/> 
     10            <layout sizerFlag='wxEXPAND'> 
     11                <input sizerOption='1' style='wxTE_PROCESS_ENTER'> 
     12                    <py:obj_variable owner='Mediator' name='ChatInput' /> 
     13                </input> 
     14                <button default='1' label='Send'> 
     15                    <py:obj_variable owner='Mediator' name='SendButton' /> 
     16                </button> 
     17            </layout> 
    818        </layout> 
     19        <py:inline>self.context.Mediator.Initialize()</py:inline> 
    920    </frame> 
    1021</skin:skin> 
  • trunk/RBPrivate/Prototypes/ChatClient/ClientModel.py

    r56 r59  
    4343    def OnAuthenticated(self, subject, UpdateDict): 
    4444        iq = UpdateDict['iq'] 
    45         print 'Authentication:', iq.type 
    4645        iq._client.Presence() 
  • trunk/RBPrivate/Prototypes/ChatClient/MainframeBuddyList.py

    r58 r59  
    3232            if each.jid in PresenceMap: 
    3333                lstTypes = [x.type for x in PresenceMap[each.jid].itervalues() if x.type != "unavailable"] 
     34                bAvailable = lstTypes and 1 or 0 
    3435                winList.SetStringItem(idx, 1, lstTypes and lstTypes[0] or "unavailable") 
    35             else: winList.SetStringItem(idx, 1, "unavailable") 
     36            else:  
     37                winList.SetStringItem(idx, 1, "unavailable") 
     38                bAvailable = 0 
    3639            winList.SetStringItem(idx, 2, each.jid) 
     40 
     41            item = winList.GetItem(idx) 
     42            if bAvailable:  
     43                item.SetBackgroundColour(wx.wxColour(224, 224, 224)) 
     44                item.SetTextColour(wx.wxColour(0, 64, 128)) 
     45            else:  
     46                item.SetBackgroundColour(wx.wxColour(224, 224, 224)) 
     47                item.SetTextColour(wx.wxColour(160, 128, 128)) 
     48            winList.SetItem(item) 
     49 
    3750            idx += 1 
    3851        return idx 
     
    6275                self.dictBuddyLists = {} 
    6376 
    64  
    6577    def UpdateBuddyList(self, winList=None, idx=0): 
    6678        winList = winList or self.winBuddyList 
     
    6880        for AccountName, BuddyList in self.dictBuddyLists.iteritems(): 
    6981            winList.InsertStringItem(idx, AccountName) 
     82            item = winList.GetItem(idx) 
     83            item.SetBackgroundColour(wx.wxColour(0, 64, 128)) 
     84            item.SetTextColour(wx.wxColour(212, 212, 255)) 
     85            winList.SetItem(item) 
     86  
    7087            idx = BuddyList.UpdateBuddyList(winList, idx+1) 
     88 
     89        winList.SetColumnWidth(0, wx.wxLIST_AUTOSIZE) 
     90        winList.SetColumnWidth(1, wx.wxLIST_AUTOSIZE) 
     91        winList.SetColumnWidth(2, wx.wxLIST_AUTOSIZE) 
    7192        return idx 
  • trunk/RBPrivate/Prototypes/ChatClient/MainframeMediator.py

    r56 r59  
    33#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    44 
     5import time 
    56from wxPython import wx 
    67from Foundation.Skinning import SkinFile 
     
    1920 
    2021    def OnIdle(self, evt): 
    21         result = self.context.Model.Process(0.1) 
    22         evt.RequestMore(result) 
     22        result = self.context.Model.Process(0) 
     23        if not result: 
     24            time.sleep(0.1) 
     25 
     26        evt.RequestMore(1) 
    2327        evt.Skip() 
    2428 
  • trunk/RBPrivate/Prototypes/ChatClient/client.skin

    r56 r59  
    1010        <skin:reference>AccountManagement.skin</skin:reference> 
    1111 
     12        <py:script module='MessageFactory' call='MessageFactory'/> 
     13 
    1214        <!-- 
    13         <skin:reference>Login.skin</skin:reference> 
    1415        <skin:reference>ChatFrame.skin</skin:reference> 
    1516        <skin:reference>GroupChatFrame.skin</skin:reference> 
    1617        <skin:reference>DebugFrame.skin</skin:reference> 
    1718        --> 
    18          
    1919    </application> 
    2020</skin:skin>