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