confown

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: 7 Imported by: 0

Documentation

Overview

Package confown manages the own config of the dock and its GUI

This allows the configuration of the new dock settings.

Index

Constants

View Source
const (
	// GuiFilename is the name of the gui config file in the appdata dir.
	GuiFilename = "rework.conf"

	// GuiGroup is the name displayed in the config for the gui own config page.
	GuiGroup = "GUI Settings"

	// TmpFile is the path to the tempfile for the config tests (used for the diff).
	TmpFile = "cairo-dock-test.conf"
)

Variables

View Source
var Current = ConfigSettings{}

Current is the user own config live settings (what is currently active).

Functions

func Init

func Init(log cdtype.Logger, file string, e error)

Init will try to load the own config data from the file, and create it if missing.

func PathFile

func PathFile() string

PathFile returns the path to the own config's config file.

func SaveFile

func SaveFile(log cdtype.Logger, file, content string) (tofile bool, e error)

SaveFile is the current GUI save call to check whether it can be safely used according to user settings. May move at some point.

Types

type ConfigGUI

type ConfigGUI struct {
	SeparatorWheelChangeDesktop SeparatorWheelType

	OnStartDebug        bool
	OnStartWebMon       bool
	CrashDisplayColored bool
	CrashRecovery       bool

	// TODO have more persons make tests on saving and remove those.
	SaveEditor  string
	SaveEnabled bool

	TmplReport cdtype.Template `default:"report"`
}

ConfigGUI defines the options the user can set about the GUI itself.

type ConfigSettings

type ConfigSettings struct {
	ConfigGUI `group:"GUI Settings"`

	File string `conf:"-"` // File location, not saved.
	// contains filtered or unexported fields
}

ConfigSettings defines new dock options. This GUI config page will often be referred as "own config".

func (*ConfigSettings) Load

func (cs *ConfigSettings) Load() (*ConfigSettings, error)

Load loads the own config settings.

func (*ConfigSettings) ToVirtual

func (cs *ConfigSettings) ToVirtual(file string) bool

ToVirtual returns whether the save is virtual or not (only prints).

type SeparatorWheelType

type SeparatorWheelType int

SeparatorWheelType defines the action when a separator receives a wheel scroll event.

const (
	SeparatorWheelInactive    SeparatorWheelType = iota // Do nothing
	SeparatorWheelChangeRange                           // Change desktop but do not cycle.
	SeparatorWheelChangeLoop                            // Change desktop and cycle between first and last.
)

Actions when a separator receives a wheel scroll event.

Jump to

Keyboard shortcuts

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