Documentation ¶
Index ¶
- Constants
- func NewAddButton() *gtk.ListBoxRow
- type Controller
- type List
- type Row
- func (r *Row) Activate()
- func (r *Row) Breadcrumb() string
- func (r *Row) ClearMessenger()
- func (r *Row) DisconnectSession()
- func (r *Row) ID() string
- func (r *Row) MessengerSelected(sr *server.ServerRow)
- func (r *Row) Name() rich.LabelStateStorer
- func (r *Row) ParentBreadcrumb() traverse.Breadcrumber
- func (r *Row) ReconnectSession()
- func (r *Row) RemoveSession()
- func (r *Row) Reset()
- func (r *Row) RestoreSession(res cchat.SessionRestorer, k keyring.Session)
- func (r *Row) SetFailed(err error)
- func (r *Row) SetLoading()
- func (r *Row) SetSession(ses cchat.Session)
- func (r *Row) ShowCommander()
- type Servers
- func (s *Servers) Destroy()
- func (s *Servers) IsLoading() bool
- func (s *Servers) Reset()
- func (s *Servers) SelectColumnatedLister(srv *server.ServerRow, lst cchat.Lister)
- func (s *Servers) SetList(slist cchat.Lister)
- func (s *Servers) SetServers(servers []cchat.Server)
- func (s *Servers) UpdateServer(update cchat.ServerUpdate)
- type ServiceController
- type Servicer
- type SessionController
Constants ¶
const ( IconSize = 42 IconName = "face-plain-symbolic" )
const FaceSize = 48 // gtk.ICON_SIZE_DIALOG
const ListWidth = 200
Variables ¶
This section is empty.
Functions ¶
func NewAddButton ¶
func NewAddButton() *gtk.ListBoxRow
Types ¶
type Controller ¶
type Controller interface { Servicer // OnSessionDisconnect is called before a session is disconnected. This // function is used for cleanups. OnSessionDisconnect(*Row) // SessionSelected is called when the row is clicked. The parent container // should change the views to show this session's *Servers. SessionSelected(*Row) // ClearMessenger is called when a nil slice of servers is set. ClearMessenger(*Row) // MessengerSelected is called when a server that can display messages (aka // implements Messenger) is called. MessengerSelected(*Row, *server.ServerRow) // RestoreSession is called with the session ID to ask the controller to // restore it from keyring information. RestoreSession(*Row, string) // ID string, async // RemoveSession is called to ask the controller to remove the session from // the list of sessions. RemoveSession(*Row) // MoveSession is called to ask the controller to move the session to // somewhere else in the list of sessions. MoveSession(id, movingID string) }
Controller extends server.Controller to add session parameters.
type List ¶
func NewList ¶
func NewList(svcctrl ServiceController) *List
func (*List) AddSessionRow ¶
AddSessionRow adds the given row as a session into the list.
func (*List) MoveSession ¶
MoveSession moves sessions around. This function must not touch the add button.
func (*List) RemoveSessionRow ¶
func (*List) Session ¶
Session returns the session row with the given ID. A nil Row is returned if none is found.
func (*List) UnselectAll ¶
func (sl *List) UnselectAll()
type Row ¶
type Row struct { *gtk.ListBoxRow Session cchat.Session // state; nilable Servers *Servers // accessed by View for the right view ActionsMenu *actions.Menu // session.* // contains filtered or unexported fields }
Row represents a session row entry in the session List.
func New ¶
func New(parent traverse.Breadcrumber, ses cchat.Session, ctrl Controller) *Row
func NewLoading ¶
func NewLoading(parent traverse.Breadcrumber, id, name string, ctrl Controller) *Row
func (*Row) Activate ¶
func (r *Row) Activate()
Activate executes whatever needs to be done. If the row has failed, then this method will reconnect. If the row is already loaded, then SessionSelected will be called.
func (*Row) Breadcrumb ¶
func (*Row) ClearMessenger ¶
func (r *Row) ClearMessenger()
func (*Row) DisconnectSession ¶
func (r *Row) DisconnectSession()
DisconnectSession disconnects the current session. It does nothing if the row does not have a session active.
func (*Row) MessengerSelected ¶
func (*Row) Name ¶
func (r *Row) Name() rich.LabelStateStorer
Name returns the session row's name container.
func (*Row) ParentBreadcrumb ¶
func (r *Row) ParentBreadcrumb() traverse.Breadcrumber
func (*Row) ReconnectSession ¶
func (r *Row) ReconnectSession()
ReconnectSession tries to reconnect with the keyring data. This is a slow method but it's also a very cold path.
func (*Row) RemoveSession ¶
func (r *Row) RemoveSession()
RemoveSession removes itself from the session list.
func (*Row) Reset ¶
func (r *Row) Reset()
Reset extends the server row's Reset function and resets additional states. It resets all states back to nil, but the session ID stays.
func (*Row) RestoreSession ¶
func (r *Row) RestoreSession(res cchat.SessionRestorer, k keyring.Session)
func (*Row) SetFailed ¶
SetFailed sets the initial connect status to failed. Do note that session can have 2 types of loading: loading the session and loading the server list. This one sets the former.
func (*Row) SetLoading ¶
func (r *Row) SetLoading()
SetLoading sets the session button to have a spinner circle. DO NOT CONFUSE THIS WITH THE SERVERS LOADING.
func (*Row) SetSession ¶
SetSession binds the session and marks the row as ready. It extends SetDone.
func (*Row) ShowCommander ¶
func (r *Row) ShowCommander()
ShowCommander shows the commander dialog, or it does nothing if session does not implement commander.
type Servers ¶
type Servers struct { gtk.Stack SessionController // Main is the horizontal box containing the current struct's list of // servers columnated with the same level. The second item in the box should // be the selected server. Main *serverpane.Paned // Lister is the current lister belonging to this server. Lister cchat.Lister // Children is main's lhs. Children *server.Children // NextColumn is main's rhs. NextColumn *Servers // nil // contains filtered or unexported fields }
Servers wraps around a list of servers inherited from Children to display a Lister in its own box instead of as a nested list. It's the container that's displayed on the right of the service sidebar.
func NewServers ¶
func NewServers(p traverse.Breadcrumber, ctrl SessionController) *Servers
NewServers creates a new Servers instance that holds only the given column number and its children. Any servers with a different columnate ID will be in the children pane.
func (*Servers) Destroy ¶
func (s *Servers) Destroy()
Destroy destroys and invalidates this instance permanently.
func (*Servers) SelectColumnatedLister ¶
SelectColumnatedLister is called by children servers to open up a server list on the right.
func (*Servers) SetList ¶
SetList indicates that the server list has been loaded. Unlike server.Children, this method will load immediately.
func (*Servers) SetServers ¶
SetServers is reserved for cchat.ServersContainer.
func (*Servers) UpdateServer ¶
func (s *Servers) UpdateServer(update cchat.ServerUpdate)
SetServers is reserved for cchat.ServersContainer.
type ServiceController ¶
type ServiceController interface { SessionSelected(*Row) AuthenticateSession() }
type SessionController ¶
SessionController extends server.Controller to add needed methods that the specific top-level servers container needs.
Directories ¶
Path | Synopsis |
---|---|
traverse
Package traverse implements an extensible interface that allows children widgets to announce state changes to their parent container.
|
Package traverse implements an extensible interface that allows children widgets to announce state changes to their parent container. |