示例#1
0
文件: ui.go 项目: tanujmathur/coyim
// 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
}
示例#2
0
文件: ui.go 项目: 0x27/coyim
// 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),
	}

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

	ret.accountManager = newAccountManager(ret)

	return ret
}
示例#3
0
文件: ui.go 项目: twstrike/coyim
// NewGTK returns a new client for a GTK ui
func NewGTK(version string, sf sessions.Factory, df interfaces.DialerFactory, gx Graphics) UI {
	runtime.LockOSThread()
	coyimVersion = version
	g = gx
	initSignals()

	//*.mo files should be in ./i18n/locale_code.utf8/LC_MESSAGES/
	g.glib.InitI18n(localizationDomain, "./i18n")
	g.gtk.Init(argsWithApplicationName())
	ensureInstalled()

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

	var err error
	flags := glibi.APPLICATION_FLAGS_NONE
	if *config.MultiFlag {
		flags = glibi.APPLICATION_NON_UNIQUE
	}
	ret.app, err = g.gtk.ApplicationNew(applicationID, flags)
	if err != nil {
		panic(err)
	}

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

	ret.accountManager = newAccountManager(ret)

	ret.sessionFactory = sf

	ret.settings = settings.For("")

	return ret
}