当前位置: 首页>>代码示例>>Python>>正文


Python qt4ui.Utils类代码示例

本文整理汇总了Python中gui.qt4ui.Utils的典型用法代码示例。如果您正苦于以下问题:Python Utils类的具体用法?Python Utils怎么用?Python Utils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Utils类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: send_message

 def send_message(self, formatter, my_account,
                  text, cedict, cedir, first):
     '''This method is called from the core, when a message is sent by us.
     It shows the message'''
     self._append_to_chat('<b>ME:</b>')
     self._append_to_chat(Utils.parse_emotes(Utils.escape(unicode(text))))
     self._append_to_chat('<br/>')
开发者ID:EchoUSB,项目名称:emesene,代码行数:7,代码来源:ChatOutput.py

示例2: _format_contact_display_role

def _format_contact_display_role(text):
    """Formats correctly a string part of a display role. Parses emotes, and
    scales them."""
    # TODO: calculate smiley size from text's size.
    smiley_size = 16
    text = Utils.escape(text)
    text = replace_markup(text)
    text = Utils.parse_emotes(unicode(text))
    text = text.replace("<img src", '<img width="%d" height="%d" src' % (smiley_size, smiley_size))
    return text
开发者ID:EchoUSB,项目名称:emesene,代码行数:10,代码来源:ContactListDelegate.py

示例3: update_single_information

 def update_single_information(self, nick, message, account):  # emesene's
     """This method is called from the core (e3 or base class or whatever
     to update the contacts infos"""
     # account is a string containing the email
     # does this have to update the picture too?
     log.debug("UPSingInfo Start")
     status = self._session.contacts.get(account).status
     log.debug("UpSingInfo: [%s], [%s], [%s], [%s]" % (status, nick, message, account))
     self._widget_d["info_panel"].set_all(status, Utils.unescape(nick), Utils.unescape(message), account)
     log.debug("UPSingInfo Stop")
开发者ID:Roger,项目名称:emesene,代码行数:10,代码来源:Conversation.py

示例4: update

 def update(self, status, display_name, message, account):
     '''Updates the infos shown in the panel'''
     pixmap          = QtGui.QPixmap(gui.theme.status_icons[status])
     #display_name    = Utils.escape(display_name)
     display_name    = Utils.parse_emotes(unicode(display_name + 
                                              u'&nbsp;&nbsp;&nbsp;&nbsp;' \
                                              u'[' + account + u']'))
     #message         = Utils.escape(message)
     message         = Utils.parse_emotes(unicode(message))
     
     self._emblem_lbl.setPixmap(pixmap)
     self._display_name_lbl.setText(display_name)
     self._message_lbl.setText(message)
开发者ID:EchoUSB,项目名称:emesene,代码行数:13,代码来源:UserInfoPanel.py

示例5: receive_message

 def receive_message(self, formatter, contact, 
                     message, cedict, cedir, first):
     '''This method is called from the core (e3 or base class or whatever
     when a new message arrives. It shows the new message'''
     log.debug('%s, %s, %s, %s, %s, %s' % (formatter,contact, 
                                           message.type, message.account, 
                                           cedict, first) )
     
     self._append_to_chat(
             Utils.parse_emotes(u'<b>' + contact.display_name + u':</b>'))
     self._append_to_chat(
             Utils.parse_emotes(Utils.escape(unicode(message.body))),
             message.style)
     self._append_to_chat('<br>')
开发者ID:19MiRkO91,项目名称:emesene,代码行数:14,代码来源:ChatOutput.py

示例6: set_text

 def set_text(self, text):
     '''Displays the given text'''
     #NOTE: do we have to set also the QLineEdit's text?
     #<-> method could be called while the QLEdit is active?
     self._text = unicode(text)
     text = Utils.escape(unicode(text))
     parsed_text = Utils.parse_emotes(text)
     text = QtCore.QString(text)
     if not text.isEmpty():
         self._is_empty_message_displayed = False
         self.label.setText(parsed_text)
     elif self._allow_empty:
         self._is_empty_message_displayed = True
         self.label.setText(self._empty_message)
开发者ID:AmiZya,项目名称:emesene,代码行数:14,代码来源:NickEdit.py

示例7: _set_contact_info

    def _set_contact_info(self, contact_item, contact):
        '''Fills the contact Item with data'''
        display_name = Utils.escape(unicode(contact.display_name))
        message = Utils.escape(unicode(contact.message))
        sort_role = self.sort_role_dict[contact.status] + display_name

        contact_item.setData(display_name, Role.DisplayRole)
        contact_item.setData(message, Role.MessageRole)
        contact_item.setData(contact.picture, Role.DecorationRole)
        contact_item.setData(contact.media, Role.MediaRole)
        contact_item.setData(contact.status, Role.StatusRole)
        contact_item.setData(contact.blocked, Role.BlockedRole)
        contact_item.setData(contact.account, Role.ToolTipRole)
        contact_item.setData(sort_role, Role.SortRole)
        contact_item.setData(contact, Role.DataRole)
开发者ID:RealDoll,项目名称:emesene,代码行数:15,代码来源:ContactListModel.py

示例8: clear

 def clear(self, source="", target="", target_display="", source_img="", target_img=""):
     """clear the content"""
     body = self.theme.get_body(source, target, target_display, source_img, target_img)
     url = QtCore.QUrl(Utils.path_to_url(self.theme.path))
     self._qwebview.setHtml(body, url)
     gui.base.OutputText.clear(self)
     self.ready = False
开发者ID:hoangduit,项目名称:emesene,代码行数:7,代码来源:AdiumChatOutput.py

示例9: set_from_file

    def set_from_file(self, filename, blocked=False):
        self.filename = filename
        self.blocked = blocked
        if filename and not os.path.exists(filename):
            if self._size.width() > 32:
                # use big fallback image
                self.filename = gui.theme.image_theme.user_def_imagetool
            else:
                self.filename = gui.theme.image_theme.user
        pic_handler = PictureHandler.PictureHandler(self.filename)
        if pic_handler.can_handle():
            pixmap = QtGui.QPixmap(self.filename)
            if pixmap.isNull():
                pixmap = QtGui.QPixmap(gui.theme.image_theme.user)

            pixmap = Utils.pixmap_rounder(pixmap.scaled(self._size,
                                        transformMode=Qt.SmoothTransformation))
            if self.crossfade:
                self._fader.add_pixmap(pixmap)
            else:
                self.setPixmap(pixmap)
        else:
            self._movie = QtGui.QMovie(self.filename)
            self._movie.setScaledSize(self._size)
            if self.crossfade:
                self._fader.add_pixmap(self._movie)
            else:
                self.setMovie(self._movie)

        if self.blocked:
            #FIXME: implement
            pass
        self._last = self.filename
开发者ID:AmiZya,项目名称:emesene,代码行数:33,代码来源:DisplayPic.py

示例10: _set_contact_info

    def _set_contact_info(self, contact_item, contact):
        """Fills the contact Item with data"""
        # TODO: handle moving contact between groups
        # in particular: online/offiline
        display_name = Utils.escape(unicode(contact.display_name))
        message = Utils.escape(unicode(contact.message))
        sort_role = self.sort_role_dict[contact.status] + display_name

        contact_item.setData(display_name, Role.DisplayRole)
        contact_item.setData(message, Role.MessageRole)
        contact_item.setData(contact.picture, Role.DecorationRole)
        contact_item.setData(contact.media, Role.MediaRole)
        contact_item.setData(contact.status, Role.StatusRole)
        contact_item.setData(contact.blocked, Role.BlockedRole)
        contact_item.setData(contact.account, Role.ToolTipRole)
        contact_item.setData(sort_role, Role.SortRole)
        contact_item.setData(contact, Role.DataRole)
开发者ID:Roger,项目名称:emesene,代码行数:17,代码来源:ContactListModel.py

示例11: _rescale_picture

 def _rescale_picture(self, picture, filename):
     if isinstance(picture, QtGui.QMovie):
         return picture.setScaledSize(self._size)
     else:
         pixmap = QtGui.QPixmap(filename)
         if not pixmap.isNull():
             pixmap = Utils.pixmap_rounder(pixmap.scaled(self._size,
                                 transformMode=Qt.SmoothTransformation))
         return pixmap
开发者ID:RealDoll,项目名称:emesene,代码行数:9,代码来源:Avatar.py

示例12: add_group

 def add_group(self, group):
     """Add a group."""
     if not self._config.b_order_by_group:
         return
     new_group_item = QtGui.QStandardItem(Utils.escape(unicode(group.name)))
     new_group_item.setData(group.identifier, Role.UidRole)
     new_group_item.setData(0, Role.TotalCountRole)
     new_group_item.setData(0, Role.OnlCountRole)
     new_group_item.setData(group, Role.DataRole)
     self.appendRow(new_group_item)
开发者ID:Roger,项目名称:emesene,代码行数:10,代码来源:ContactListModel.py

示例13: _show_record

 def _show_record(self, record):
     '''Appends a record in the view'''
     time_string = time.localtime(float(record.created))
     time_string = time.strftime("%H:%M:%S", time_string)
     html = u'<small>(%s): [<b>%s</b>] : '
     html = html % (time_string, record.name)
     try:
         html = html + '%s</small><br />' % Utils.escape(record.msg.strip())
     except AttributeError as detail:
         html = html + '<small><i>&lt;&lt;message insertion failed [%s:%s]&gt;&gt;</i></small><br>' % (type(record.msg), str(record.msg))
     self._cursor.insertHtml(html)
开发者ID:AmiZya,项目名称:emesene,代码行数:11,代码来源:DebugWindow.py

示例14: add_group

    def add_group(self, group, force=False):
        '''Add a group.'''
        if not (force or self._order_by_group):
            return

        new_group_item = QtGui.QStandardItem(
                    Utils.escape(unicode(group.name)))
        new_group_item.setData(group.identifier, Role.UidRole)
        new_group_item.setData(group, Role.DataRole)
        self.appendRow(new_group_item)
        return new_group_item
开发者ID:RealDoll,项目名称:emesene,代码行数:11,代码来源:ContactListModel.py

示例15: _set_e3_style

    def _set_e3_style(self, e3_style):
        '''Sets the font style, given an e3 style'''
        qt_color =  Utils.e3_color_to_qcolor(e3_style.color)
        qt_font = QtGui.QFont()
        qt_font.setFamily(      e3_style.font   )
        qt_font.setBold(        e3_style.bold   )
        qt_font.setItalic(      e3_style.italic )
        qt_font.setStrikeOut(   e3_style.strike )
        qt_font.setPointSize(   e3_style.size   )

        self._set_qt_color(qt_color)
        self._set_qt_font(qt_font)
开发者ID:Stiveknx,项目名称:emesene,代码行数:12,代码来源:ChatInput.py


注:本文中的gui.qt4ui.Utils类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。