FmConfig

FmConfig — Configuration file support for applications that use libfm.

Synopsis

#define             FM_CONFIG_DEFAULT_BACKUP_HIDDEN
#define             FM_CONFIG_DEFAULT_BIG_ICON_SIZE
#define             FM_CONFIG_DEFAULT_CONFIRM_DEL
#define             FM_CONFIG_DEFAULT_FORCE_S_NOTIFY
#define             FM_CONFIG_DEFAULT_NO_EXPAND_EMPTY
#define             FM_CONFIG_DEFAULT_NO_USB_TRASH
#define             FM_CONFIG_DEFAULT_PANE_ICON_SIZE
#define             FM_CONFIG_DEFAULT_SHOW_THUMBNAIL
#define             FM_CONFIG_DEFAULT_SINGLE_CLICK
#define             FM_CONFIG_DEFAULT_SMALL_ICON_SIZE
#define             FM_CONFIG_DEFAULT_THUMBNAIL_LOCAL
#define             FM_CONFIG_DEFAULT_THUMBNAIL_MAX
#define             FM_CONFIG_DEFAULT_THUMBNAIL_SIZE
#define             FM_CONFIG_DEFAULT_USE_TRASH
#define             FM_CONFIG_TYPE
struct              FmConfig;
struct              FmConfigClass;
extern FmConfig*    fm_config;
void                fm_config_emit_changed              (FmConfig *cfg,
                                                         const char *changed_key);
void                fm_config_load_from_file            (FmConfig *cfg,
                                                         const char *name);
void                fm_config_load_from_key_file        (FmConfig *cfg,
                                                         GKeyFile *kf);
FmConfig *          fm_config_new                       (void);
void                fm_config_save                      (FmConfig *cfg,
                                                         const char *name);

Object Hierarchy

  GObject
   +----FmConfig

Signals

  "changed"                                        : Has Details

Description

include: libfm/fm-config.h

The FmConfig represents basic configuration options that are used by libfm classes and methods. Methods of class FmConfig allow use either default file (~/.config/libfm/libfm.conf) or another one to load the configuration and to save it.

Details

FM_CONFIG_DEFAULT_BACKUP_HIDDEN

#define     FM_CONFIG_DEFAULT_BACKUP_HIDDEN     TRUE

FM_CONFIG_DEFAULT_BIG_ICON_SIZE

#define     FM_CONFIG_DEFAULT_BIG_ICON_SIZE     48

FM_CONFIG_DEFAULT_CONFIRM_DEL

#define     FM_CONFIG_DEFAULT_CONFIRM_DEL       TRUE

FM_CONFIG_DEFAULT_FORCE_S_NOTIFY

#define     FM_CONFIG_DEFAULT_FORCE_S_NOTIFY    TRUE

FM_CONFIG_DEFAULT_NO_EXPAND_EMPTY

#define     FM_CONFIG_DEFAULT_NO_EXPAND_EMPTY   FALSE

FM_CONFIG_DEFAULT_NO_USB_TRASH

#define     FM_CONFIG_DEFAULT_NO_USB_TRASH      TRUE

FM_CONFIG_DEFAULT_PANE_ICON_SIZE

#define     FM_CONFIG_DEFAULT_PANE_ICON_SIZE    16

FM_CONFIG_DEFAULT_SHOW_THUMBNAIL

#define     FM_CONFIG_DEFAULT_SHOW_THUMBNAIL    TRUE

FM_CONFIG_DEFAULT_SINGLE_CLICK

#define     FM_CONFIG_DEFAULT_SINGLE_CLICK      FALSE

FM_CONFIG_DEFAULT_SMALL_ICON_SIZE

#define     FM_CONFIG_DEFAULT_SMALL_ICON_SIZE   16

FM_CONFIG_DEFAULT_THUMBNAIL_LOCAL

#define     FM_CONFIG_DEFAULT_THUMBNAIL_LOCAL   TRUE

FM_CONFIG_DEFAULT_THUMBNAIL_MAX

#define     FM_CONFIG_DEFAULT_THUMBNAIL_MAX     2048

FM_CONFIG_DEFAULT_THUMBNAIL_SIZE

#define     FM_CONFIG_DEFAULT_THUMBNAIL_SIZE    128

FM_CONFIG_DEFAULT_USE_TRASH

#define     FM_CONFIG_DEFAULT_USE_TRASH         TRUE

FM_CONFIG_TYPE

#define FM_CONFIG_TYPE              (fm_config_get_type())

struct FmConfig

struct FmConfig {
    gboolean single_click;
    gboolean use_trash;
    gboolean confirm_del;

    gint big_icon_size;
    gint small_icon_size;
    gint pane_icon_size;
    gint thumbnail_size;

    gboolean show_thumbnail;
    gboolean thumbnail_local;
    gint thumbnail_max;

    gboolean show_internal_volumes;

    char* terminal;
    gboolean si_unit;

    char* archiver;
    gboolean advanced_mode;
};

gboolean single_click;

single click to open file

gboolean use_trash;

delete file to trash can

gboolean confirm_del;

ask before deleting files

gint big_icon_size;

size of big icons

gint small_icon_size;

size of small icons

gint pane_icon_size;

size of side pane icons

gint thumbnail_size;

size of thumbnail icons

gboolean show_thumbnail;

show thumbnails

gboolean thumbnail_local;

show thumbnails for local files only

gint thumbnail_max;

show thumbnails for files smaller than 'thumb_max' KB

gboolean show_internal_volumes;

show system internal volumes in side pane. (udisks-only)

char *terminal;

command line to launch terminal emulator

gboolean si_unit;

use SI prefix for file sizes

char *archiver;

desktop_id of the archiver used

gboolean advanced_mode;

enable advanced features for experienced user

struct FmConfigClass

struct FmConfigClass {
    GObjectClass parent_class;
    void (*changed)(FmConfig* cfg);
};

GObjectClass parent_class;

the parent class

changed ()

the class closure for the "changed" signal

fm_config

extern FmConfig* fm_config;

fm_config_emit_changed ()

void                fm_config_emit_changed              (FmConfig *cfg,
                                                         const char *changed_key);

Causes the "changed" signal to be emitted.

cfg :

pointer to configuration

changed_key :

what was changed

Since 0.1.0


fm_config_load_from_file ()

void                fm_config_load_from_file            (FmConfig *cfg,
                                                         const char *name);

Fills configuration cfg with data from configuration file. The file name may be NULL to load default configuration file. If name is full path then that file will be loaded. Otherwise name will be searched in system config directories and after that in ~/.config/ directory and all found files will be loaded, overwriting existing data in cfg.

See also: fm_config_load_from_key_file()

cfg :

pointer to configuration

name :

file name to load configuration. [allow-none]

Since 0.1.0


fm_config_load_from_key_file ()

void                fm_config_load_from_key_file        (FmConfig *cfg,
                                                         GKeyFile *kf);

Fills configuration cfg with data from GKeyFile kf.

cfg :

pointer to configuration

kf :

a GKeyFile with configuration keys and values

Since 0.1.0


fm_config_new ()

FmConfig *          fm_config_new                       (void);

Creates a new configuration structure filled with default values.

Returns :

a new FmConfig object.

Since 0.1.0


fm_config_save ()

void                fm_config_save                      (FmConfig *cfg,
                                                         const char *name);

Saves configuration into configuration file name. If name is NULL then configuration will be saved into default configuration file. Otherwise it will be saved into file name under directory ~/.config.

cfg :

pointer to configuration

name :

file name to save configuration. [allow-none]

Since 0.1.0

Signal Details

The "changed" signal

void                user_function                      (FmConfig *config,
                                                        gpointer  user_data)      : Has Details

The "changed" signal is emitted when a config key is changed.

config :

configuration that was changed

user_data :

user data set when the signal handler was connected.

Since 0.1.0