mirror of https://github.com/icedream/icecon.git
parent
d38e6e10c0
commit
6d22fbee2b
|
@ -25,7 +25,8 @@ var (
|
|||
kernel32 *syscall.DLL
|
||||
freeConsole *syscall.Proc
|
||||
|
||||
dlg *mainDialog
|
||||
dlg *mainDialog
|
||||
dlgOriginalTitle string
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -59,6 +60,17 @@ func uiNormalize(textRef *string) {
|
|||
*textRef = text
|
||||
}
|
||||
|
||||
func uiUpdateAddress() {
|
||||
if len(dlgOriginalTitle) <= 0 {
|
||||
dlgOriginalTitle = dlg.Title()
|
||||
}
|
||||
if len(addressStr) > 0 {
|
||||
dlg.SetTitle(dlgOriginalTitle + " - " + addressStr)
|
||||
} else {
|
||||
dlg.SetTitle(dlgOriginalTitle)
|
||||
}
|
||||
}
|
||||
|
||||
func runGraphicalUi() (err error) {
|
||||
dlg = new(mainDialog)
|
||||
if err := dlg.init(); err != nil {
|
||||
|
@ -103,6 +115,7 @@ func runGraphicalUi() (err error) {
|
|||
}
|
||||
password = pw
|
||||
dlg.ui.rconOutput.SetText("")
|
||||
uiUpdateAddress()
|
||||
}
|
||||
})
|
||||
if err = dlg.Menu().Actions().Add(connectAction); err != nil {
|
||||
|
@ -130,6 +143,8 @@ func runGraphicalUi() (err error) {
|
|||
// When window is initialized we can let a secondary routine print all
|
||||
// output received
|
||||
dlg.Synchronize(func() {
|
||||
uiUpdateAddress()
|
||||
|
||||
go func() {
|
||||
for {
|
||||
msg, err := receiveRcon()
|
||||
|
|
Loading…
Reference in New Issue