godock: github.com/sqp/godock/libs/cdapplet/action Index | Files

package action

import "github.com/sqp/godock/libs/cdapplet/action"

Package action provides actions management for applets.


Package Files


type Actions Uses

type Actions struct {
    Max     int // Maximum number of concurrent actions (simultaneous).
    Current int // Current number of active actions.
    // contains filtered or unexported fields

Actions manages applet internal actions list.

func (*Actions) Add Uses

func (o *Actions) Add(acts ...*cdtype.Action)

Add adds actions to the list.

func (*Actions) BuildMenu Uses

func (o *Actions) BuildMenu(menu cdtype.Menuer, actionIds []int)

BuildMenu fills the menu with the given actions list.

func (*Actions) Callback Uses

func (o *Actions) Callback(ID int) func()

Callback returns a callback to the given action ID.

func (*Actions) CallbackInt Uses

func (o *Actions) CallbackInt(ID int) func(int)

CallbackInt returns a callback to the given action ID.

func (*Actions) CallbackMenu Uses

func (o *Actions) CallbackMenu(actionIds ...int) func(menu cdtype.Menuer)

CallbackMenu provides a fill menu callback with the given actions list.

func (*Actions) Count Uses

func (o *Actions) Count() int

Count returns the number of started actions.

func (*Actions) ID Uses

func (o *Actions) ID(name string) int

ID finds the ID matching given action name.

func (*Actions) Launch Uses

func (o *Actions) Launch(ID int)

Launch starts the desired action by ID.

func (*Actions) Len Uses

func (o *Actions) Len() int

Len returns the number of actions defined.

func (*Actions) SetBool Uses

func (o *Actions) SetBool(ID int, boolPointer *bool)

SetBool sets the pointer to the boolean value for a checkentry menu field.

func (*Actions) SetIndicators Uses

func (o *Actions) SetIndicators(onStart, onStop func())

SetIndicators set the pre and post action callbacks.

func (*Actions) SetMax Uses

func (o *Actions) SetMax(max int)

SetMax sets the maximum number of actions that can be started at the same time.

Package action imports 1 packages (graph) and is imported by 1 packages. Updated 2017-11-29. Refresh now. Tools for package owners.