func (account *account) appendMenuTo(submenu gtki.Menu) { if account.menu != nil { account.destroyMenu() } account.buildAccountSubmenu() account.menu.Show() submenu.Append(account.menu) }
func (u *gtkUI) buildStaticAccountsMenu(submenu gtki.Menu) { connectAutomaticallyItem, _ := g.gtk.CheckMenuItemNewWithMnemonic(i18n.Local("Connect On _Startup")) u.config.WhenLoaded(func(a *config.ApplicationConfig) { connectAutomaticallyItem.SetActive(a.ConnectAutomatically) }) connectAutomaticallyItem.Connect("activate", func() { u.setConnectAllAutomatically(connectAutomaticallyItem.GetActive()) }) submenu.Append(connectAutomaticallyItem) connectAllMenu, _ := g.gtk.MenuItemNewWithMnemonic(i18n.Local("_Connect All")) connectAllMenu.Connect("activate", func() { u.connectAllAutomatics(true) }) submenu.Append(connectAllMenu) sep2, _ := g.gtk.SeparatorMenuItemNew() submenu.Append(sep2) addAccMenu, _ := g.gtk.MenuItemNewWithMnemonic(i18n.Local("_Add...")) addAccMenu.Connect("activate", u.showAddAccountWindow) submenu.Append(addAccMenu) importMenu, _ := g.gtk.MenuItemNewWithMnemonic(i18n.Local("_Import...")) importMenu.Connect("activate", u.runImporter) submenu.Append(importMenu) registerAccMenu, _ := g.gtk.MenuItemNewWithMnemonic(i18n.Local("_Register...")) registerAccMenu.Connect("activate", u.showServerSelectionWindow) submenu.Append(registerAccMenu) }