change toolbar title
This commit is contained in:
parent
6652d57018
commit
f4ab436993
|
@ -35,6 +35,7 @@ type GrandCentralDispatcher struct {
|
||||||
_ func() `signal:"ClearMessages"`
|
_ func() `signal:"ClearMessages"`
|
||||||
_ func() `signal:"ResetMessagePane"`
|
_ func() `signal:"ResetMessagePane"`
|
||||||
_ func(mID uint) `signal:"Acknowledged"`
|
_ func(mID uint) `signal:"Acknowledged"`
|
||||||
|
_ func(title string) `signal:"SetToolbarTitle"`
|
||||||
|
|
||||||
// profile-area stuff
|
// profile-area stuff
|
||||||
_ func(name, onion, image string) `signal:"UpdateMyProfile"`
|
_ func(name, onion, image string) `signal:"UpdateMyProfile"`
|
||||||
|
@ -115,7 +116,14 @@ func (this *GrandCentralDispatcher) loadMessagesPane(handle string) {
|
||||||
|
|
||||||
if len(handle) == 32 { // LOAD GROUP
|
if len(handle) == 32 { // LOAD GROUP
|
||||||
log.Debugf("LOADING GROUP %s", handle)
|
log.Debugf("LOADING GROUP %s", handle)
|
||||||
tl := the.Peer.GetGroup(handle).GetTimeline()
|
group := the.Peer.GetGroup(handle)
|
||||||
|
tl := group.GetTimeline()
|
||||||
|
nick, _ := group.GetAttribute("nick")
|
||||||
|
if nick == "" {
|
||||||
|
this.SetToolbarTitle(handle)
|
||||||
|
} else {
|
||||||
|
this.SetToolbarTitle(nick)
|
||||||
|
}
|
||||||
log.Debugf("messages: %d", len(tl))
|
log.Debugf("messages: %d", len(tl))
|
||||||
for i := range tl {
|
for i := range tl {
|
||||||
if tl[i].PeerID == the.Peer.GetProfile().Onion {
|
if tl[i].PeerID == the.Peer.GetProfile().Onion {
|
||||||
|
@ -143,6 +151,13 @@ func (this *GrandCentralDispatcher) loadMessagesPane(handle string) {
|
||||||
return
|
return
|
||||||
} // ELSE LOAD CONTACT
|
} // ELSE LOAD CONTACT
|
||||||
|
|
||||||
|
nick, _ := the.Peer.GetProfile().GetAttribute(handle + "_name")
|
||||||
|
if nick == "" {
|
||||||
|
this.SetToolbarTitle(handle)
|
||||||
|
} else {
|
||||||
|
this.SetToolbarTitle(nick)
|
||||||
|
}
|
||||||
|
|
||||||
messages := this.UIState.GetMessages(handle)
|
messages := this.UIState.GetMessages(handle)
|
||||||
for i := range messages {
|
for i := range messages {
|
||||||
from := messages[i].From
|
from := messages[i].From
|
||||||
|
|
|
@ -205,5 +205,9 @@ Item {
|
||||||
popup.visible = true
|
popup.visible = true
|
||||||
anmPopup.restart()
|
anmPopup.restart()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onSetToolbarTitle: function(str) {
|
||||||
|
theStack.title = str
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue