Example #1
0
import (
	"fmt"
	"log"
	"sync"
	"time"

	"github.com/gotk3/gotk3/gdk"
	"github.com/gotk3/gotk3/glib"
	"github.com/gotk3/gotk3/gtk"
	"github.com/twstrike/coyim/client"
	"github.com/twstrike/coyim/i18n"
	"github.com/twstrike/coyim/ui"
)

var (
	enableWindow, _  = glib.SignalNew("enable")
	disableWindow, _ = glib.SignalNew("disable")
)

type conversationWindow struct {
	to            string
	account       *account
	win           *gtk.Window
	parentWin     *gtk.Window
	history       *gtk.TextView
	scrollHistory *gtk.ScrolledWindow

	notificationArea   *gtk.Box
	securityWarning    *gtk.InfoBar
	fingerprintWarning *gtk.InfoBar
Example #2
0
package gui

import (
	"sync"

	"github.com/gotk3/gotk3/glib"
	"github.com/gotk3/gotk3/gtk"
	"github.com/twstrike/coyim/config"
	"github.com/twstrike/coyim/i18n"
	"github.com/twstrike/coyim/session/access"
)

var (
	// TODO: shouldn't this be specific to the account ID in question?
	accountChangedSignal, _ = glib.SignalNew("coyim-account-changed")
)

func toggleConnectAndDisconnectMenuItems(s access.Session, connect, disconnect *gtk.MenuItem) {
	doInUIThread(func() {
		connect.SetSensitive(s.IsDisconnected())
		disconnect.SetSensitive(!s.IsDisconnected())
	})
}

var accountsLock sync.Mutex

func (u *gtkUI) buildStaticAccountsMenu(submenu *gtk.Menu) {
	connectAutomaticallyItem, _ := gtk.CheckMenuItemNewWithMnemonic(i18n.Local("Connect On _Startup"))
	u.config.WhenLoaded(func(a *config.ApplicationConfig) {
		connectAutomaticallyItem.SetActive(a.ConnectAutomatically)
	})
Example #3
0
func (*RealGlib) SignalNew(s string) (glibi.Signal, error) {
	return wrapSignal(glib.SignalNew(s))
}