Changeset 84

Show
Ignore:
Timestamp:
07/16/07 21:14:16 (1 year ago)
Author:
roidelapluie
Message:

Draw banner in consequence of users in continued groupchats

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gajim/branches/chat2muc/src/dialogs.py

    r83 r84  
    33693369                gajim.automatic_rooms[self.account][room_jid]['continue_tag'] = True 
    33703370                gajim.interface.roster.join_gc_room(self.account, room_jid, 
    3371                         gajim.nicks[self.account], None
     3371                        gajim.nicks[self.account], None, is_continued=True
    33723372                self.window.destroy() 
    33733373 
  • gajim/branches/chat2muc/src/groupchat_control.py

    r2 r84  
    144144                'part', 'names', 'say', 'topic'] 
    145145 
    146         def __init__(self, parent_win, contact, acct): 
     146        def __init__(self, parent_win, contact, acct, is_continued=False): 
    147147                ChatControlBase.__init__(self, self.TYPE_ID, parent_win, 
    148148                                        'muc_child_vbox', contact, acct); 
     149 
     150                self.is_continued=is_continued 
    149151 
    150152                widget = self.xml.get_widget('muc_window_actions_button') 
     
    472474                self.name_label.set_ellipsize(pango.ELLIPSIZE_END) 
    473475                font_attrs, font_attrs_small = self.get_font_attrs() 
    474                 text = '<span %s>%s</span>' % (font_attrs, self.room_jid) 
     476                if self.is_continued: 
     477                        nicks = [] 
     478                        for nick in gajim.contacts.get_nick_list(self.account, self.room_jid): 
     479                                if nick != self.nick: 
     480                                        nicks.append(nick) 
     481                        if nicks != []: 
     482                                title = ', ' 
     483                                title = 'Conversation with ' + title.join(nicks) 
     484                        else: 
     485                                title = 'Continued conversation' 
     486                        text = '<span %s>%s</span>' % (font_attrs, title) 
     487                else: 
     488                        text = '<span %s>%s</span>' % (font_attrs, self.room_jid) 
    475489                if self.subject: 
    476490                        subject = helpers.reduce_chars_newlines(self.subject, max_lines = 2) 
     
    10731087                        self.got_connected() 
    10741088                self.list_treeview.expand_row((model.get_path(role_iter)), False) 
     1089                if self.is_continued: 
     1090                        self.draw_banner_text() 
    10751091                return iter 
    10761092 
  • gajim/branches/chat2muc/src/roster_window.py

    r3 r84  
    738738                        model[iter][C_SECPIXBUF] = scaled_pixbuf 
    739739 
    740         def join_gc_room(self, account, room_jid, nick, password, minimize = False): 
     740        def join_gc_room(self, account, room_jid, nick, password, minimize=False, 
     741                is_continued=False): 
    741742                '''joins the room immediatelly''' 
    742743                if gajim.interface.msg_win_mgr.has_window(room_jid, account) and \ 
     
    770771                        return 
    771772                if not gajim.interface.msg_win_mgr.has_window(room_jid, account): 
    772                         self.new_room(room_jid, nick, account
     773                        self.new_room(room_jid, nick, account, is_continued=is_continued
    773774                gc_win = gajim.interface.msg_win_mgr.get_window(room_jid, account) 
    774775                gc_win.set_active_tab(room_jid, account) 
     
    35363537                        mc.user_nick = gajim.nicks[account] 
    35373538 
    3538         def new_room(self, room_jid, nick, account): 
     3539        def new_room(self, room_jid, nick, account, is_continued=False): 
    35393540                # Get target window, create a control, and associate it with the window 
    35403541                contact = gajim.contacts.create_contact(jid = room_jid, name = nick) 
     
    35423543                if not mw: 
    35433544                        mw = gajim.interface.msg_win_mgr.create_window(contact, account, 
    3544                                                                 GroupchatControl.TYPE_ID) 
    3545                 gc_control = GroupchatControl(mw, contact, account) 
     3545                                GroupchatControl.TYPE_ID) 
     3546                gc_control = GroupchatControl(mw, contact, account, 
     3547                        is_continued=is_continued) 
    35463548                mw.new_tab(gc_control) 
    35473549