Show server name we connected in toolbar's label.

Also updated screenshot to show how it looks like.
This commit is contained in:
Stanislav Nikitin 2016-10-06 17:59:10 +05:00
parent 0214ea7fce
commit 11e3e4edb7
2 changed files with 5 additions and 1 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 KiB

After

Width:  |  Height:  |  Size: 203 KiB

View File

@ -893,8 +893,12 @@ func (m *MainWindow) launchGame() error {
} }
// Hey, we're ok here! :) Launch Urban Terror! // Hey, we're ok here! :) Launch Urban Terror!
// Crear server name from "<markup></markup>" things.
srv_name_for_label := string([]byte(server_name)[8:len(server_name)-9])
fmt.Println(srv_name_for_label)
// Show great coloured label.
m.statusbar.Push(m.statusbar_context_id, "Launching Urban Terror...") m.statusbar.Push(m.statusbar_context_id, "Launching Urban Terror...")
m.toolbar_label.SetMarkup("<markup><span foreground=\"red\" font_weight=\"bold\">Urban Terror is launched with profile </span><span foreground=\"blue\">" + profile[0].Name + "</span> <span foreground=\"red\" font_weight=\"bold\">and connected to </span><span foreground=\"orange\" font_weight=\"bold\">" + srv_address + "</span></markup>") m.toolbar_label.SetMarkup("<markup><span foreground=\"red\" font_weight=\"bold\">Urban Terror is launched with profile </span><span foreground=\"blue\">" + profile[0].Name + "</span> <span foreground=\"red\" font_weight=\"bold\">and connected to </span><span foreground=\"orange\" font_weight=\"bold\">" + srv_name_for_label + "</span></markup>")
m.launch_button.SetSensitive(false) m.launch_button.SetSensitive(false)
// ToDo: handling server passwords. // ToDo: handling server passwords.
ctx.Launcher.Launch(&profile[0], srv_address, "", m.unlockInterface) ctx.Launcher.Launch(&profile[0], srv_address, "", m.unlockInterface)