Enlightenment CVS committal Author : essiene Project : e17 Module : proto
Dir : e17/proto/entrance_edit_gui/src/gui Modified Files: Egui.h background.c egui.c egui_graphics_dialog.c egui_graphics_dialog.h theme.c Log Message: The previews in background and themes settings screen are now more meaningfull. The show a live combo of your choices... YAY! One more TODO is slain. Alas, this introduces a subtle bug that only shows up if you have both settings screen open at once. =================================================================== RCS file: /cvs/e/e17/proto/entrance_edit_gui/src/gui/Egui.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -3 -r1.15 -r1.16 --- Egui.h 6 Nov 2006 15:14:24 -0000 1.15 +++ Egui.h 7 Nov 2006 21:10:34 -0000 1.16 @@ -27,4 +27,7 @@ void egui_save_checkbox(void *w, const char *key, int ktype); void egui_save_list(void *w, const char *key, int ktype); +char* egui_get_current_bg(void); +char* egui_get_current_theme(void); + #endif =================================================================== RCS file: /cvs/e/e17/proto/entrance_edit_gui/src/gui/background.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- background.c 6 Nov 2006 15:14:24 -0000 1.13 +++ background.c 7 Nov 2006 21:10:34 -0000 1.14 @@ -33,7 +33,8 @@ "Backgrounds", ENTRANCE_EDIT_KEY_CLIENT_BACKGROUND_STR, 1, - 0 + 0, + EGDS_THEME }; static Egui_Graphics_Dialog egd = NULL; =================================================================== RCS file: /cvs/e/e17/proto/entrance_edit_gui/src/gui/egui.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- egui.c 6 Nov 2006 09:57:53 -0000 1.1 +++ egui.c 7 Nov 2006 21:10:34 -0000 1.2 @@ -67,3 +67,22 @@ if(ktype == EGUI_TYPE_INT) entrance_edit_int_set(key, ew_checkbox_is_active(w)); } + +char* +egui_get_current_bg(void) +{ + return entrance_edit_string_get(ENTRANCE_EDIT_KEY_CLIENT_BACKGROUND_STR); +} + +char* +egui_get_current_theme(void) +{ + char *res = calloc(PATH_MAX, sizeof(*res)); + if(!res) + return NULL; + + char* theme = entrance_edit_string_get(ENTRANCE_EDIT_KEY_CLIENT_THEME_STR); + snprintf(res, PATH_MAX, PREFIX "/share/entrance/themes/%s", theme); + + return res; +} =================================================================== RCS file: /cvs/e/e17/proto/entrance_edit_gui/src/gui/egui_graphics_dialog.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- egui_graphics_dialog.c 6 Nov 2006 15:14:24 -0000 1.4 +++ egui_graphics_dialog.c 7 Nov 2006 21:10:34 -0000 1.5 @@ -177,14 +177,7 @@ } - /*if(egd->egds.use_full_path) - { - char *full_path = _gd_get_path(egd, graphic); - entrance_edit_string_set(egd->egds.entrance_edit_key, full_path); - free(full_path); - } - else */ - entrance_edit_string_set(egd->egds.entrance_edit_key, graphic); + entrance_edit_string_set(egd->egds.entrance_edit_key, graphic); if(!entrance_edit_save()) { @@ -295,22 +288,28 @@ if(evas == NULL || egd->newly_created == 1) evas = ew_preview_evas_get(egd->img_preview, PREVIEW_WIDTH, PREVIEW_HEIGHT, PREVIEW_V_WIDTH, PREVIEW_V_HEIGHT); - /*TODO: currently, i'm just grabbing *file and displaying blindly, which mean, I won't be able to - * preview different background and themes, the below commented code should be filled out to - * pick up the most recently selected combo of bg and theme, and use that instead*/ - - /*char *bg_path = _gd_get_bg_path(); - char *theme_path = _gd_get_theme_path();*/ + char *bg_path = egui_get_current_bg(); + char *theme_path = egui_get_current_theme(); static Evas_Object *es = NULL; if(es == NULL || egd->newly_created == 1) es = es_new(evas); - es_background_edje_set(es, file); - es_main_edje_set(es, file); + if(egd->egds.keep_part == EGDS_BACKGROUND) + es_background_edje_set(es, bg_path); + else + es_background_edje_set(es, file); + + if(egd->egds.keep_part == EGDS_THEME) + es_main_edje_set(es, theme_path); + else + es_main_edje_set(es, file); + evas_object_resize(es, PREVIEW_V_WIDTH, PREVIEW_V_HEIGHT); evas_object_show(es); + free(bg_path); + free(theme_path); free(file); /*FIXME: selecting the first row doesn't work - maybe we select first row while adding elements to the list:(*/ /*ew_list_first_row_select(list_thumbs);*/ =================================================================== RCS file: /cvs/e/e17/proto/entrance_edit_gui/src/gui/egui_graphics_dialog.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- egui_graphics_dialog.h 6 Nov 2006 15:14:24 -0000 1.2 +++ egui_graphics_dialog.h 7 Nov 2006 21:10:34 -0000 1.3 @@ -3,6 +3,9 @@ #include <Ecore_Data.h> +#define EGDS_BACKGROUND 0 +#define EGDS_THEME 1 + typedef struct { char *name; char *files_path; @@ -14,6 +17,7 @@ int use_full_path; int show_pointer_options; + int keep_part; } Egui_Graphics_Dialog_Settings; typedef struct { =================================================================== RCS file: /cvs/e/e17/proto/entrance_edit_gui/src/gui/theme.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- theme.c 6 Nov 2006 15:14:24 -0000 1.13 +++ theme.c 7 Nov 2006 21:10:34 -0000 1.14 @@ -18,7 +18,8 @@ "Themes", ENTRANCE_EDIT_KEY_CLIENT_THEME_STR, 0, - 1 + 1, + EGDS_BACKGROUND }; ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs