Enlightenment CVS committal Author : titan Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_widget_fsel.c Log Message: Now you can add your own locations to the favorites list! =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_widget_fsel.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -3 -r1.24 -r1.25 --- e_widget_fsel.c 27 Aug 2006 04:08:22 -0000 1.24 +++ e_widget_fsel.c 27 Aug 2006 06:10:57 -0000 1.25 @@ -25,6 +25,7 @@ Evas_Object *o_up_button; Evas_Object *o_favorites_frame; Evas_Object *o_favorites_fm; + Evas_Object *o_favorites_add; Evas_Object *o_files_frame; Evas_Object *o_files_fm; Evas_Object *o_entry; @@ -64,6 +65,34 @@ } static void +_e_wid_fsel_favorites_add(void *data1, void *data2) +{ + E_Widget_Data *wd; + const char *current_path; + char dest_path[PATH_MAX]; + struct stat st; + int i = 1; + + wd = data1; + current_path = e_fm2_real_path_get(wd->o_files_fm); + snprintf(dest_path, PATH_MAX, "%s/.e/e/fileman/favorites/%s", + getenv("HOME"), basename(current_path)); + if (stat(dest_path, &st) < 0) symlink(current_path, dest_path); + else + { + while(stat(dest_path, &st) == 0) + { + snprintf(dest_path, PATH_MAX, "%s/.e/e/fileman/favorites/%s-%d", + getenv("HOME"), + basename(current_path), i); + i = i+1; + } + symlink(current_path, dest_path); + } + e_fm2_refresh(wd->o_favorites_fm); +} + +static void _e_wid_fsel_favorites_files_changed(void *data, Evas_Object *obj, void *event_info) { E_Widget_Data *wd; @@ -226,6 +255,12 @@ wd->o_table2 = o; e_widget_sub_object_add(obj, o); + o = e_widget_button_add(evas, _("Add Current to Favorites"), "widget/add_fav", + _e_wid_fsel_favorites_add, wd, NULL); + wd->o_favorites_add = o; + e_widget_sub_object_add(obj, o); + e_widget_table_object_append(wd->o_table2, o, 0, 0, 1, 1, 0, 0, 1, 0); + o = e_widget_button_add(evas, _("Go up a Directory"), "widget/up_dir", _e_wid_fsel_button_up, wd, NULL); wd->o_up_button = o; @@ -418,7 +453,8 @@ e_widget_min_size_get(wd->o_table, &mw, &mh); e_widget_min_size_set(obj, mw, mh); - + + evas_object_show(wd->o_favorites_add); evas_object_show(wd->o_up_button); evas_object_show(wd->o_favorites_frame); evas_object_show(wd->o_favorites_fm); ------------------------------------------------------------------------- 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