confapplets

package
v0.0.0-...-0caaa62 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2017 License: GPL-3.0-or-later Imports: 9 Imported by: 0

Documentation

Overview

Package confapplets provides an applets list selection widget with preview.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfApplet

type ConfApplet struct {
	gtk.Box

	Applets *map[string]datatype.Appleter // List of applets known by the Dock.
	// contains filtered or unexported fields
}

ConfApplet provides an applets list and preview widget. It can be connected to a control menu to allow actions on the modules listed.

func New

func New(control GUIControl, log cdtype.Logger, menu MenuDownloader, mode ListMode) *ConfApplet

New creates a widget to list cairo-dock applets and themes.

func NewLoaded

func NewLoaded(control GUIControl, log cdtype.Logger, menu MenuDownloader, mode ListMode) *ConfApplet

NewLoaded creates a widget to list cairo-dock applets and themes and loads data.

func (*ConfApplet) Clean

func (widget *ConfApplet) Clean()

Clean removes temporary files.

func (*ConfApplet) Clear

func (widget *ConfApplet) Clear()

Clear clears the widget data.

func (*ConfApplet) Load

func (widget *ConfApplet) Load()

Load list of applets in the appletlist.

func (*ConfApplet) OnSelect

func (widget *ConfApplet) OnSelect(pack datatype.Appleter)

OnSelect reacts when a row is selected. Show preview and set menu position.

func (*ConfApplet) Save

func (widget *ConfApplet) Save()

Save enables the selected applet (user clicked the add button).

func (*ConfApplet) Selected

func (widget *ConfApplet) Selected() datatype.Appleter

Selected returns the name of the selected page.

func (*ConfApplet) SetControlInstall

func (widget *ConfApplet) SetControlInstall(ctrl appletlist.ControlInstall)

SetControlInstall forwards the list controler to the menu for updates.

func (*ConfApplet) UpdateModuleState

func (widget *ConfApplet) UpdateModuleState(name string, active bool)

UpdateModuleState updates the state of the given applet, from a dock event.

type GUIControl

type GUIControl interface {
	ListKnownApplets() map[string]datatype.Appleter
	ListDownloadApplets() (map[string]datatype.Appleter, error)
	ListDockThemeLoad() (map[string]datatype.Appleter, error)
	ListDockThemeSave() []datatype.Field
}

GUIControl is the interface to the main GUI and data source.

type ListInterface

type ListInterface interface {
	ListInterfaceBase
	Selected() datatype.Appleter
	Delete(string)
}

ListInterface is the interface to the applets list.

type ListInterfaceBase

type ListInterfaceBase interface {
	gtk.IWidget
	Load(map[string]datatype.Appleter)
	Clear()
}

ListInterfaceBase is the interface to the applets list.

type ListMode

type ListMode int

ListMode defines the ConfApplet widget behaviour.

const (
	ListCanAdd   ListMode = iota // Applets for the add page.
	ListExternal                 // Applets for the download page.
	ListThemes                   // Global dock themes.
)

List widget behaviours.

type MenuDownload struct {
	gtk.Box
	// contains filtered or unexported fields
}

MenuDownload provides install and active switches to control the selected applet.

func NewMenuDownload

func NewMenuDownload(log cdtype.Logger) *MenuDownload

NewMenuDownload creates the menu to control the selected applet.

func (widget *MenuDownload) OnSelect(pack datatype.Appleter)

OnSelect reacts when a row is selected. Set preview data and set installed and active buttons state.

func (widget *MenuDownload) SetActiveState(state bool)

SetActiveState sets the state of the 'active' switch.

func (widget *MenuDownload) SetControlInstall(ctrl appletlist.ControlInstall)

SetControlInstall forwards the list controler to the menu for updates.

func (widget *MenuDownload) SetInstalledState(state bool)

SetInstalledState sets the state of the 'installed' switch.

type MenuDownloader interface {
	OnSelect(datatype.Appleter)
	SetControlInstall(appletlist.ControlInstall)
	SetActiveState(bool)
}

MenuDownloader forwards events to other widgets.

type SelectIconser

type SelectIconser interface {
	SelectIcons(string)
}

SelectIconser defines the optional control item selection.

type UpdateModuleStater

type UpdateModuleStater interface {
	UpdateModuleState(string, bool)
}

UpdateModuleStater defines a widget able to update module state.

Jump to

Keyboard shortcuts

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