Compare commits
No commits in common. "master" and "1" have entirely different histories.
1 changed files with 123 additions and 145 deletions
|
|
@ -55,9 +55,10 @@ func (t *Threenis) Mumble(server string, username string, password string, chann
|
|||
}
|
||||
|
||||
func Ui() {
|
||||
threenisApp := app.NewWithID("threenis")
|
||||
window := threenisApp.NewWindow("Threenis")
|
||||
window.Resize(fyne.NewSize(800, 400))
|
||||
myApp := app.New()
|
||||
myWindow := myApp.NewWindow("Threenis")
|
||||
myWindow.Resize(fyne.NewSize(800, 400))
|
||||
myWindow.SetFixedSize(true)
|
||||
|
||||
processes := GetProcessStrings()
|
||||
threenis := Threenis{}
|
||||
|
|
@ -95,19 +96,14 @@ func Ui() {
|
|||
|
||||
serverLabel := widget.NewLabel("Server")
|
||||
server := widget.NewEntry()
|
||||
server.SetText(threenisApp.Preferences().StringWithFallback("server", ""))
|
||||
|
||||
usernameLabel := widget.NewLabel("Username")
|
||||
username := widget.NewEntry()
|
||||
username.SetText(threenisApp.Preferences().StringWithFallback("username", ""))
|
||||
|
||||
passwordLabel := widget.NewLabel("Password")
|
||||
password := widget.NewEntry()
|
||||
password.SetText(threenisApp.Preferences().StringWithFallback("password", ""))
|
||||
|
||||
channelLabel := widget.NewLabel("Channel")
|
||||
channel := widget.NewEntry()
|
||||
channel.SetText(threenisApp.Preferences().StringWithFallback("channel", ""))
|
||||
|
||||
refresh := widget.NewButton("Refresh", func() {
|
||||
processes = GetProcessStrings()
|
||||
|
|
@ -115,31 +111,13 @@ func Ui() {
|
|||
})
|
||||
|
||||
connect := widget.NewButton("Connect", func() {
|
||||
threenisApp.Preferences().SetString("server", server.Text)
|
||||
threenisApp.Preferences().SetString("username", username.Text)
|
||||
threenisApp.Preferences().SetString("password", password.Text)
|
||||
threenisApp.Preferences().SetString("channel", channel.Text)
|
||||
go threenis.Mumble(server.Text, username.Text, password.Text, channel.Text)
|
||||
})
|
||||
|
||||
search := widget.NewEntry()
|
||||
search.OnChanged = func(s string) {
|
||||
procs := GetProcessStrings()
|
||||
processes = make([]string, 0)
|
||||
for _, proc := range procs {
|
||||
if strings.Contains(strings.ToLower(proc), strings.ToLower(s)) {
|
||||
processes = append(processes, proc)
|
||||
}
|
||||
}
|
||||
list.Refresh()
|
||||
}
|
||||
|
||||
content := container.NewBorder(nil, search, nil, nil, list)
|
||||
|
||||
form := container.New(layout.NewFormLayout(), serverLabel, server, usernameLabel, username, passwordLabel, password, channelLabel, channel, refresh, connect)
|
||||
|
||||
grid := container.New(layout.NewGridLayout(2), content, form)
|
||||
grid := container.New(layout.NewGridLayout(2), list, form)
|
||||
|
||||
window.SetContent(grid)
|
||||
window.ShowAndRun()
|
||||
myWindow.SetContent(grid)
|
||||
myWindow.ShowAndRun()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue