summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2016-03-09 16:55:09 -0800
committerCedric BAIL <cedric@osg.samsung.com>2016-03-09 16:55:49 -0800
commit641c6bc7f6d24ad93c4ab854706f3632ff1d13e9 (patch)
tree0c4a5cb173016e01c1be5ac710a09bd9cf0fb0f8
parentdcfa337b8a4fb942341cba126bbe076775ab2ac6 (diff)
config: add entry to set web backend.
Will switch later to a combobox using eio_model.
-rw-r--r--src/bin/config.c52
1 files changed, 50 insertions, 2 deletions
diff --git a/src/bin/config.c b/src/bin/config.c
index d1e565547..d63bcef15 100644
--- a/src/bin/config.c
+++ b/src/bin/config.c
@@ -101,7 +101,9 @@ static int interactive = 1;
101static const char *theme_set = NULL; 101static const char *theme_set = NULL;
102static const char *finger_size_set = NULL; 102static const char *finger_size_set = NULL;
103static const char *scale_set = NULL; 103static const char *scale_set = NULL;
104static const char *web_backend = NULL;
104static Fonts_Data fndata = {NULL, NULL, NULL, NULL, NULL, NULL, 0.0}; 105static Fonts_Data fndata = {NULL, NULL, NULL, NULL, NULL, NULL, 0.0};
106static Evas_Object *web_backend_entry = NULL;
105 107
106static void 108static void
107_font_styles_list_sel(void *data EINA_UNUSED, 109_font_styles_list_sel(void *data EINA_UNUSED,
@@ -1820,7 +1822,7 @@ static void
1820_status_config_etc(Evas_Object *win, 1822_status_config_etc(Evas_Object *win,
1821 Evas_Object *naviframe) 1823 Evas_Object *naviframe)
1822{ 1824{
1823 Evas_Object *bx, *ck, *sl, *fr, *bx2; 1825 Evas_Object *bx, *ck, *sl, *fr, *bx2, *fr2, *bx3, *en;
1824 1826
1825 bx = elm_box_add(win); 1827 bx = elm_box_add(win);
1826 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0.0); 1828 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0.0);
@@ -1868,6 +1870,29 @@ _status_config_etc(Evas_Object *win,
1868 evas_object_smart_callback_add(sl, "changed", sc_round, NULL); 1870 evas_object_smart_callback_add(sl, "changed", sc_round, NULL);
1869 evas_object_smart_callback_add(sl, "delay,changed", transition_duration_change, NULL); 1871 evas_object_smart_callback_add(sl, "delay,changed", transition_duration_change, NULL);
1870 1872
1873 // Web backend
1874 fr2 = elm_frame_add(bx);
1875 elm_object_text_set(fr2, "Elm_Web backend");
1876 evas_object_size_hint_weight_set(fr2, EVAS_HINT_EXPAND, 0.0);
1877 evas_object_size_hint_align_set(fr2, EVAS_HINT_FILL, 0.5);
1878 elm_box_pack_end(bx, fr2);
1879 evas_object_show(fr2);
1880
1881 bx3 = elm_box_add(fr2);
1882 elm_object_content_set(fr2, bx3);
1883 evas_object_show(bx3);
1884
1885 en = elm_entry_add(win);
1886 elm_entry_editable_set(en, EINA_TRUE);
1887 elm_entry_scrollable_set(en, EINA_FALSE);
1888 elm_object_text_set(en, elm_config_web_backend_get());
1889 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1890 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
1891 evas_object_show(en);
1892 elm_box_pack_end(bx3, en);
1893
1894 web_backend_entry = en;
1895
1871 evas_object_data_set(win, "etc", bx); 1896 evas_object_data_set(win, "etc", bx);
1872 1897
1873 elm_naviframe_item_simple_push(naviframe, bx); 1898 elm_naviframe_item_simple_push(naviframe, bx);
@@ -4012,6 +4037,7 @@ elm_main(int argc,
4012 " -t THEME Set theme to THEME (ELM_THEME spec)\n" 4037 " -t THEME Set theme to THEME (ELM_THEME spec)\n"
4013 " -f SIZE Set finger size to SIZE pixels\n" 4038 " -f SIZE Set finger size to SIZE pixels\n"
4014 " -s SCALE Set scale factor to SCALE\n" 4039 " -s SCALE Set scale factor to SCALE\n"
4040 " -w WEB_BACKEND Set the web backend to be used\n"
4015 ); 4041 );
4016 } 4042 }
4017 else if (!strcmp(argv[i], "-q")) 4043 else if (!strcmp(argv[i], "-q"))
@@ -4037,6 +4063,12 @@ elm_main(int argc,
4037 scale_set = argv[i]; 4063 scale_set = argv[i];
4038 interactive = 0; 4064 interactive = 0;
4039 } 4065 }
4066 else if ((!strcmp(argv[i], "-w")) && (i < argc - 1))
4067 {
4068 i++;
4069 web_backend = argv[i];
4070 interactive = 0;
4071 }
4040 } 4072 }
4041 /* put here any init code specific to this app like parsing args, etc. */ 4073 /* put here any init code specific to this app like parsing args, etc. */
4042 if (!quiet) 4074 if (!quiet)
@@ -4052,7 +4084,8 @@ elm_main(int argc,
4052 { 4084 {
4053 if (theme_set) elm_theme_set(NULL, theme_set); 4085 if (theme_set) elm_theme_set(NULL, theme_set);
4054 if (finger_size_set) elm_config_finger_size_set(atoi(finger_size_set)); 4086 if (finger_size_set) elm_config_finger_size_set(atoi(finger_size_set));
4055 if (scale_set) elm_config_scale_set(atof(scale_set)); 4087 if (scale_set) elm_config_scale_set(atof(scale_set));
4088 if (web_backend) elm_config_web_backend_set(web_backend);
4056 4089
4057 elm_config_all_flush(); 4090 elm_config_all_flush();
4058 4091
@@ -4061,6 +4094,21 @@ elm_main(int argc,
4061 elm_run(); /* and run the program now and handle all events, etc. */ 4094 elm_run(); /* and run the program now and handle all events, etc. */
4062 /* if the mainloop that elm_run() runs exists, we exit the app */ 4095 /* if the mainloop that elm_run() runs exists, we exit the app */
4063 /* exit code */ 4096 /* exit code */
4097
4098 if (interactive)
4099 {
4100 const char *web_backend_set = elm_config_web_backend_get();
4101
4102 web_backend = elm_object_text_get(web_backend_entry);
4103 fprintf(stderr, "[%s] vs [%s]\n", web_backend, web_backend_set);
4104 if (strcmp(web_backend, web_backend_set))
4105 {
4106 elm_config_web_backend_set(web_backend);
4107 fprintf(stderr, "web backend set to : [%s]\n", elm_config_web_backend_get());
4108 elm_config_all_flush();
4109 }
4110 }
4111
4064 return 0; 4112 return 0;
4065} 4113}
4066/* All elementary apps should use this. Put it right after elm_main() */ 4114/* All elementary apps should use this. Put it right after elm_main() */