godock: github.com/sqp/godock/libs/dock/confown Index | Files

package confown

import "github.com/sqp/godock/libs/dock/confown"

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

This allows the configuration of the new dock settings.


Package Files



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"


var Current = ConfigSettings{}

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

func Init Uses

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 Uses

func PathFile() string

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

func SaveFile Uses

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.

type ConfigGUI Uses

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 Uses

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 Uses

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

Load loads the own config settings.

func (*ConfigSettings) ToVirtual Uses

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

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

type SeparatorWheelType Uses

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.

Package confown imports 7 packages (graph) and is imported by 8 packages. Updated 2017-10-01. Refresh now. Tools for package owners.