Enlightenment CVS committal Author : raster Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_border.c e_config.c e_config.h e_int_config_wallpaper_import.c e_widget_fsel.c e_widget_fsel.h Log Message: allw filechooser to be remembered (give it its own name/class so it can be unique) and have the import dialog rememebr its last dir. =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_border.c,v retrieving revision 1.524 retrieving revision 1.525 diff -u -3 -r1.524 -r1.525 --- e_border.c 13 Aug 2006 03:37:23 -0000 1.524 +++ e_border.c 14 Aug 2006 11:08:40 -0000 1.525 @@ -5651,7 +5651,10 @@ /* Recreate state */ e_hints_window_init(bd); - if (bd->client.e.state.centered) + if ((bd->client.e.state.centered) && + ((!bd->remember) || + ((bd->remember) && + (!(bd->remember->apply & E_REMEMBER_APPLY_POS))))) { bd->x = bd->zone->x + (bd->zone->w - bd->w) / 2; bd->y = bd->zone->y + (bd->zone->h - bd->h) / 2; =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_config.c,v retrieving revision 1.188 retrieving revision 1.189 diff -u -3 -r1.188 -r1.189 --- e_config.c 12 Aug 2006 13:25:29 -0000 1.188 +++ e_config.c 14 Aug 2006 11:08:40 -0000 1.189 @@ -470,6 +470,9 @@ E_CONFIG_VAL(D, T, border_raise_on_mouse_action, INT); E_CONFIG_VAL(D, T, border_raise_on_focus, INT); E_CONFIG_VAL(D, T, desk_flip_wrap, INT); + + E_CONFIG_VAL(D, T, wallpaper_import_last_dev, STR); + E_CONFIG_VAL(D, T, wallpaper_import_last_path, STR); e_config = e_config_domain_load("e", _e_config_edd); if (e_config) @@ -1160,6 +1163,13 @@ e_config->border_raise_on_mouse_action = 1; e_config->border_raise_on_focus = 1; e_config->desk_flip_wrap = 0; + e_config->wallpaper_import_last_dev = NULL; + e_config->wallpaper_import_last_path = NULL; + IFCFGEND; + + IFCFG(0x0096); /* the version # where this value(s) was introduced */ + e_config->wallpaper_import_last_dev = evas_stringshare_add("~/"); + e_config->wallpaper_import_last_path = evas_stringshare_add("/"); IFCFGEND; #if 0 /* example of new config */ =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_config.h,v retrieving revision 1.104 retrieving revision 1.105 diff -u -3 -r1.104 -r1.105 --- e_config.h 10 Aug 2006 14:43:24 -0000 1.104 +++ e_config.h 14 Aug 2006 11:08:40 -0000 1.105 @@ -233,6 +233,9 @@ int border_raise_on_mouse_action; // GUI int border_raise_on_focus; // GUI int desk_flip_wrap; // GUI + + char *wallpaper_import_last_dev; // INTERNAL + char *wallpaper_import_last_path; // INTERNAL }; struct _E_Config_Module =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_wallpaper_import.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- e_int_config_wallpaper_import.c 13 Aug 2006 10:00:49 -0000 1.9 +++ e_int_config_wallpaper_import.c 14 Aug 2006 11:08:40 -0000 1.10 @@ -49,7 +49,9 @@ static Ecore_Event_Handler *_import_edje_cc_exit_handler = NULL; static void _import_opt_disabled_set(Import *import, int disabled); +static void _import_cb_sel_selected(void *data, Evas_Object *obj); static void _import_cb_sel_change(void *data, Evas_Object *obj); +static void _import_path_save(Import *import); static void _import_edj_gen(Import *import); static int _import_cb_edje_cc_exit(void *data, int type, void *event); static void _import_cb_delete(E_Win *win); @@ -59,9 +61,6 @@ static void _import_cb_wid_on_focus(void *data, Evas_Object *obj); static void _import_cb_key_down(void *data, Evas *e, Evas_Object *obj, void *event); -/* FIXME: save previous dev/dir and restore it to browse that dir */ -/* FIXME: rememebr size and maybe location? */ - EAPI E_Win * e_int_config_wallpaper_import(E_Config_Dialog *parent) { @@ -73,6 +72,7 @@ Evas_Coord w, h; E_Config_Dialog_Data *cfdata; Evas_Modifier_Mask mask; + char *fdev, *fpath; import = E_NEW(Import, 1); if (!import) return NULL; @@ -98,7 +98,7 @@ e_win_delete_callback_set(win, _import_cb_delete); e_win_resize_callback_set(win, _import_cb_resize); e_win_dialog_set(win, 1); - e_win_name_class_set(win, "E", "_dialog"); + e_win_name_class_set(win, "E", "_wallpaper_import_dialog"); o = edje_object_add(evas); import->bg_obj = o; @@ -129,8 +129,15 @@ o = e_widget_list_add(evas, 0, 0); import->content_obj = o; - ofm = e_widget_fsel_add(evas, "~/", "/", NULL, NULL, - _import_cb_sel_change, import, + fdev = e_config->wallpaper_import_last_dev; + fpath = e_config->wallpaper_import_last_path; + if ((!fdev) && (!fpath)) + { + fdev = "~/"; + fpath = "/"; + } + ofm = e_widget_fsel_add(evas, fdev, fpath, NULL, NULL, + _import_cb_sel_selected, import, _import_cb_sel_change, import, 0 ); import->fsel_obj = ofm; @@ -207,6 +214,7 @@ Import *import; import = win->data; + _import_path_save(import); if (import->exe_handler) ecore_event_handler_del(import->exe_handler); import->exe_handler = NULL; if (import->tmpf) unlink(import->tmpf); @@ -232,6 +240,15 @@ } static void +_import_cb_sel_selected(void *data, Evas_Object *obj) +{ + Import *import; + + import = data; + _import_cb_ok(import->win, NULL); +} + +static void _import_cb_sel_change(void *data, Evas_Object *obj) { Import *import; @@ -248,6 +265,24 @@ _import_opt_disabled_set(import, 0); } +static void +_import_path_save(Import *import) +{ + const char *fdev = NULL, *fpath = NULL; + + e_widget_fsel_path_get(import->fsel_obj, &fdev, &fpath); + if ((fdev) || (fpath)) + { + if (e_config->wallpaper_import_last_dev) evas_stringshare_del(e_config->wallpaper_import_last_dev); + if (fdev) e_config->wallpaper_import_last_dev = (char *)evas_stringshare_add(fdev); + else e_config->wallpaper_import_last_dev = NULL; + if (e_config->wallpaper_import_last_path) evas_stringshare_del(e_config->wallpaper_import_last_path); + if (fpath) e_config->wallpaper_import_last_path = (char *)evas_stringshare_add(fpath); + else e_config->wallpaper_import_last_path = NULL; + e_config_save_queue(); + } +} + static void _import_edj_gen(Import *import) { @@ -291,7 +326,7 @@ f = fopen(tmpn, "w"); if (!f) { - printf("Cannot open %s for writting\n", tmpn); + printf("Cannot open %s for writing\n", tmpn); return; } =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_widget_fsel.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- e_widget_fsel.c 13 Aug 2006 21:58:55 -0000 1.10 +++ e_widget_fsel.c 14 Aug 2006 11:08:40 -0000 1.11 @@ -189,9 +189,6 @@ } /* externally accessible functions */ -/* FIXME: callback only exists for double-clicking and selecting. need to add - * one for when the selection changes as well - */ EAPI Evas_Object * e_widget_fsel_add(Evas *evas, char *dev, char *path, char *selected, char *filter, void (*sel_func) (void *data, Evas_Object *obj), void *sel_data, @@ -430,6 +427,26 @@ return obj; } +EAPI void +e_widget_fsel_path_get(Evas_Object *obj, const char **dev, const char **path) +{ + E_Widget_Data *wd; + + if (!obj) return; + wd = e_widget_data_get(obj); + return e_fm2_path_get(wd->o_files_fm, dev, path); +} + +EAPI const char * +e_widget_fsel_selection_path_get(Evas_Object *obj) +{ + E_Widget_Data *wd; + + if (!obj) return NULL; + wd = e_widget_data_get(obj); + return wd->path; +} + static void _e_wid_fsel_preview_file(E_Widget_Data *wd) { @@ -452,16 +469,6 @@ free(owner); free(perms); free(time); -} - -EAPI const char * -e_widget_fsel_selection_path_get(Evas_Object *obj) -{ - E_Widget_Data *wd; - - if (!obj) return NULL; - wd = e_widget_data_get(obj); - return wd->path; } static char * =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_widget_fsel.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- e_widget_fsel.h 13 Aug 2006 02:49:54 -0000 1.3 +++ e_widget_fsel.h 14 Aug 2006 11:08:40 -0000 1.4 @@ -10,6 +10,7 @@ void (*sel_func) (void *data, Evas_Object *obj), void *sel_data, void (*chg_func) (void *data, Evas_Object *obj), void *chg_data, int preview); EAPI const char *e_widget_fsel_selection_path_get(Evas_Object *obj); +EAPI void e_widget_fsel_path_get(Evas_Object *obj, const char **dev, const char **path); #endif #endif ------------------------------------------------------------------------- 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