t
This commit is contained in:
+7
-5
@@ -216,11 +216,13 @@ func generateMessageWidget(p stanza.Packet) gtk.Widgetter {
|
|||||||
mlabel.SetSelectable(true)
|
mlabel.SetSelectable(true)
|
||||||
mlabel.SetHAlign(gtk.AlignFill)
|
mlabel.SetHAlign(gtk.AlignFill)
|
||||||
|
|
||||||
mum := MucUser{}
|
/*
|
||||||
ok = m.Get(&mum)
|
mum := MucUser{}
|
||||||
if ok {
|
ok = m.Get(&mum)
|
||||||
mlabel.SetText(fmt.Sprintf("%s%s%s", mum.MucUserItem.JID, loadedLocale["affilChange"], mum.MucUserItem.Affiliation))
|
if ok {
|
||||||
}
|
mlabel.SetText(fmt.Sprintf("%s%s%s", mum.MucUserItem.JID, loadedLocale["affilChange"], mum.MucUserItem.Affiliation))
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
contentBox.Append(mlabel)
|
contentBox.Append(mlabel)
|
||||||
|
|
||||||
|
|||||||
@@ -40,8 +40,10 @@ var connectionIcon *gtk.Image
|
|||||||
var mStatus *gtk.Label
|
var mStatus *gtk.Label
|
||||||
var mIcon *gtk.Image
|
var mIcon *gtk.Image
|
||||||
|
|
||||||
|
/*
|
||||||
var sStatus *gtk.Label
|
var sStatus *gtk.Label
|
||||||
var sIcon *gtk.Image
|
var sIcon *gtk.Image
|
||||||
|
*/
|
||||||
|
|
||||||
var typingStatus *gtk.Label
|
var typingStatus *gtk.Label
|
||||||
|
|
||||||
@@ -381,7 +383,9 @@ func main() {
|
|||||||
|
|
||||||
if ok {
|
if ok {
|
||||||
typed_tab.msgs.Append(b)
|
typed_tab.msgs.Append(b)
|
||||||
scrollToBottomAfterUpdate(scroller)
|
if current == muc {
|
||||||
|
scrollToBottomAfterUpdate(scroller)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
fmt.Println("Got message when the tab does not exist!")
|
fmt.Println("Got message when the tab does not exist!")
|
||||||
}
|
}
|
||||||
@@ -477,29 +481,35 @@ func main() {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
// Throughput
|
// Throughput
|
||||||
|
/*
|
||||||
var oldsize int64
|
var oldsize int64
|
||||||
var newsize int64
|
var newsize int64
|
||||||
|
var diff float64
|
||||||
go func() {
|
go func() {
|
||||||
for {
|
for {
|
||||||
time.Sleep(1 * time.Second)
|
time.Sleep(5 * time.Second)
|
||||||
glib.IdleAdd(func() {
|
|
||||||
stat, err := xmlLog.Stat()
|
stat, err := xmlLog.Stat()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
newsize = stat.Size()
|
newsize = stat.Size()
|
||||||
diff := float64(newsize-oldsize) / 1000
|
diff = float64(newsize-oldsize) / 1000
|
||||||
|
|
||||||
ic := clientAssets["car"]
|
ic := clientAssets["car"]
|
||||||
if diff >= 25 {
|
if diff >= 25 {
|
||||||
ic = clientAssets["car_high"]
|
ic = clientAssets["car_high"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
glib.IdleAdd(func() {
|
||||||
sStatus.SetText(fmt.Sprintf("%.2f%s", diff, loadedLocale["KBPerSecond"]))
|
sStatus.SetText(fmt.Sprintf("%.2f%s", diff, loadedLocale["KBPerSecond"]))
|
||||||
sIcon.SetFromPaintable(ic)
|
sIcon.SetFromPaintable(ic)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
oldsize = newsize
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
*/
|
||||||
|
|
||||||
glib.IdleAdd(func() {
|
glib.IdleAdd(func() {
|
||||||
connectionStatus.SetText(fmt.Sprintf("%s%s", loadedLocale["connectedAs"], JidMustParse(clientroot.Session.BindJid).Bare()))
|
connectionStatus.SetText(fmt.Sprintf("%s%s", loadedLocale["connectedAs"], JidMustParse(clientroot.Session.BindJid).Bare()))
|
||||||
@@ -572,7 +582,7 @@ func main() {
|
|||||||
joinMuc(client, clientroot.Session.BindJid, jid, nick, password)
|
joinMuc(client, clientroot.Session.BindJid, jid, nick, password)
|
||||||
createTab(jid, true, name)
|
createTab(jid, true, name)
|
||||||
glib.IdleAdd(func() {
|
glib.IdleAdd(func() {
|
||||||
b := gtk.NewLabel(jid)
|
b := gtk.NewLabel(name)
|
||||||
gesture1 := gtk.NewGestureClick()
|
gesture1 := gtk.NewGestureClick()
|
||||||
gesture1.SetButton(1)
|
gesture1.SetButton(1)
|
||||||
gesture1.Connect("pressed", func() {
|
gesture1.Connect("pressed", func() {
|
||||||
@@ -810,7 +820,7 @@ func activate(app *gtk.Application) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
createTab(t, true, n)
|
createTab(t, true, n)
|
||||||
b := gtk.NewLabel(t)
|
b := gtk.NewLabel(n)
|
||||||
gesture1 := gtk.NewGestureClick()
|
gesture1 := gtk.NewGestureClick()
|
||||||
gesture1.SetButton(1)
|
gesture1.SetButton(1)
|
||||||
gesture1.Connect("pressed", func() {
|
gesture1.Connect("pressed", func() {
|
||||||
@@ -1089,6 +1099,7 @@ func activate(app *gtk.Application) {
|
|||||||
pBox.Append(pingStatus)
|
pBox.Append(pingStatus)
|
||||||
statBar.Append(pBox)
|
statBar.Append(pBox)
|
||||||
|
|
||||||
|
/*
|
||||||
sBox := gtk.NewBox(gtk.OrientationHorizontal, 0)
|
sBox := gtk.NewBox(gtk.OrientationHorizontal, 0)
|
||||||
sIcon = gtk.NewImageFromPaintable(clientAssets["car"])
|
sIcon = gtk.NewImageFromPaintable(clientAssets["car"])
|
||||||
sIcon.AddCSSClass("icon")
|
sIcon.AddCSSClass("icon")
|
||||||
@@ -1097,6 +1108,7 @@ func activate(app *gtk.Application) {
|
|||||||
sBox.Append(sStatus)
|
sBox.Append(sStatus)
|
||||||
sStatus.SetTooltipText(loadedLocale["throughputTooltip"])
|
sStatus.SetTooltipText(loadedLocale["throughputTooltip"])
|
||||||
statBar.Append(sBox)
|
statBar.Append(sBox)
|
||||||
|
*/
|
||||||
|
|
||||||
scrollerStatBar := gtk.NewScrolledWindow()
|
scrollerStatBar := gtk.NewScrolledWindow()
|
||||||
scrollerStatBar.SetChild(statBar)
|
scrollerStatBar.SetChild(statBar)
|
||||||
@@ -1180,7 +1192,7 @@ func activate(app *gtk.Application) {
|
|||||||
|
|
||||||
err := sendMessage(client, current, message_type, t, "", "", exts)
|
err := sendMessage(client, current, message_type, t, "", "", exts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err) // TODO: Show error message via GTK
|
showErrorDialog(err)
|
||||||
}
|
}
|
||||||
message_en.SetText("")
|
message_en.SetText("")
|
||||||
scrollToBottomAfterUpdate(scroller)
|
scrollToBottomAfterUpdate(scroller)
|
||||||
|
|||||||
Reference in New Issue
Block a user