On Fri, Nov 30, 2012 at 12:47 PM, Gustavo Lima Chaves
<gl...@profusion.mobi> wrote:
> We have been working on a widget that will aid a lot on the
> implementation of preferences/configuration windows and UI elements in
> Elementary-based applications, and we do think that the code is mature
> enough to be presented to the community now.
>
> Prefs is a widget that populates its view with widgets
> bound to data types (following the instructions of a ".epb" file that
> describes a set of items) and handles the storage/restoration of such
> data on a configuration file automatically.
>
> The ".epb" file is similar to a ".edj" file and is created by a tool
> named "elm_prefs_cc" (based on edje_cc) that receives a ".epc" file as
> input (similar to a ".edc" file).
>
> Here's a excerpt from an epc file:
>
> collection
> {
>    page
>    {
>       name: "main";
>       version: 1;
>       title: "Preferences Widget";
>       subtitle: "Prefs";
>       widget: "elm/vertical_frame";
>
>       items {
>          item {
>             name: "universe";
>             type: INT;
>             label: "Ultimate Answer of Life, the Universe and
>             Everything";
>             editable: 1;
>
>             int {
>                default: 42;
>                min: 0;
>                max: 150;
>             }
>          }
>
>          item {
>             name: "label";
>             type: LABEL;
>             label: "Just a label...";
>          }
>
>          item {
>             name: "text";
>             type: TEXT;
>             editable: 1;
>
>             text {
>                placeholder: "This is a text field (:";
>                default: "default str.";
>                deny: "^[0-9]*$";
>             }
>          }
>
>          item {
>             name: "date";
>             type: DATE;
>             label: "First EFL Developer Day";
>
>             date {
>                default: 2012 11 05;
>                min: 1980 11 1;
>                max: 2200 12 2;
>             }
>          }
>
>          /* ... */
>       }
>    }
> }
>
> As you see, items (think of edc parts) are grouped in pages (think of
> edc groups).
>
> With subpage support, we can already create lots of functional config.
> screens. In the future we could surely extend it to make toolbars,
> lists, etc.
>
> For your convenience, the prefs widget also searches for an
> appropriated “.epb” file in some predefined places and tries to load
> the “main” page if a specific page isn’t provided. The same is valid
> for the file that holds the user configuration.
>
> To help with the understanding of the mechanics of this preferences
> infrastructure, we have done three documented examples and an initial
> reference for the ".epc" file can be found in the docs as well.
>
> We hope that you enjoy this work and provide us your feedback.

Rocks, good work team.

Now that E has support to load elm, we can write some dialogs for e18
using elm_prefs and saving some typing on our side :-)

As a side note, one can use the elm_prefs_data manually even without
the gui part. And the gui part allows swallowing generic objects, then
we can extend it with more complex visuals like in the xrand case.


--
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: barbi...@gmail.com
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
TUNE You got it built. Now make it sing. Tune shows you how.
http://goparallel.sourceforge.net
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to