本文整理汇总了Golang中github.com/twstrike/coyim/roster.Peer类的典型用法代码示例。如果您正苦于以下问题:Golang Peer类的具体用法?Golang Peer怎么用?Golang Peer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Peer类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: createTooltipFor
func createTooltipFor(item *rosters.Peer) string {
pname := html.EscapeString(item.NameForPresentation())
jid := html.EscapeString(item.Jid)
if pname != jid {
return fmt.Sprintf("%s (%s)", pname, jid)
}
return jid
}
示例2: addItem
func (r *roster) addItem(item *rosters.Peer, parentIter *gtk.TreeIter, indent string) {
iter := r.model.Append(parentIter)
setAll(r.model, iter,
item.Jid,
fmt.Sprintf("%s %s", indent, item.NameForPresentation()),
item.BelongsTo,
decideColorFor(item),
"#ffffff",
nil,
createTooltipFor(item),
)
r.model.SetValue(iter, indexRowType, "peer")
r.model.SetValue(iter, indexStatusIcon, statusIcons[decideStatusFor(item)].getPixbuf())
}
示例3: addItem
func (r *roster) addItem(item *rosters.Peer, parentIter gtki.TreeIter, indent string) {
cs := r.ui.currentColorSet()
iter := r.model.Append(parentIter)
setAll(r.model, iter,
item.Jid,
fmt.Sprintf("%s %s", indent, item.NameForPresentation()),
item.BelongsTo,
decideColorFor(cs, item),
cs.rosterPeerBackground,
nil,
createTooltipFor(item),
)
r.model.SetValue(iter, indexRowType, "peer")
r.model.SetValue(iter, indexStatusIcon, statusIcons[decideStatusFor(item)].getPixbuf())
}
示例4: addItem
func (r *roster) addItem(item *rosters.Peer, parentIter gtki.TreeIter, indent string) {
cs := r.ui.currentColorSet()
iter := r.model.Append(parentIter)
potentialExtra := ""
if item.Asked {
potentialExtra = i18n.Local(" (waiting for approval)")
}
setAll(r.model, iter,
item.Jid,
fmt.Sprintf("%s %s%s", indent, item.NameForPresentation(), potentialExtra),
item.BelongsTo,
decideColorFor(cs, item),
cs.rosterPeerBackground,
nil,
createTooltipFor(item),
)
r.model.SetValue(iter, indexRowType, "peer")
r.model.SetValue(iter, indexStatusIcon, statusIcons[decideStatusFor(item)].getPixbuf())
}