גאבור סבו - Gábor Szabó > Padre > Padre::Config

Download:
Padre-0.50.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs

Module Version: 0.50   Source  

NAME ^

Padre::Config - Configuration subsystem for Padre

SYNOPSIS ^

    use Padre::Config;
    [...]
    if ( Padre::Config->main_statusbar ) { [...] }

DESCRIPTION ^

This module not only stores the complete Padre configuration, it also holds the functions for loading and saving the configuration.

The Padre configuration lives in two places:

 - A user-editable text file usually called config.yml

 - A SQlite - database which shouldn't be edited by the
   user.

Generic usage

Every setting is accessed by a method named after it, which is a mutator. ie, it can be used both as a getter and a setter, depending on the number of arguments passed to it.

Different types of settings

Padre needs to store different settings. Those preferences are stored in different places depending on their impact. But Padre::Config allows to access them with a unified api (a mutator). Only their declaration differ in the module.

Here are the various types of settings that Padre::Config can manage:

ADDING CONFIGURATION OPTIONS ^

Add a "setting()" - call to the correct section of this file.

The setting() call initially creates the option and defines some metadata like the type of the option, it's living place and the default value which should be used until the user configures a own value.

COPYRIGHT & LICENSE ^

Copyright 2008-2009 The Padre development team as listed in Padre.pm.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself.