add profile types to config so it will be possible to determine what type of config the user started with

SVN revision: 83588
This commit is contained in:
Mike Blumenkrantz 2013-02-04 10:45:51 +00:00
parent 43d18ff155
commit d1be1fc8bb
5 changed files with 25 additions and 1 deletions

View File

@ -1,5 +1,6 @@
group "E_Config" struct {
value "config_version" int: 1000000;
value "config_type" uint: 0; // this profile seems to just be super minimalist
value "show_splash" int: 0;
value "init_default_theme" string: "default.edj";
value "desktop_default_name" string: "%i-%i";

View File

@ -1,5 +1,6 @@
group "E_Config" struct {
value "config_version" int: 1000000;
value "config_type" uint: 1;
value "show_splash" int: 1;
value "init_default_theme" string: "default.edj";
value "desktop_default_name" string: "%i-%i";

View File

@ -1,5 +1,6 @@
group "E_Config" struct {
value "config_version" int: 1000000;
value "config_type" uint: 3;
value "show_splash" int: 1;
value "init_default_theme" string: "default.edj";
value "desktop_default_name" string: "%i-%i";

View File

@ -521,6 +521,7 @@ _e_config_edd_init(Eina_Bool old)
#define D _e_config_edd
/**/ /* == already configurable via ipc */
E_CONFIG_VAL(D, T, config_version, INT); /**/
E_CONFIG_VAL(D, T, config_type, UINT); /**/
E_CONFIG_VAL(D, T, show_splash, INT); /**/
E_CONFIG_VAL(D, T, init_default_theme, STR); /**/
E_CONFIG_VAL(D, T, desktop_default_background, STR); /**/
@ -1208,6 +1209,17 @@ e_config_load(void)
#undef SET
e_config_domain_save("e_bindings", _e_config_binding_edd, e_bindings);
}
CONFIG_VERSION_CHECK(8)
{
if (!e_config->config_type)
{
/* I guess this probably isn't great, but whatever */
if (eina_list_count(e_bindings->key_bindings) > 2)
e_config->config_type = E_CONFIG_PROFILE_TYPE_DESKTOP;
else
e_config->config_type = E_CONFIG_PROFILE_TYPE_TABLET;
}
}
}
if (!e_config->remember_internal_fm_windows)
e_config->remember_internal_fm_windows = !!(e_config->remember_internal_windows & E_REMEMBER_INTERNAL_FM_WINS);

View File

@ -29,6 +29,14 @@ typedef struct _E_Event_Config_Icon_Theme E_Event_Config_Icon_Theme;
typedef struct E_Config_Bindings E_Config_Bindings;
typedef enum
{
E_CONFIG_PROFILE_TYPE_NONE,
E_CONFIG_PROFILE_TYPE_MOBILE,
E_CONFIG_PROFILE_TYPE_TABLET,
E_CONFIG_PROFILE_TYPE_DESKTOP
} E_Config_Profile_Type;
#else
#ifndef E_CONFIG_H
#define E_CONFIG_H
@ -40,7 +48,7 @@ typedef struct E_Config_Bindings E_Config_Bindings;
/* increment this whenever a new set of config values are added but the users
* config doesn't need to be wiped - simply new values need to be put in
*/
#define E_CONFIG_FILE_GENERATION 7
#define E_CONFIG_FILE_GENERATION 8
#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH * 1000000) + E_CONFIG_FILE_GENERATION)
#define E_CONFIG_BINDINGS_VERSION 0 // DO NOT INCREMENT UNLESS YOU WANT TO WIPE ALL BINDINGS!!!!!
@ -48,6 +56,7 @@ typedef struct E_Config_Bindings E_Config_Bindings;
struct _E_Config
{
int config_version; // INTERNAL
E_Config_Profile_Type config_type; // INTERNAL
int show_splash; // GUI
const char *init_default_theme; // GUI
const char *desktop_default_background; // GUI