示例#1
0
    def message(self, messageobj):
        if not self.inited:
            self.inited = True
            theme, variant = pref('appearance.conversations.theme'), pref('appearance.conversations.variant')
            buddy = messageobj.buddy

            # initialize the message area, not showing history
            self.message_area.init_content(get_theme_safe(theme, variant),
                                           buddy.name, buddy, show_history = False)
                                           #prevent_align_to_bottom=True) # disable until all skins look correct with this option

        self.message_area.format_message(messageobj.type, messageobj)
示例#2
0
    def setcontent(*a):
        convo_panel.Freeze()
        sz.Clear(True)
        
        theme = pref(CONVO_THEME_PREF)
        themeName = pref('appearance.conversations.theme')
        theme     = get_theme_safe(themeName, pref('appearance.conversations.variant'))
        log.info('showing message style %r', themeName)

        pref_panel.msgarea = msgarea = build_example_message_area(convo_panel, theme)
        sz.Add(msgarea, 1, EXPAND)
        sz.Layout()

        parent._thawtimer = CallLater(150, lambda: convo_panel.Thaw())
        return msgarea
示例#3
0
    def theme(self):
        theme, variant = pref('appearance.conversations.theme'), pref('appearance.conversations.variant')
        key = '%s__%s' % (theme, variant)

        cls = ImWinPanel


        try:
            if cls.__msgthemename == key:
                return cls.__messagetheme
        except AttributeError:
            pass

        t = cls.__messagetheme = get_theme_safe(theme, variant)
        cls.__msgthemename = key
        return t
示例#4
0
    def setcontent(*a):
        convo_panel.Freeze()
        sz.Clear(True)

        theme = pref(CONVO_THEME_PREF)
        themeName = pref('appearance.conversations.theme')
        theme = get_theme_safe(themeName,
                               pref('appearance.conversations.variant'))
        log.info('showing message style %r', themeName)

        pref_panel.msgarea = msgarea = build_example_message_area(
            convo_panel, theme)
        sz.Add(msgarea, 1, EXPAND)
        sz.Layout()

        parent._thawtimer = CallLater(150, lambda: convo_panel.Thaw())
        return msgarea
示例#5
0
    def test_unicode_paths(self):
        '''
        ensure that the example conversation loads correctly
        '''

        f = wx.Frame(None)

        theme = get_theme_safe('Smooth Operator', None)
        from gui.pref.pg_appearance import build_example_message_area

        a = build_example_message_area(f, theme)
        html = a.HTML
        f.Destroy()

        from common import profile
        username = profile.username

        print 'username is', username
        assert username in html, 'username %r was not in HTML:\n%r' % (
            username, html)
示例#6
0
    def test_unicode_paths(self):
        '''
        ensure that the example conversation loads correctly
        '''

        f = wx.Frame(None)
        
        theme = get_theme_safe('Smooth Operator', None)
        from gui.pref.pg_appearance import build_example_message_area

        a = build_example_message_area(f, theme)
        html = a.HTML
        f.Destroy()

        
        from common import profile
        username = profile.username

        print 'username is', username
        assert username in html, 'username %r was not in HTML:\n%r' % (username, html)