First "sort by server name" implementation and button name fix.

First implementation of "Sort by server name" algo. Shitty, kinda
unreliable, but better than GTK's default.

Added Colorizer.Clear() func, which clears passed data from
colorcodes.

Fixed name on "Add to favorites" button.

Still cannot be successfully launched until some race conditions
will be fixed in go-gtk.
This commit is contained in:
2016-11-22 09:48:19 +05:00
parent 4d466a9d2b
commit 0c0fcd5b24
3 changed files with 69 additions and 7 deletions

View File

@@ -21,8 +21,28 @@ type Colorizer struct {
colors map[string]string
}
func (c *Colorizer) Clear(data string) string {
var result string = ""
data = html.EscapeString(data)
data_splitted := strings.Split(data, "^")
if len(data_splitted) > 1 {
for item := range data_splitted {
if len(data_splitted[item]) > 0 {
result += data_splitted[item]
}
}
} else {
result = data_splitted[0]
}
return result
}
func (c *Colorizer) Fix(data string) string {
result := ""
var result string = ""
data = html.EscapeString(data)