summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2013-02-04 10:45:51 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2013-02-04 10:45:51 +0000
commitd1be1fc8bb591b1f9eb330342523436552a95e26 (patch)
treeef75e1c4d89222c6de634364ec009a98e75da497
parent43d18ff1559ccbee73a7780033b602169c7f99b2 (diff)
add profile types to config so it will be possible to determine what type of config the user started with
SVN revision: 83588
-rw-r--r--config/default/e.src1
-rw-r--r--config/mobile/e.src1
-rw-r--r--config/standard/e.src1
-rw-r--r--src/bin/e_config.c12
-rw-r--r--src/bin/e_config.h11
5 files changed, 25 insertions, 1 deletions
diff --git a/config/default/e.src b/config/default/e.src
index 705c2e919..25c86fea9 100644
--- a/config/default/e.src
+++ b/config/default/e.src
@@ -1,5 +1,6 @@
1group "E_Config" struct { 1group "E_Config" struct {
2 value "config_version" int: 1000000; 2 value "config_version" int: 1000000;
3 value "config_type" uint: 0; // this profile seems to just be super minimalist
3 value "show_splash" int: 0; 4 value "show_splash" int: 0;
4 value "init_default_theme" string: "default.edj"; 5 value "init_default_theme" string: "default.edj";
5 value "desktop_default_name" string: "%i-%i"; 6 value "desktop_default_name" string: "%i-%i";
diff --git a/config/mobile/e.src b/config/mobile/e.src
index 4b864245e..ca90b7ab1 100644
--- a/config/mobile/e.src
+++ b/config/mobile/e.src
@@ -1,5 +1,6 @@
1group "E_Config" struct { 1group "E_Config" struct {
2 value "config_version" int: 1000000; 2 value "config_version" int: 1000000;
3 value "config_type" uint: 1;
3 value "show_splash" int: 1; 4 value "show_splash" int: 1;
4 value "init_default_theme" string: "default.edj"; 5 value "init_default_theme" string: "default.edj";
5 value "desktop_default_name" string: "%i-%i"; 6 value "desktop_default_name" string: "%i-%i";
diff --git a/config/standard/e.src b/config/standard/e.src
index 961d1c2d2..8a178982d 100644
--- a/config/standard/e.src
+++ b/config/standard/e.src
@@ -1,5 +1,6 @@
1group "E_Config" struct { 1group "E_Config" struct {
2 value "config_version" int: 1000000; 2 value "config_version" int: 1000000;
3 value "config_type" uint: 3;
3 value "show_splash" int: 1; 4 value "show_splash" int: 1;
4 value "init_default_theme" string: "default.edj"; 5 value "init_default_theme" string: "default.edj";
5 value "desktop_default_name" string: "%i-%i"; 6 value "desktop_default_name" string: "%i-%i";
diff --git a/src/bin/e_config.c b/src/bin/e_config.c
index 0545aaea6..099853956 100644
--- a/src/bin/e_config.c
+++ b/src/bin/e_config.c
@@ -521,6 +521,7 @@ _e_config_edd_init(Eina_Bool old)
521#define D _e_config_edd 521#define D _e_config_edd
522 /**/ /* == already configurable via ipc */ 522 /**/ /* == already configurable via ipc */
523 E_CONFIG_VAL(D, T, config_version, INT); /**/ 523 E_CONFIG_VAL(D, T, config_version, INT); /**/
524 E_CONFIG_VAL(D, T, config_type, UINT); /**/
524 E_CONFIG_VAL(D, T, show_splash, INT); /**/ 525 E_CONFIG_VAL(D, T, show_splash, INT); /**/
525 E_CONFIG_VAL(D, T, init_default_theme, STR); /**/ 526 E_CONFIG_VAL(D, T, init_default_theme, STR); /**/
526 E_CONFIG_VAL(D, T, desktop_default_background, STR); /**/ 527 E_CONFIG_VAL(D, T, desktop_default_background, STR); /**/
@@ -1208,6 +1209,17 @@ e_config_load(void)
1208#undef SET 1209#undef SET
1209 e_config_domain_save("e_bindings", _e_config_binding_edd, e_bindings); 1210 e_config_domain_save("e_bindings", _e_config_binding_edd, e_bindings);
1210 } 1211 }
1212 CONFIG_VERSION_CHECK(8)
1213 {
1214 if (!e_config->config_type)
1215 {
1216 /* I guess this probably isn't great, but whatever */
1217 if (eina_list_count(e_bindings->key_bindings) > 2)
1218 e_config->config_type = E_CONFIG_PROFILE_TYPE_DESKTOP;
1219 else
1220 e_config->config_type = E_CONFIG_PROFILE_TYPE_TABLET;
1221 }
1222 }
1211 } 1223 }
1212 if (!e_config->remember_internal_fm_windows) 1224 if (!e_config->remember_internal_fm_windows)
1213 e_config->remember_internal_fm_windows = !!(e_config->remember_internal_windows & E_REMEMBER_INTERNAL_FM_WINS); 1225 e_config->remember_internal_fm_windows = !!(e_config->remember_internal_windows & E_REMEMBER_INTERNAL_FM_WINS);
diff --git a/src/bin/e_config.h b/src/bin/e_config.h
index 30a6d3df4..7afaeb37b 100644
--- a/src/bin/e_config.h
+++ b/src/bin/e_config.h
@@ -29,6 +29,14 @@ typedef struct _E_Event_Config_Icon_Theme E_Event_Config_Icon_Theme;
29 29
30typedef struct E_Config_Bindings E_Config_Bindings; 30typedef struct E_Config_Bindings E_Config_Bindings;
31 31
32typedef enum
33{
34 E_CONFIG_PROFILE_TYPE_NONE,
35 E_CONFIG_PROFILE_TYPE_MOBILE,
36 E_CONFIG_PROFILE_TYPE_TABLET,
37 E_CONFIG_PROFILE_TYPE_DESKTOP
38} E_Config_Profile_Type;
39
32#else 40#else
33#ifndef E_CONFIG_H 41#ifndef E_CONFIG_H
34#define E_CONFIG_H 42#define E_CONFIG_H
@@ -40,7 +48,7 @@ typedef struct E_Config_Bindings E_Config_Bindings;
40/* increment this whenever a new set of config values are added but the users 48/* increment this whenever a new set of config values are added but the users
41 * config doesn't need to be wiped - simply new values need to be put in 49 * config doesn't need to be wiped - simply new values need to be put in
42 */ 50 */
43#define E_CONFIG_FILE_GENERATION 7 51#define E_CONFIG_FILE_GENERATION 8
44#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH * 1000000) + E_CONFIG_FILE_GENERATION) 52#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH * 1000000) + E_CONFIG_FILE_GENERATION)
45 53
46#define E_CONFIG_BINDINGS_VERSION 0 // DO NOT INCREMENT UNLESS YOU WANT TO WIPE ALL BINDINGS!!!!! 54#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;
48struct _E_Config 56struct _E_Config
49{ 57{
50 int config_version; // INTERNAL 58 int config_version; // INTERNAL
59 E_Config_Profile_Type config_type; // INTERNAL
51 int show_splash; // GUI 60 int show_splash; // GUI
52 const char *init_default_theme; // GUI 61 const char *init_default_theme; // GUI
53 const char *desktop_default_background; // GUI 62 const char *desktop_default_background; // GUI