Fixed server name putting into status label.

Some server's names (like Turnpike City) was tructating without
preserving Pango markup integrity. This commit fixes it.
This commit is contained in:
Stanislav Nikitin 2016-10-12 22:18:36 +05:00
parent a64c842e19
commit 640020d23f

View File

@ -193,6 +193,9 @@ func (m *MainWindow) launchActually(server_profile *datamodels.Server, user_prof
srv_name_for_label := server_profile.Name
if strings.Contains(server_profile.Name, "markup") {
srv_name_for_label = string([]byte(server_profile.Name)[8:len(server_profile.Name)-9])
} else {
srv_name := ctx.Colorizer.Fix(server_profile.Name)
srv_name_for_label = string([]byte(srv_name)[8:len(srv_name)-9])
}
// Show great coloured label.
ctx.Eventer.LaunchEvent("setToolbarLabelText", map[string]string{"text": "<markup><span foreground=\"red\" font_weight=\"bold\">Urban Terror is launched with profile </span><span foreground=\"blue\">" + user_profile.Name + "</span> <span foreground=\"red\" font_weight=\"bold\">and connected to </span><span foreground=\"orange\" font_weight=\"bold\">" + srv_name_for_label + "</span></markup>"})