Enlightenment CVS committal Author : raster Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e.h e_fm_prop.c e_widget_fsel.c Log Message: working on the file properties dialog =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e.h,v retrieving revision 1.52 retrieving revision 1.53 diff -u -3 -r1.52 -r1.53 --- e.h 22 Aug 2006 23:39:08 -0000 1.52 +++ e.h 9 Dec 2006 06:28:25 -0000 1.53 @@ -18,6 +18,7 @@ #include <sys/stat.h> #include <sys/time.h> #include <sys/param.h> +#include <pwd.h> #include <dlfcn.h> #include <math.h> #include <fnmatch.h> =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_fm_prop.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- e_fm_prop.c 5 Dec 2006 14:28:48 -0000 1.2 +++ e_fm_prop.c 9 Dec 2006 06:28:25 -0000 1.3 @@ -12,6 +12,7 @@ * + show mimetype * + show permissions (others read, others write) * + show preview + * + show owner * * show icon * * show symlink/fifo/socket/etc. status * * show broken link status @@ -27,7 +28,9 @@ * * show comment * * show generic * * show mount status + * * show setuid bit * * show link destination (if symlink or link) + * * show group * * change link destination * * change app to open THIS file with (or dir) * @@ -42,17 +45,31 @@ static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata); static Evas_Object *_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata); +static void _cb_icon_sel(void *data, void *data2); +static void _cb_type(void *data, Evas_Object *obj, void *event_info); +static void _cb_preview_update(void *data, Evas_Object *obj, void *event_info); + /* Actual config data we will be playing with whil the dialog is active */ struct _E_Config_Dialog_Data { E_Fm2_Icon_Info *fi; + struct { + Evas_Object *icon_wid; + Evas_Object *preview; + Evas_Object *preview_table; + } gui; /*- BASIC -*/ char *file; char *size; char *mod_date; char *mime; + char *owner; + int owner_read; + int owner_write; int others_read; int others_write; + int icon_type; + int icon_mime; /*- ADVANCED -*/ }; @@ -85,12 +102,17 @@ _fill_data(E_Config_Dialog_Data *cfdata, E_Fm2_Icon_Info *fi) { char buf[4096]; + struct passwd *pw; cfdata->fi = fi; if (fi->file) cfdata->file = strdup(fi->file); cfdata->size = e_util_size_string_get(fi->statinfo.st_size); cfdata->mod_date = e_util_file_time_get(fi->statinfo.st_mtime); if (fi->mime) cfdata->mime = strdup(fi->mime); + pw = getpwuid(fi->statinfo.st_uid); + if (pw) cfdata->owner = strdup(pw->pw_name); + if (fi->statinfo.st_mode & S_IRUSR) cfdata->owner_read = 1; + if (fi->statinfo.st_mode & S_IWUSR) cfdata->owner_write = 1; if (fi->statinfo.st_mode & S_IROTH) cfdata->others_read = 1; if (fi->statinfo.st_mode & S_IWOTH) cfdata->others_write = 1; } @@ -117,6 +139,7 @@ E_FREE(cfdata->size); E_FREE(cfdata->mod_date); E_FREE(cfdata->mime); + E_FREE(cfdata->owner); free(cfdata); } @@ -138,7 +161,8 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata) { /* generate the core widget layout for a basic dialog */ - Evas_Object *o, *ot, *ob, *of; + Evas_Object *o, *ot, *ob, *of, *oi; + E_Radio_Group *rg; char buf[4096]; snprintf(buf, sizeof(buf), "%s/%s", @@ -175,34 +199,74 @@ e_widget_entry_readonly_set(ob, 1); e_widget_table_object_append(ot, ob, 1, 3, 1, 1, 1, 0, 1, 0); - of = e_widget_framelist_add(evas, _("Permissions"), 0); + of = e_widget_frametable_add(evas, _("Permissions"), 0); + ob = e_widget_label_add(evas, _("Owner:")); + e_widget_frametable_object_append(of, ob, 0, 0, 1, 1, 1, 1, 1, 1); + ob = e_widget_entry_add(evas, &(cfdata->owner)); + e_widget_min_size_set(ob, 60, -1); + e_widget_entry_readonly_set(ob, 1); + e_widget_frametable_object_append(of, ob, 1, 0, 1, 1, 1, 1, 1, 1); ob = e_widget_check_add(evas, _("Others can read"), &(cfdata->others_read)); - e_widget_framelist_object_append(of, ob); + e_widget_frametable_object_append(of, ob, 0, 1, 1, 1, 1, 1, 1, 1); ob = e_widget_check_add(evas, _("Others can write"), &(cfdata->others_write)); - e_widget_framelist_object_append(of, ob); + e_widget_frametable_object_append(of, ob, 0, 2, 1, 1, 1, 1, 1, 1); + ob = e_widget_check_add(evas, _("Owner can read"), &(cfdata->owner_read)); + e_widget_frametable_object_append(of, ob, 1, 1, 1, 1, 1, 1, 1, 1); + ob = e_widget_check_add(evas, _("Owner can write"), &(cfdata->owner_write)); + e_widget_frametable_object_append(of, ob, 1, 2, 1, 1, 1, 1, 1, 1); e_widget_table_object_append(ot, of, 0, 4, 2, 1, 1, 0, 1, 0); e_widget_table_object_append(o, ot, 0, 0, 1, 1, 1, 1, 1, 1); + of = e_widget_frametable_add(evas, _("Preview"), 0); + ot = e_widget_table_add(evas, 0); - ob = e_widget_preview_add(evas, 128, 128); - e_widget_table_object_append(ot, ob, 0, 0, 1, 1, 1, 1, 1, 1); + cfdata->gui.preview = ob; + cfdata->gui.preview_table = ot; + evas_object_smart_callback_add(ob, "preview_update", + _cb_preview_update, cfdata); + e_widget_table_object_append(ot, ob, 0, 0, 1, 1, 0, 0, 1, 1); e_widget_preview_thumb_set(ob, buf, "e/desktop/background", 128, 128); + e_widget_frametable_object_append(of, ot, 0, 0, 1, 1, 1, 1, 1, 1); - e_widget_table_object_append(o, ot, 1, 0, 1, 1, 1, 1, 1, 1); + e_widget_table_object_append(o, of, 1, 0, 1, 1, 1, 1, 1, 1); + + ot = e_widget_frametable_add(evas, _("Icon"), 0); + + ob = e_widget_button_add(evas, "", NULL, _cb_icon_sel, cfdata, cfd); + cfdata->gui.icon_wid = ob; + if (0) /* FIXME: find icon */ + { + oi = NULL; + e_widget_button_icon_set(ob, oi); + } + e_widget_disabled_set(ob, 1); + e_widget_frametable_object_append(ot, ob, 0, 0, 1, 3, 1, 1, 1, 1); + + rg = e_widget_radio_group_new(&cfdata->icon_type); + ob = e_widget_radio_add(evas, _("Thumbnail"), 0, rg); + evas_object_smart_callback_add(ob, "changed", _cb_type, cfdata); + e_widget_frametable_object_append(ot, ob, 1, 0, 1, 1, 1, 1, 1, 1); + ob = e_widget_radio_add(evas, _("Theme Icon"), 1, rg); + evas_object_smart_callback_add(ob, "changed", _cb_type, cfdata); + e_widget_frametable_object_append(ot, ob, 1, 1, 1, 1, 1, 1, 1, 1); + ob = e_widget_radio_add(evas, _("Edje File"), 2, rg); + evas_object_smart_callback_add(ob, "changed", _cb_type, cfdata); + e_widget_frametable_object_append(ot, ob, 1, 2, 1, 1, 1, 1, 1, 1); + ob = e_widget_radio_add(evas, _("Image"), 3, rg); + evas_object_smart_callback_add(ob, "changed", _cb_type, cfdata); + e_widget_frametable_object_append(ot, ob, 2, 0, 1, 1, 1, 1, 1, 1); + ob = e_widget_radio_add(evas, _("Default"), 4, rg); + evas_object_smart_callback_add(ob, "changed", _cb_type, cfdata); + e_widget_frametable_object_append(ot, ob, 2, 1, 1, 1, 1, 1, 1, 1); + + ob = e_widget_check_add(evas, _("Use this icon for files of this type"), &(cfdata->icon_mime)); + e_widget_frametable_object_append(ot, ob, 0, 3, 3, 1, 1, 1, 1, 1); + + e_widget_table_object_append(o, ot, 0, 1, 2, 1, 1, 1, 1, 1); -/* - o = e_widget_list_add(evas, 0, 0); - rg = e_widget_radio_group_new(&(cfdata->mode)); - ob = e_widget_radio_add(evas, _("Click Window to Focus"), E_FOCUS_CLICK, rg); - e_widget_list_object_append(o, ob, 1, 1, 0.5); - ob = e_widget_radio_add(evas, _("Window under the Mouse"), E_FOCUS_MOUSE, rg); - e_widget_list_object_append(o, ob, 1, 1, 0.5); - ob = e_widget_radio_add(evas, _("Most recent Window under the Mouse"), E_FOCUS_SLOPPY, rg); - e_widget_list_object_append(o, ob, 1, 1, 0.5); - */ return o; } @@ -213,43 +277,41 @@ Evas_Object *o; o = e_widget_table_add(evas, 0); -/* - o = e_widget_list_add(evas, 0, 0); - - of = e_widget_framelist_add(evas, _("Focus"), 0); - rg = e_widget_radio_group_new(&(cfdata->focus_policy)); - ob = e_widget_radio_add(evas, _("Click to focus"), E_FOCUS_CLICK, rg); - e_widget_framelist_object_append(of, ob); - ob = e_widget_radio_add(evas, _("Pointer focus"), E_FOCUS_MOUSE, rg); - e_widget_framelist_object_append(of, ob); - ob = e_widget_radio_add(evas, _("Sloppy focus"), E_FOCUS_SLOPPY, rg); - e_widget_framelist_object_append(of, ob); - e_widget_list_object_append(o, of, 1, 1, 0.5); - - of = e_widget_framelist_add(evas, _("New Window Focus"), 0); - rg = e_widget_radio_group_new(&(cfdata->focus_setting)); - ob = e_widget_radio_add(evas, _("No new windows get focus"), E_FOCUS_NONE, rg); - e_widget_framelist_object_append(of, ob); - ob = e_widget_radio_add(evas, _("All new windows get focus"), E_FOCUS_NEW_WINDOW, rg); - e_widget_framelist_object_append(of, ob); - ob = e_widget_radio_add(evas, _("Only new dialogs get focus"), E_FOCUS_NEW_DIALOG, rg); - e_widget_framelist_object_append(of, ob); - ob = e_widget_radio_add(evas, _("Only new dialogs get focus if the parent has focus"), E_FOCUS_NEW_DIALOG_IF_OWNER_FOCUSED, rg); - e_widget_framelist_object_append(of, ob); - e_widget_list_object_append(o, of, 1, 1, 0.5); - - of = e_widget_framelist_add(evas, _("Other Settings"), 0); - ob = e_widget_check_add(evas, _("Always pass on caught click events to programs"), &(cfdata->pass_click_on)); - e_widget_framelist_object_append(of, ob); - ob = e_widget_check_add(evas, _("A click on a window always raises it"), &(cfdata->always_click_to_raise)); - e_widget_framelist_object_append(of, ob); - ob = e_widget_check_add(evas, _("A click in a window always focuses it"), &(cfdata->always_click_to_focus)); - e_widget_framelist_object_append(of, ob); - ob = e_widget_check_add(evas, _("Refocus last focused window on desktop switch"), &(cfdata->focus_last_focused_per_desktop)); - e_widget_framelist_object_append(of, ob); - ob = e_widget_check_add(evas, _("Revert focus when hiding or closing a window"), &(cfdata->focus_revert_on_hide_or_close)); - e_widget_framelist_object_append(of, ob); - e_widget_list_object_append(o, of, 1, 1, 0.5); -*/ return o; +} + + + + + +static void +_cb_icon_sel(void *data, void *data2) +{ + E_Config_Dialog_Data *cfdata; + + cfdata = data; + /* FIXME: select an icon */ +} + +static void +_cb_type(void *data, Evas_Object *obj, void *event_info) +{ + E_Config_Dialog_Data *cfdata; + + cfdata = data; + if ((cfdata->icon_type == 2) || (cfdata->icon_type == 3)) + e_widget_disabled_set(cfdata->gui.icon_wid, 0); + else + e_widget_disabled_set(cfdata->gui.icon_wid, 1); +} + +static void +_cb_preview_update(void *data, Evas_Object *obj, void *event_info) +{ + E_Config_Dialog_Data *cfdata; + + cfdata = data; + e_widget_table_object_repack(cfdata->gui.preview_table, + cfdata->gui.preview, + 0, 0, 1, 1, 0, 0, 1, 1); } =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_widget_fsel.c,v retrieving revision 1.48 retrieving revision 1.49 diff -u -3 -r1.48 -r1.49 --- e_widget_fsel.c 5 Dec 2006 14:28:48 -0000 1.48 +++ e_widget_fsel.c 9 Dec 2006 06:28:25 -0000 1.49 @@ -560,10 +560,8 @@ _e_wid_fsel_preview_update(void *data, Evas_Object *obj, void *event_info) { E_Widget_Data *wd; - Evas_Coord w = 0, h = 0; wd = data; - evas_object_geometry_get(obj, NULL, NULL, &w, &h); e_widget_table_object_repack(wd->o_preview_preview_table, wd->o_preview_preview, 0, 0, 1, 1, 0, 0, 1, 1); ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs