login

package
v0.0.20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component struct {
	*gtk.Box
	Inner *gtk.Box

	Loading  *loading.PulsatingBar
	Methods  *Methods
	Bottom   *gtk.Box
	Remember *rememberMeBox
	ErrorRev *gtk.Revealer
	LogIn    *gtk.Button
	// contains filtered or unexported fields
}

LoginComponent is the main component in the login page.

func NewComponent

func NewComponent(ctx context.Context, p *Page) *Component

NewComponent creates a new login Component.

func (*Component) HideError

func (c *Component) HideError()

HideError hides the error label.

func (*Component) Login

func (c *Component) Login()

Login presses the Login button.

func (*Component) SetBusy

func (c *Component) SetBusy()

func (*Component) SetDone

func (c *Component) SetDone()

func (*Component) ShowError

func (c *Component) ShowError(err error)

ShowError reveals the error label and shows it to the user.

type FormEntry

type FormEntry struct {
	*gtk.Box
	Label *gtk.Label
	Entry *gtk.Entry
}

FormEntry is a widget containing a label and an entry.

func NewFormEntry

func NewFormEntry(label string) *FormEntry

NewFormEntry creates a new FormEntry.

func (*FormEntry) ConnectActivate

func (e *FormEntry) ConnectActivate(f func())

ConnectActivate connects the activate signal hanlder to the Entry.

func (*FormEntry) FocusNext

func (e *FormEntry) FocusNext()

FocusNext navigates to the next widget.

func (*FormEntry) FocusNextOnActivate

func (e *FormEntry) FocusNextOnActivate()

FocusNextOnActivate binds Enter to navigate to the next widget when it's pressed.

func (*FormEntry) Text

func (e *FormEntry) Text() string

Text gets the value entry.

type LoadingPage

type LoadingPage struct {
	*gtk.Box
	Header *gtk.HeaderBar

	Content struct {
		*gtk.WindowHandle
		Box     *gtk.Box
		Spinner *gtk.Spinner
		Text    *gtk.Label
	}
}

LoadingPage is the busy spinner screen that's shown while the application is trying to log in.

func NewLoadingPage

func NewLoadingPage(ctx context.Context) *LoadingPage

NewLoadingPage creates a new logging in loading screen.

func (*LoadingPage) SetText

func (l *LoadingPage) SetText(text string)

SetText sets the text that's shown underneath the spinner.

type LoginController

type LoginController interface {
	// Hook is called before the state is opened and before Ready is called. It
	// is meant to be called for hooking the handlers.
	Hook(*gtkcord.State)
	// Ready is called once the user has fully logged in. The session given to
	// the controller will have already been opened and have received the Ready
	// event.
	Ready(*gtkcord.State)
	// PromptLogin is called by the login page if the user needs to log in
	// again, either because their credentials are wrong or Discord returns a
	// server error.
	PromptLogin()
}

LoginController is the parent controller that Page controls.

type Methods

type Methods struct {
	*gtk.Notebook
	Email struct {
		*gtk.Box
		Email    *FormEntry
		Password *FormEntry
		TOTP     *FormEntry
	}
	Token struct {
		*gtk.Box
		Token *FormEntry
	}
}

Methods is the notebook containing entries for different login methods.

func NewMethods

func NewMethods(c *Component) *Methods

NewMethods creates a new Methods widget.

func (*Methods) IsEmail

func (m *Methods) IsEmail() bool

func (*Methods) IsToken

func (m *Methods) IsToken() bool

type Page

type Page struct {
	*gtk.Box
	Header *gtk.HeaderBar
	Login  *Component
	// contains filtered or unexported fields
}

Page is the page containing the login forms.

func NewPage

func NewPage(ctx context.Context, ctrl LoginController) *Page

NewPage creates a new Page.

func (*Page) LoadKeyring

func (p *Page) LoadKeyring()

LoadKeyring loads the session from the keyring.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL