Example #1
0
// NewGTK returns a new client for a GTK ui
func NewGTK(version string) UI {
	coyimVersion = version
	//*.mo files should be in ./i18n/locale_code.utf8/LC_MESSAGES/
	glib.InitI18n("coy", "./i18n")
	gtk.Init(argsWithApplicationName())

	ret := &gtkUI{
		commands: make(chan interface{}, 5),
		toggleConnectAllAutomaticallyRequest: make(chan bool, 100),
		setShowAdvancedSettingsRequest:       make(chan bool, 100),
	}

	var err error
	flags := glib.APPLICATION_FLAGS_NONE
	if *config.MultiFlag {
		flags = glib.APPLICATION_NON_UNIQUE
	}
	ret.app, err = gtk.ApplicationNew("im.coy.CoyIM", flags)
	if err != nil {
		panic(err)
	}

	ret.keySupplier = config.CachingKeySupplier(ret.getMasterPassword)

	ret.accountManager = newAccountManager(ret)

	return ret
}
Example #2
0
func (*RealGtk) ApplicationNew(appId string, flags glibi.ApplicationFlags) (gtki.Application, error) {
	return wrapApplication(gtk.ApplicationNew(appId, glib.ApplicationFlags(flags)))
}