diff options
author | xengineering <me@xengineering.eu> | 2023-05-20 19:19:19 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2023-05-20 19:19:45 +0200 |
commit | 6713c3cc833906802acf3ef89e5ac3dd7f69e128 (patch) | |
tree | d1bb8ff102f4aaeab623c69982098ccc434df81d /limox.go | |
parent | 7b33036f9b4ea4ed91f60481a9eed30b8188167c (diff) | |
download | limox-6713c3cc833906802acf3ef89e5ac3dd7f69e128.tar limox-6713c3cc833906802acf3ef89e5ac3dd7f69e128.tar.zst limox-6713c3cc833906802acf3ef89e5ac3dd7f69e128.zip |
Add persistence for last used JID
Diffstat (limited to 'limox.go')
-rw-r--r-- | limox.go | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -34,7 +34,7 @@ type Limox struct { } func NewLimox() Limox { - return Limox{ + l := Limox{ Window: app.NewWindow( app.Title("LimoX"), app.Size(unit.Dp(400), unit.Dp(600)), @@ -44,6 +44,10 @@ func NewLimox() Limox { XmppConn: make(chan xmpp.Event), State: Disconnected, } + + l.JidEditor.SetText(getLastJid()) + + return l } func (l *Limox) run() error { @@ -77,7 +81,9 @@ func (l *Limox) buttonCallback() { switch l.State { case Disconnected: log.Println("Starting connection establishment ...") - go xmpp.Run(l.XmppConn, l.JidEditor.Text(), l.PwdEditor.Text()) + jid := l.JidEditor.Text() + setLastJid(jid) + go xmpp.Run(l.XmppConn, jid, l.PwdEditor.Text()) l.State = Connecting case Connecting: log.Println("Aborted connection establishment") |