File: first_account.go

package info (click to toggle)
coyim 0.3.7-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,064 kB
  • ctags: 4,528
  • sloc: xml: 5,120; sh: 328; python: 286; makefile: 235; ruby: 51
file content (36 lines) | stat: -rw-r--r-- 744 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package gui

import "github.com/twstrike/gotk3adapter/gtki"

func (u *gtkUI) showFirstAccountWindow() {
	result := make(chan func())
	var cleanup func()

	doInUIThread(func() {
		b := newBuilder("FirstAccountDialog")
		dialog := b.getObj("dialog").(gtki.Dialog)
		dialog.SetTransientFor(u.window)
		cleanup = dialog.Destroy

		b.ConnectSignals(map[string]interface{}{
			"on_import_signal": func() {
				result <- u.runImporter
			},
			"on_register_signal": func() {
				result <- u.showServerSelectionWindow
			},
			"on_existing_signal": func() {
				result <- u.showAddAccountWindow
			},
			"on_cancel_signal": func() {
				result <- func() {}
			},
		})

		dialog.ShowAll()
	})

	tp := <-result
	doInUIThread(cleanup)
	doInUIThread(tp)
}