summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjsuya <jsuya.choi@samsung.com>2018-11-29 10:43:29 +0200
committerDaniel Zaoui <daniel.zaoui@yahoo.com>2018-11-29 10:45:42 +0200
commit562a5e02d4cbe8fe08db952a48901537376ca6dd (patch)
tree06d54fa4e2388caad1387accc5c4b294e5af86a1
parent733648e3a7cf92cadd2de36482e7d94f3292eb52 (diff)
GUI: Add feature that only successful cases are created
Summary: Sometimes, there are cases what shot is failed. This case has a problem with the ML or the code. The user do not need this case, so we add logic to re-generate automatically. Test Plan: N/A Reviewers: JackDanielZ Reviewed By: JackDanielZ Subscribers: myoungwoon, akanad, bowonryu, YOhoho Differential Revision: https://phab.enlightenment.org/D7383
-rw-r--r--src/bin/gui.c41
1 files changed, 34 insertions, 7 deletions
diff --git a/src/bin/gui.c b/src/bin/gui.c
index 3b8fbc6..e1d3b22 100644
--- a/src/bin/gui.c
+++ b/src/bin/gui.c
@@ -193,14 +193,18 @@ static double _panel_size, _panel_last_size = 0.0;
193static Eo *_scn_gl = NULL; 193static Eo *_scn_gl = NULL;
194static _App_Data *_current_ad = NULL; 194static _App_Data *_current_ad = NULL;
195static Eina_List *_scn_btn_list = NULL; 195static Eina_List *_scn_btn_list = NULL;
196static Eina_Bool _b_only_success;
196 197
198// Function declaration -----
197static Eo* _content_tab_add(Eo *parent, char *style, int height, Eina_Bool is_horiz); 199static Eo* _content_tab_add(Eo *parent, char *style, int height, Eina_Bool is_horiz);
198static Eina_Bool _content_tab_item_init(const char *file, _File_Type type, void *data); 200static Eina_Bool _content_tab_item_init(const char *file, _File_Type type, void *data);
199static Eina_Bool _content_tab_preview_init(const char *file, _File_Type type, void *data); 201static Eina_Bool _content_tab_preview_init(const char *file, _File_Type type, void *data);
200static void _content_tab_content_display(Elm_Object_Item *it); 202static void _content_tab_content_display(Elm_Object_Item *it);
201static void _content_scroller_nocontent_set(const char *text); 203static void _content_scroller_nocontent_set(const char *text);
202
203static Eo *_spacer_add(Eo *parent, int height); 204static Eo *_spacer_add(Eo *parent, int height);
205static void _app_gen(Eina_Bool one_app);
206static void _app_discard(void *data, Evas_Object *menu EINA_UNUSED, void *item EINA_UNUSED);
207// Function declaration -----
204 208
205static Eo * 209static Eo *
206_box_create(Eo *parent, Eina_Bool horiz, Eo **wref) 210_box_create(Eo *parent, Eina_Bool horiz, Eo **wref)
@@ -1066,7 +1070,12 @@ static void
1066_async_app_ready(void *data) 1070_async_app_ready(void *data)
1067{ 1071{
1068 _App_Data *ad = data; 1072 _App_Data *ad = data;
1069 if (!ad->is_deleted) elm_gengrid_item_update(ad->item); 1073 if (!ad->is_deleted && ad->item) elm_gengrid_item_update(ad->item);
1074 if (_b_only_success && (ad->error && !ad->is_deleted))
1075 {
1076 _app_discard(data, NULL, NULL);
1077 _app_gen(EINA_TRUE);
1078 }
1070 _apps_building_cur_nb--; 1079 _apps_building_cur_nb--;
1071 _apps_building_consume(); 1080 _apps_building_consume();
1072} 1081}
@@ -1904,15 +1913,20 @@ _thread_ml_gen(void *data EINA_UNUSED, Eina_Thread t EINA_UNUSED)
1904} 1913}
1905 1914
1906static void 1915static void
1907_app_gen(void) 1916_app_gen(Eina_Bool one_app)
1908{ 1917{
1909 char buf[256]; 1918 char buf[256];
1910 static int last_year = 0, last_mon, last_mday, last_hour, last_min; 1919 static int last_year = 0, last_mon, last_mday, last_hour, last_min;
1911 static unsigned int _version = 0; 1920 static unsigned int _version = 0;
1912 time_t tm = time(NULL); 1921 time_t tm = time(NULL);
1913 struct tm *t = localtime(&tm); 1922 struct tm *t = localtime(&tm);
1914 const char *nb_text = elm_entry_entry_get(_nb_apps_en); 1923 long nb = 1, nb_apps = 0;
1915 long nb = strtol(nb_text, NULL, 10), nb_apps = 0; 1924 if (!one_app && _nb_apps_en)
1925 {
1926 const char *nb_text = elm_entry_entry_get(_nb_apps_en);
1927 if (strcmp(nb_text, ""))
1928 nb = strtol(nb_text, NULL, 10);
1929 }
1916 1930
1917 if (errno == ERANGE) return; 1931 if (errno == ERANGE) return;
1918 1932
@@ -1978,13 +1992,13 @@ _app_panel_init(Eina_Bool open)
1978static void 1992static void
1979_app_gen_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *info EINA_UNUSED) 1993_app_gen_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *info EINA_UNUSED)
1980{ 1994{
1981 _app_gen(); 1995 _app_gen(EINA_FALSE);
1982} 1996}
1983 1997
1984static void 1998static void
1985_panel_app_gen_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *info EINA_UNUSED) 1999_panel_app_gen_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *info EINA_UNUSED)
1986{ 2000{
1987 _app_gen(); 2001 _app_gen(EINA_FALSE);
1988 2002
1989 Eina_Bool chk = elm_check_state_get(_btn_app); 2003 Eina_Bool chk = elm_check_state_get(_btn_app);
1990 if (!chk) 2004 if (!chk)
@@ -3823,6 +3837,12 @@ _test_panel_create(Eo *parent)
3823 return layout; 3837 return layout;
3824} 3838}
3825 3839
3840static void
3841_only_success_app_gen(void *data EINA_UNUSED, const Efl_Event *event)
3842{
3843 _b_only_success = efl_ui_check_selected_get(event->object);
3844}
3845
3826static Eo * 3846static Eo *
3827_db_panel_create(Eo *parent) 3847_db_panel_create(Eo *parent)
3828{ 3848{
@@ -3867,6 +3887,13 @@ _db_panel_create(Eo *parent)
3867 evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, 0); 3887 evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, 0);
3868 efl_pack_end(h_box, entry); 3888 efl_pack_end(h_box, entry);
3869 3889
3890 efl_add(EFL_UI_CHECK_CLASS, box,
3891 efl_text_set(efl_added, "Only success case create"),
3892 efl_gfx_size_hint_weight_set(efl_added, 1, 0),
3893 efl_event_callback_add(efl_added, EFL_UI_CHECK_EVENT_CHANGED, _only_success_app_gen, NULL),
3894 efl_ui_check_selected_set(efl_added, EINA_TRUE),
3895 efl_pack_end(box, efl_added));
3896
3870 efl_pack_end(box, _spacer_add(box, 15)); 3897 efl_pack_end(box, _spacer_add(box, 15));
3871 3898
3872 return box; 3899 return box;